在同一台机器上运行两个cassandra版本 [英] run two cassandra versions in the same machine

查看:414
本文介绍了在同一台机器上运行两个cassandra版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



我开始一个集群,在 cassandra config 9161

 #TCP端口,用于命令和数据
storage_port:7000

#SSL端口,用于加密通信。除非在
#encryption_options
中启用,否则为
ssl_storage_port:7004
CQL本地传输端口,用于侦听
上的客户端native_transport_port:9043

Thrift在
上监听客户端rpc_port:9161

seed_provider:
#被认为是联络点的主机地址。
#Cassandra节点使用此主机列表来查找彼此并学习
#环的拓扑。如果您正在运行
#多个节点,则必须更改此值!
- class_name:org.apache.cassandra.locator.SimpleSeedProvider
parameters:
#seeds实际上是一个以逗号分隔的地址列表。
#Ex:< ip1>,< ip2>,< ip3>
- 种子:127.0.0.1

运行良好,

  $ /usr/local/apache-cassandra-2.1.1/bin/cassandra -f 
...
INFO 05:08:42从文件加载设置:/usr/local/apache-cassandra-2.1.1/conf/cassandra.yaml
...
INFO 05:09:29开始侦听CQL客户端on localhost / 127.0.0.1:9043 ...
INFO 05:09:29绑定节俭服务到localhost / 127.0.0.1:9161
INFO 05:09:29窃听客户端...
INFO 05:19:25没有要压缩用于用户定义压缩的文件


$ jps
5866 CassandraDaemon
8848 Jps

但是当启动另一个配置为在端口 9160 下运行的cassandra集群时,

 #TCP端口,用于命令和数据
storage_port:7000

#SSL端口,用于加密通信。未使用,除非在
#encryption_options
中启用
ssl_storage_port:7004
CQL本地传输端口用于侦听
上的客户端native_transport_port:9042

Thrift端口在
上监听客户端rpc_port:9160

seed_provider:
#被认为是联络点的主机地址。
#Cassandra节点使用此主机列表来查找彼此并学习
#环的拓扑。如果您正在运行
#多个节点,则必须更改此值!
- class_name:org.apache.cassandra.locator.SimpleSeedProvider
parameters:
#seeds实际上是一个以逗号分隔的地址列表。
#Ex:< ip1>,< ip2>,< ip3>
- 种子:127.0.0.1

b
$ b

  $ /usr/local/apache-cassandra-2.0.11/bin/cassandra -f 
无法绑定JMX,是Cassandra已经运行?如何在同一台机器上运行两个不同版本的cassandra?



b
$ b

问题是我没有权限停止以前的版本。我也不能使用 https://github.com/pcmanus/ccm

解决方案

我修改它改变几个配置 storage_port / ssl_storage_port 中的 conf / cassandra.yaml cassandra-env.sh



conf / cassandra.yaml



 #TCP端口,用于命令和数据
storage_port:7004

#SSL端口,用于加密通信。除非在
中启用,否则$ b $ encryption_options
ssl_storage_port:7005

CQL本地传输端口,用于侦听
上的客户端native_transport_port:9043

端口为Thrift听客户
rpc_port:9161

seed_provider:
#被认为是联系点的主机的地址。
#Cassandra节点使用此主机列表来查找彼此并学习
#环的拓扑。如果您正在运行
#多个节点,则必须更改此值!
- class_name:org.apache.cassandra.locator.SimpleSeedProvider
parameters:
#seeds实际上是一个逗号分隔的地址列表。
#Ex:< ip1>,< ip2>,< ip3>
- 种子:127.0.0.1



conf / cassandra-env.sh < h1>

 #指定Cassandra可用于
#JMX连接的默认端口。
JMX_PORT =7200


I have a scenario to run cassandra of two different versions in the same machine but at different ports.

I started one cluster with following cassandra config at port 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"

It runs well,

$ /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

However while starting another cassandra cluster configured to run at port 9160 with 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: 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"

it fails with message

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

How can I make it run two different version of cassandra in the same machine?

The problem is that I have no permission to stop the previous version. Neither can I use https://github.com/pcmanus/ccm

解决方案

Well I fixed it with changing few more configurations which are storage_port/ssl_storage_port in conf/cassandra.yaml and JMX_PORT in conf/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" 

这篇关于在同一台机器上运行两个cassandra版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