最近、2 つのノードを持つ Cassandra クラスターをセットアップしました。レプリケーション係数は 2 に設定されており、両方のノードがオンになっている場合、両方ともうまく機能しているようです。少なくとも1つのノードが稼働している限り、ヘクターが機能し続けるようにするにはどうすればよいでしょうか? 今のところ、次のようなものがあります。
CassandraHostConfigurator cassandraHostConfigurator = new CassandraHostConfigurator(
"localhost:9160,xx.xx.13.22:9160");
cassandraHostConfigurator.setMaxActive(20);
cassandraHostConfigurator.setMaxIdle(5);
cassandraHostConfigurator.setCassandraThriftSocketTimeout(3000);
cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(4000);
Cluster cluster = HFactory.getOrCreateCluster("structspeech",
cassandraHostConfigurator);
Keyspace keyspace = HFactory.createKeyspace("structspeech", cluster);
....
ホスト xx.xx.13.22 がダウンすると、コンソールに次のメッセージが表示され、そのノードが起動するまですべての挿入が失敗するとします。
Downed xx.xx.13.22(xx.xx.13.22):9160 host still appears to be down: Unable to open transport to xx.xx.13.22(xx.xx.13.22):9160 , java.net.ConnectException: Connection refused: connect
これが私のキースペースの定義方法です
update keyspace structspeech with placement_strategy =
'org.apache.cassandra.locator.SimpleStrategy'
and strategy_options =[{replication_factor:2}];
私は非常に些細なことを見逃していると確信しています。どんな助けでも大歓迎です。ありがとう