Cassandra 集群配置,cassandra集群配置
Installation from binary tarball files
1、下载最新的稳定版
http://cassandra.apache.org/download/
2、解压文件,例如:
tar -xvf apache-cassandra-3.6-bin.tar.gz cassandra
3、
CASSANDRA_HOME=/root/cassandra/apache-cassandra-1.2.5
export PATH=$PATH:$CASSANDRA_HOME/bin
Cassandra 集群配置
cluster_name: 'Test Cluster'
#逗号分隔的集群IP地址
parameters: - seeds: "192.168.232.142 "
#一般不用修改这个端口,但是要确保没有被防火墙屏蔽
storage_port:1234
#监听,要与seeds一致,否则提示 java.lang.RuntimeException: Unable to gossip with any seeds 异常
listen_address: 192.168.232.142#存放data files
data_file_directories: - /var/lib/cassandra/data
#commitlog files
commitlog_directory: /var/lib/cassandra/commitlog
#caches files
saved_caches_directory: /var/lib/cassandra/saved_caches
Cassandra没有传统集群的中心节点,各个节点地位都是平等,通过Gossip协议维持集群中的节点信息。为了使集群中的各节点在启动时能够发现其他节点,需要指定种子节点,各节点都先和种子节点通信,通过种子节点获取其他节点列表,然后和其他节点通信
No appropriate python interpreter found.
出现这个问题的原因是大部分Linux系统自带的Python版本为2.6,只有将2.6升级为2.7以上 然后在启动Cassandra服务,这个时候就可以启动 cqlsh了
记得要修改/usr/bin/python软连接为2.7版本的地址
$ bin/cqlsh localhost
Connected to Test Cluster at localhost:9042.
[cqlsh 5.0.1 | Cassandra 3.8 | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
cqlsh> SELECT cluster_name, listen_address FROM system.local;
cluster_name | listen_address
--------------+----------------
Test Cluster | 127.0.0.1
(1 rows)
cqlsh>
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。