将 OpenShift 中的 Cassandra 节点添加到现有集群

将 OpenShift 中的 Cassandra 节点添加到现有集群

我有 3 个 cassandra 节点(S1、S2、S3),安装在 CentOS 6 上。其中两个(S1、S2)位于数据中心 A,另一个(S3)位于 openshift。我正在尝试使用多个数据中心中的多个节点集群进行基准测试。

节点 S1 和 S2 上的 Cassandra 安装和配置基于在基于 RHEL 的系统上安装 DataStax Community另一方面,节点 S3(openshift)上的 Cassandra 安装基于如何在 OpenShift 上配置和运行 Cassandra

所有服务器运行良好,但我无法将节点 S3 添加到集群。所有服务器都有完全相同的配置文件(cassandra.yaml 和 cassandra-topology.properties)

节点 S1 和 S2 具有 1.2.18 版本的 cassandra。

[root@node1 ~]# cassandra -v
1.2.18

节点 S3 有 1.1.6 版本的 cassandra。

[cassandra-xxxx.rhcloud.com xxxxxxxx]\> app-root/data/cassandra/bin/cassandra -v
xss =  -ea -javaagent:app-root/data/cassandra/bin/../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms1834M -Xmx1834M -Xmn256M -XX:+HeapDumpOnOutOfMemoryError -Xss180k
1.1.6 

所有节点都有相同的 cassandra.yaml 和 cassandra-topology.properties 配置,如下所示(监听 ip 地址除外)。

cassandra.yaml

cluster_name: 'MyDemoCluster'
num_tokens: 256
seed_provider:
  - class_name: org.apache.cassandra.locator.SimpleSeedProvider
    parameters:
         - seeds:  "x.x.x.236"
listen_address: x.x.x.x
endpoint_snitch: PropertyFileSnitch

cassandra-拓扑.properties

# Cassandra Node IP=Data Center:Rack
x.x.x.236=XXX:RAC1
x.x.x.237=XXX:RAC2
y.y.y.yyy=OPS:RAC1

首先,我启动了种子节点,而其他节点停止。成功启动操作后,我启动了其他节点(日志文件中没有任何错误消息)。

然后,当我在种子节点上运行 nodetool 时,我只看到节点 S1 和 S2,但看不到节点 S3。

[root@node1]# nodetool status
Datacenter: XXX
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address          Load       Tokens  Owns (effective)  Host ID                               Rack
UN  x.x.x.236  79.25 KB   256     100.0%            xxxxxxxx-xxxx-404a-aa3f-fbddfb5da124  RAC2
UN  x.x.x.237  79.56 KB   256     100.0%            xxxxxxxx-xxxx-4b27-970b-76944c382c9f  RAC1

节点 S2 的 cassandra 日志

 INFO [HANDSHAKE-/x.x.x.236] 2014-08-08 11:25:26,120 OutboundTcpConnection.java (line 418) Handshaking version with /x.x.x.

在节点 S3 上运行 cassandra

    [cassandra-biberltd.rhcloud.com data]\> cassandra/bin/cassandra -f
