cassandra主配置文件:cassandra.yaml
a) cluster_name:集群名,同一集群的多个节点,集群名要一致
b) seeds: 种子节点,集群中的全部机器的ip,以逗号隔开
c) storage_port: Cassandra服务器与服务器之间连接的端口号,一般不需要修改,但要保证此端口上没有防火墙
d) listen_address: Cassandra集群中服务器与服务器之间相互通信的地址。如果留空,将默认使用服务器的机器名
e) native_transport_port: 默认的CQL本地服务端口,本地的cql客户端与服务器交互的端口
https://blog.csdn.net/smile_bestsun/article/details/52790485
导出导入数据结构:cqlsh -u cassandra -p cassandra 10.200.250.192(server ip) -e 'desc keyspace clicki_dc(keyspace name)' > db.cql(db's file)
cqlsh -u cassandra -p cassandra 10.200.250.190(server ip) -f db.cql(db's file)
导出表数据:./cqlsh -u cassandra -p cassandra 10.200.250.192(server ip) -e "COPY keyspace.table TO '/root/export.csv'"
导入表数据:./cqlsh -u cassandra -p cassandra 10.200.250.192(server ip) -e "COPY keyspace.table FROM '/root/import.csv'"
登陆命令:./cqlsh -u cassandra -p cassandra $IP
创建用户:CREATE USER myusername WITH PASSWORD 'mypassword' SUPERUSER ;
CREATE USER myusername WITH PASSWORD 'mypassword';
查看用户:list users;
授权:GRANT ALL ON keyspace_name TO user_name;
查看某个用户的权限:LIST ALL PERMISSIONS OF user_name;
收回权限:REVOKE ALL PERMISSIONS ON keyspace_name FROM user_name;
查看所有keyspace:DESCRIBE KEYSPACES;
查看指定keyspace结构:DESCRIBE KEYSPACES keyspace_name;
查看表:DESCRIBE TABLES;