cassandra cqlsh 使用实际IP或者locahost都可以进入命令行

cassandra cqlsh 使用IP或者locahost进入

  • cassandra cqlsh 使用IP或者locahost进入
    • 1. 下载安装cassandra
    • 2. 解压cassandra
    • 3. 修改配置文件
    • 4. 测试cqlsh命令行

cassandra cqlsh 使用IP或者locahost进入

1. 下载安装cassandra

执行命令:
wget https://www-eu.apache.org/dist/cassandra/3.11.4/apache-cassandra-3.11.4-bin.tar.gz

2. 解压cassandra

tar -zxvf apache-cassandra-3.11.4-bin.tar.gz
mv apache-cassandra-3.11.4 /usr/local/cassandra

3. 修改配置文件

修改下面加粗的配置

[root@localhost conf]# vim /usr/local/cassandra/conf/cassandra.yaml

cluster_name: test


data_file_directories:
     - /home/xinyiasr/zimujingling/cassandra/cassandra/data
commitlog_directory: 
     - /home/xinyiasr/zimujingling/cassandra/cassandra/commitlog

seed_provider:
    # Addresses of hosts that are deemed contact points. 
    # Cassandra nodes use this list of hosts to find each other and learn
    # the topology of the ring.  You must change this if you are running
    # multiple nodes!
    #- class_name: org.apache.cassandra.locator.SimpleSeedProvider
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
          # seeds is actually a comma-delimited list of addresses.
          # Ex: ",,"
          - seeds: "192.168.0.225,127.0.0.1"


listen_address: 192.168.0.225

start_rpc: true

rpc_address: 0.0.0.0

broadcast_rpc_address: 192.168.0.255

4. 测试cqlsh命令行

[root@localhost bin]# ./cqlsh
Connected to avic at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> exit
[root@localhost bin]# ./cqlsh 127.0.0.1
Connected to avic at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> exit
[root@localhost bin]# ./cqlsh 192.168.0.225
Connected to avic at 192.168.0.225:9042.
[cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> exit
[root@localhost bin]# 

你可能感兴趣的:(cassandra,cqlsh,ip,127.0.0.1,localhost)