# 统共四台机器,在/etc/hosts中已经将机器ip和机器名进行了映射
host4:作为main主机
host5,host6,host7:这三台机器作为seeds
- seeds: "host5,host6,host7"
listen_address:host4
rpc_address:host4
rpc_port: 9160
rpc_keepalive: true
- seeds: "host5,host6,host7"
listen_address:host5
rpc_address:host5
rpc_port: 9160
rpc_keepalive: true
- seeds: "host5,host6,host7"
listen_address:host6
rpc_address:host6
rpc_port: 9160
rpc_keepalive: true
- seeds: "host5,host6,host7"
listen_address:host7
rpc_address:host7
rpc_port: 9160
rpc_keepalive: true
rm -rf /home/user31/app/apache-cassandra-3.11.2/data/data/system/*
注意:需要按照顺序启动:首先是seeds主机,最后main主机
# 在host5,host6,host7分别执行
$CASSANDRA_HOME/bin/cassandra
# 最后在host4上执行
$CASSANDRA_HOME/bin/cassandra
# 在main主机上执行
nodetool status
$CASSANDRA_HOME/conf/cassandra-env.sh :修改7199端口
$CASSANDRA_HOME/bin/cassandra.bat 7199
$CASSANDRA_HOME/conf/cassandra.yaml
storage_port: 7101 7000
ssl_storage_port: 7102 7001
rpc_port: 9161 9160
查看端口:lsof -i 7000