使用ebs更改ec2上的专用IP时,Cassandra2.0.1无法重新启动

fhg3lkii  于 2023-03-18  发布在  Cassandra
关注(0)|答案(2)|浏览(193)

我在AWS上使用3个EC2示例节点的cassandra集群。
每个节点在路径(/usr/lib/cassandra/)上挂载一个EBS卷,这样cassandra的数据就存储在EBS卷中。
所有节点都有一个DNS来指向自己的私有IP,并且所有的cassandra配置文件都使用DNS来代替私有IP。
我的问题是:当一个节点结束时,我会启动另一个cassandra,并将EBS挂载到新启动的示例上,这样数据就不会丢失,但当启动cassandra服务时,cassandra服务会失败,日志如下:
我不知道为什么它会使用其他节点的ip?

INFO 12:47:36,364 Writing Memtable-schema_keyspaces@1358300025(251/2510 serialized/live bytes, 8 ops)
 INFO 12:47:36,367 Enqueuing flush of Memtable-schema_columns@1982787565(91991/919910 serialized/live bytes, 2375 ops)
 INFO 12:47:36,367 Enqueuing flush of Memtable-schema_columnfamilies@59370809(38866/388660 serialized/live bytes, 1052 ops)
 INFO 12:47:36,385 Completed flushing /var/lib/cassandra/data/system/schema_keyspaces/system-schema_keyspaces-jb-10-Data.db (214 bytes) for commitlog position ReplayPosition(segmentId=1382719654978, position=289)
 INFO 12:47:36,391 Writing Memtable-schema_columns@1982787565(91991/919910 serialized/live bytes, 2375 ops)
 INFO 12:47:36,627 Completed flushing /var/lib/cassandra/data/system/schema_columns/system-schema_columns-jb-24-Data.db (19358 bytes) for commitlog position ReplayPosition(segmentId=1382719654978, position=289)
 INFO 12:47:36,628 Writing Memtable-schema_columnfamilies@59370809(38866/388660 serialized/live bytes, 1052 ops)
 INFO 12:47:36,660 Completed flushing /var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-24-Data.db (8750 bytes) for commitlog position ReplayPosition(segmentId=1382719654978, position=289)
 INFO 12:47:36,661 Log replay complete, 64 replayed mutations
 INFO 12:47:36,746 Compacting [SSTableReader(path='/var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-23-Data.db'), SSTableReader(path='/var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-22-Data.db'), SSTableReader(path='/var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-24-Data.db'), SSTableReader(path='/var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-21-Data.db')]
 INFO 12:47:37,584 Compacted 4 sstables to [/var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-25,].  34,990 bytes to 8,759 (~25% of original) in 809ms = 0.010325MB/s.  16 total rows, 4 unique.  Row merge counts were {1:0, 2:0, 3:0, 4:4, }
 INFO 12:47:38,411 Cassandra version: 2.0.1
 INFO 12:47:38,412 Thrift API version: 19.37.0
 INFO 12:47:38,425 CQL supported versions: 2.0.0,3.1.1 (default: 3.1.1)
 INFO 12:47:38,485 Loading persisted ring state
ERROR 12:47:38,537 Exception encountered during startup
java.lang.RuntimeException: Unknown host /172.31.9.175 with no default configured
        at org.apache.cassandra.locator.PropertyFileSnitch.getEndpointInfo(PropertyFileSnitch.java:90)
        at org.apache.cassandra.locator.PropertyFileSnitch.getDatacenter(PropertyFileSnitch.java:113)
        at org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:127)
        at org.apache.cassandra.locator.TokenMetadata$Topology.addEndpoint(TokenMetadata.java:1049)
        at org.apache.cassandra.locator.TokenMetadata.updateNormalTokens(TokenMetadata.java:187)
        at org.apache.cassandra.locator.TokenMetadata.updateNormalTokens(TokenMetadata.java:159)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:470)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:428)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:343)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:442)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:485)
java.lang.RuntimeException: Unknown host /172.31.9.175 with no default configured
        at org.apache.cassandra.locator.PropertyFileSnitch.getEndpointInfo(PropertyFileSnitch.java:90)
        at org.apache.cassandra.locator.PropertyFileSnitch.getDatacenter(PropertyFileSnitch.java:113)
        at org.apache.cassandra.locator.DynamicEndpointSnitch.getDatacenter(DynamicEndpointSnitch.java:127)
        at org.apache.cassandra.locator.TokenMetadata$Topology.addEndpoint(TokenMetadata.java:1049)
        at org.apache.cassandra.locator.TokenMetadata.updateNormalTokens(TokenMetadata.java:187)
        at org.apache.cassandra.locator.TokenMetadata.updateNormalTokens(TokenMetadata.java:159)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:470)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:428)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:343)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:442)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:485)
Exception encountered during startup: Unknown host /172.31.9.175 with no default configured
yqkkidmi

yqkkidmi1#

我可能是错的,但是在你的cassandra.yaml中,你可能想看看seeds变量,它可能是错误地引用了一个旧的IP。另一个解决这个问题的方法是使用AWS中的一些浮动IP。这样,如果你启动一台新机器,你可以将浮动IP指向它,并且配置不必改变IP。

pod7payv

pod7payv2#

检查是否已在snitch属性文件中为未知节点配置了默认值。

default =<Any of your DC name>:RAC1

更改后重新启动,希望这会有所帮助。

相关问题