xss =  -ea -javaagent:cassandra/bin/../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms1834M -Xmx1834M -Xmn256M -XX:+HeapDumpOnOutOfMemoryError -Xss180k
 INFO 11:36:31,296 Logging initialized
 INFO 11:36:31,305 JVM vendor/version: OpenJDK Server VM/1.7.0_65
 INFO 11:36:31,305 Heap size: 1896284160/1896284160
 INFO 11:36:31,305 Classpath: cassandra/bin/../conf:cassandra/bin/../build/classes/main:cassandra/bin/../build/classes/thrift:cassandra/bin/../lib/antlr-3.2.jar:cassandra/bin/../lib/apache-cassandra-1.1.6.jar:cassandra/bin/../lib/apache-cassandra-clientutil-1.1.6.jar:cassandra/bin/../lib/apache-cassandra-thrift-1.1.6.jar:cassandra/bin/../lib/avro-1.4.0-fixes.jar:cassandra/bin/../lib/avro-1.4.0-sources-fixes.jar:cassandra/bin/../lib/commons-cli-1.1.jar:cassandra/bin/../lib/commons-codec-1.2.jar:cassandra/bin/../lib/commons-lang-2.4.jar:cassandra/bin/../lib/compress-lzf-0.8.4.jar:cassandra/bin/../lib/concurrentlinkedhashmap-lru-1.3.jar:cassandra/bin/../lib/guava-r08.jar:cassandra/bin/../lib/high-scale-lib-1.1.2.jar:cassandra/bin/../lib/jackson-core-asl-1.9.2.jar:cassandra/bin/../lib/jackson-mapper-asl-1.9.2.jar:cassandra/bin/../lib/jamm-0.2.5.jar:cassandra/bin/../lib/jline-0.9.94.jar:cassandra/bin/../lib/json-simple-1.1.jar:cassandra/bin/../lib/libthrift-0.7.0.jar:cassandra/bin/../lib/log4j-1.2.16.jar:cassandra/bin/../lib/metrics-core-2.0.3.jar:cassandra/bin/../lib/servlet-api-2.5-20081211.jar:cassandra/bin/../lib/slf4j-api-1.6.1.jar:cassandra/bin/../lib/slf4j-log4j12-1.6.1.jar:cassandra/bin/../lib/snakeyaml-1.6.jar:cassandra/bin/../lib/snappy-java-1.0.4.1.jar:cassandra/bin/../lib/snaptree-0.1.jar:cassandra/bin/../lib/jamm-0.2.5.jar
 INFO 11:36:31,308 JNA not found. Native methods will be disabled.
 INFO 11:36:31,329 Loading settings from file:/var/lib/openshift/53e4cf805004462c540000a9/app-root/data/cassandra/conf/cassandra.yaml
 INFO 11:36:31,649 32bit JVM detected.  It is recommended to run Cassandra on a 64bit JVM for better performance.
 INFO 11:36:31,650 DiskAccessMode 'auto' determined to be standard, indexAccessMode is standard
 INFO 11:36:32,322 Global memtable threshold is enabled at 602MB
 INFO 11:36:33,196 Initializing key cache with capacity of 90 MBs.
 INFO 11:36:33,218 Scheduling key cache save to each 14400 seconds (going to save all keys).
 INFO 11:36:33,220 Initializing row cache with capacity of 0 MBs and provider org.apache.cassandra.cache.SerializingCacheProvider
 INFO 11:36:33,228 Scheduling row cache save to each 0 seconds (going to save all keys).
 INFO 11:36:33,595 Couldn't detect any schema definitions in local storage.
 INFO 11:36:33,596 Found table data in data directories. Consider using the CLI to define your schema.
 INFO 11:36:33,664 No commitlog files found; skipping replay
 INFO 11:36:33,730 Cassandra version: 1.1.6
 INFO 11:36:33,730 Thrift API version: 19.32.0
 INFO 11:36:33,735 CQL supported versions: 2.0.0,3.0.0-beta1 (default: 2.0.0)
 INFO 11:36:33,835 Loading persisted ring state
 INFO 11:36:33,839 Starting up server gossip
 INFO 11:36:33,862 Enqueuing flush of Memtable-LocationInfo@8039520(135/168 serialized/live bytes, 3 ops)
 INFO 11:36:33,863 Writing Memtable-LocationInfo@8039520(135/168 serialized/live bytes, 3 ops)
 INFO 11:36:33,945 Completed flushing $HOME/app-root/data/cassandra-data/data/system/LocationInfo/system-LocationInfo-hf-1-Data.db (243 bytes) for commitlog position ReplayPosition(segmentId=1407512193559, position=595)
 INFO 11:36:33,982 Starting Messaging Service on port 17000
 INFO 11:36:33,995 JOINING: waiting for ring information
 INFO 11:37:04,035 JOINING: schema complete, ready to bootstrap
 INFO 11:37:04,036 JOINING: getting bootstrap token
 INFO 11:37:04,045 Enqueuing flush of Memtable-LocationInfo@21839213(53/66 serialized/live bytes, 2 ops)
 INFO 11:37:04,046 Writing Memtable-LocationInfo@21839213(53/66 serialized/live bytes, 2 ops)
 INFO 11:37:04,079 Completed flushing $HOME/app-root/data/cassandra-data/data/system/LocationInfo/system-LocationInfo-hf-2-Data.db (163 bytes) for commitlog position ReplayPosition(segmentId=1407512193559, position=776)
 INFO 11:37:04,082 JOINING: sleeping 30000 ms for pending range setup
 INFO 11:37:34,083 JOINING: Starting to bootstrap...
 INFO 11:37:34,103 Enqueuing flush of Memtable-LocationInfo@21895329(53/66 serialized/live bytes, 2 ops)
 INFO 11:37:34,103 Writing Memtable-LocationInfo@21895329(53/66 serialized/live bytes, 2 ops)
 INFO 11:37:34,140 Completed flushing $HOME/app-root/data/cassandra-data/data/system/LocationInfo/system-LocationInfo-hf-3-Data.db (163 bytes) for commitlog position ReplayPosition(segmentId=1407512193559, position=957)
 INFO 11:37:34,154 Node /y.y.y.yyy state jump to normal
 INFO 11:37:34,155 Bootstrap/Replace/Move completed! Now serving reads.
 INFO 11:37:34,221 Binding thrift service to /y.y.y.yyy:19160
 INFO 11:37:34,226 Using TFastFramedTransport with a max frame size of 15728640 bytes.
 INFO 11:37:34,232 Using synchronous/threadpool thrift server on /y.y.y.yyy : 19160
 INFO 11:37:34,233 Listening for thrift clients...

我只发现

 INFO 11:36:31,308 JNA not found. Native methods will be disabled.

我的问题是

  1. 如何将 openshift 节点添加到集群?
  2. openshift 是否支持属于多个数据中心集群的节点?
  3. 所有节点都必须具有相同版本的 Cassandra 吗?

相关内容