运行在同一机两台卡桑德拉版本(run two cassandra versions in the s

2019-10-21 14:02发布

我有一种情况在同一台机器,但在不同的端口上运行两个不同版本的卡桑德拉。

我开始一个集群以下cassandra在端口配置9161

# TCP port, for commands and data                                                                   
storage_port: 7000                                                                                  

# SSL port, for encrypted communication.  Unused unless enabled in                                  
# encryption_options                                                                                
ssl_storage_port: 7004 
port for the CQL native transport to listen for clients on                                        
native_transport_port: 9043

port for Thrift to listen for clients on                                                          
rpc_port: 9161

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                                   
      parameters:                                                                                   
          # seeds is actually a comma-delimited list of addresses.                                                                                    
          # Ex: "<ip1>,<ip2>,<ip3>"                                                                 
          - seeds: "127.0.0.1"

它运行良好,

$ /usr/local/apache-cassandra-2.1.1/bin/cassandra -f
...
INFO  05:08:42 Loading settings from file:/usr/local/apache-cassandra-2.1.1/conf/cassandra.yaml
...
INFO  05:09:29 Starting listening for CQL clients on localhost/127.0.0.1:9043...
INFO  05:09:29 Binding thrift service to localhost/127.0.0.1:9161
INFO  05:09:29 Listening for thrift clients...
INFO  05:19:25 No files to compact for user defined compaction


$ jps
5866 CassandraDaemon
8848 Jps

然而在启动配置为在端口运行另一个卡桑德拉簇9160与配置,

# TCP port, for commands and data                                                                   
storage_port: 7000                                                                                  

# SSL port, for encrypted communication.  Unused unless enabled in                                  
# encryption_options                                                                                
ssl_storage_port: 7004 
port for the CQL native transport to listen for clients on                                        
native_transport_port: 9042

port for Thrift to listen for clients on                                                          
rpc_port: 9160

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                                   
      parameters:                                                                                   
          # seeds is actually a comma-delimited list of addresses.                                                                                    
          # Ex: "<ip1>,<ip2>,<ip3>"                                                                 
          - seeds: "127.0.0.1"

它失败消息

$ /usr/local/apache-cassandra-2.0.11/bin/cassandra -f
Unable to bind JMX, is Cassandra already running?

我怎样才能使它在同一台机器上运行两个不同版本的卡桑德拉?

问题是,我无权停止以前的版本。 无论是我可以用https://github.com/pcmanus/ccm

Answer 1:

问题是你的新版本Cassandra是还试图使用port 7199的JMX监控。 更改JMX端口,其他一些未使用的端口,那么它将启动。 该JMX端口可以被称为更改文件中的cassandraFolder/bin/cassandra.bat 。 将有一个线

-Dcom.sun.management.jmxremote.port=7199^

上述端口更改为其他未使用的端口。

如果您在Linux环境下使用卡桑德拉JMX配置将位于档案中称为cassandraFolder/conf/cassandra-env.sh 。 将有一个线

JMX_PORT="7199"

更改为其他一些未使用的端口。

但我不清楚你的问题。

你们是不是要运行新的卡桑德拉现有的集群中加入吗?

如果是的话,改变JMX端口就足够了。

你们是不是要在独立模式下运行新的卡桑德拉?

如果是的话,按照YAML文件中的配置改变。

  • 种子: “127.0.0.2”
  • listen_address:127.0.0.2
  • rpc_address:127.0.0.2

添加以下条目,

127.0.0.1       127.0.0.2

/etc/hosts文件,如果你要在Linux上运行。 如果您在Windows运行时添加在上面的条目C:\Windows\System32\drivers\etc\hosts文件。 如果你的内涵是在单机模式下运行,那么在你的配置小心。 如果你做什么错误的,那么你的新卡珊德拉将加入到现有的集群。

这个链接可以帮助你在一个单一的Windows机器上运行卡桑德拉集群



Answer 2:

嗯,我不断变化的几个配置哪些是固定的, storage_port / ssl_storage_portconf/cassandra.yamlJMX_PORTconf/cassandra-env.sh

CONF / cassandra.yaml

# TCP port, for commands and data                                                                   
storage_port: 7004                                                                                                                                    

# SSL port, for encrypted communication.  Unused unless enabled in                                  
# encryption_options                                                                                
ssl_storage_port: 7005  

port for the CQL native transport to listen for clients on                                        
native_transport_port: 9043

port for Thrift to listen for clients on                                                          
rpc_port: 9161

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                                   
      parameters:                                                                                   
          # seeds is actually a comma-delimited list of addresses.                                                                                    
          # Ex: "<ip1>,<ip2>,<ip3>"                                                                 
          - seeds: "127.0.0.1"

CONF / cassandra-env.sh

# Specifies the default port over which Cassandra will be available for                             
# JMX connections.                                                                                                                                    
JMX_PORT="7200" 


文章来源: run two cassandra versions in the same machine
标签: cassandra jmx