在同一台机器上运行两个cassandra版本

在同一台机器上运行两个cassandra版本,cassandra,jmx,Cassandra,Jmx,我有一个场景,在同一台机器上但在不同端口运行两个不同版本的cassandra 我在端口9161用以下cassandraconfig启动了一个集群 # TCP port, for commands and data storage_port: 7000

我有一个场景,在同一台机器上但在不同端口运行两个不同版本的cassandra

我在端口
9161
用以下
cassandra
config启动了一个集群

# 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"
但是,在启动另一个cassandra群集时,配置为使用config在端口
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"
如何让它在同一台机器上运行两个不同版本的cassandra


问题是我没有权限停止以前的版本。我也不能使用

问题是您的新版本cassandra也试图使用
端口7199
进行JMX监控。将JMX端口更改为其他未使用的端口,然后它将启动。JMX端口可以在名为
cassandraFolder/bin/cassandra.bat
的文件中更改。会有排队的

-Dcom.sun.management.jmxremote.port=7199^
JMX_PORT="7199"
将上述端口更改为其他未使用的端口

如果您在linux环境中使用cassandra,JMX配置将位于名为
cassandraFolder/conf/cassandra env.sh
的文件中。会有排队的

-Dcom.sun.management.jmxremote.port=7199^
JMX_PORT="7199"
将此更改为其他未使用的端口

但我不清楚你的问题

您是否正在尝试运行新的cassandra以加入现有群集?

如果是,更改JMX端口就足够了

您是否正在尝试以独立模式运行新的cassandra?

如果是,请在yaml文件中更改以下配置

  • 种子:“127.0.0.2”
  • 收听地址:127.0.0.2
  • rpc_地址:127.0.0.2
添加以下条目

127.0.0.1       127.0.0.2
/etc/hosts
文件中,如果您正在linux中运行。如果您在windows中运行,请在
C:\windows\System32\drivers\etc\hosts
文件中添加上述条目。如果您打算在独立模式下运行,那么在配置时要小心。如果你做错了什么,那么你的新卡桑德拉将加入现有集群


这有助于您在一台windows计算机上运行cassandra群集,我通过更改另外一些配置来修复它,这些配置是
conf/cassandra.yaml
中的
storage\u port
/
ssl\u storage\u port
conf/cassandra env.sh中的
JMX\u port
,它们都是

conf/cassandra.yaml
感谢@Jaya Ananthram的出色编写,同时我还修改了存储端口。我用的是linux。
# 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"
# Specifies the default port over which Cassandra will be available for                             
# JMX connections.                                                                                                                                    
JMX_PORT="7200"