开发者

How do I test is storage-conf is being loaded in Cassandra 0.7.3?

开发者 https://www.devze.com 2023-02-16 17:27 出处:网络
I have installed Cassandra and gotten it working on two machines. I have followed the instructions to hook them up to each other by configuring the storage-conf.xml files.

I have installed Cassandra and gotten it working on two machines. I have followed the instructions to hook them up to each other by configuring the storage-conf.xml files.

Both machines respond well to thrift and to command line cassandra.

This is tutorial I used to setup the storage-conf.xml files.

The t开发者_Go百科utorial says that if I run netstat, I should NOT see Cassandra bound to 127.0.0.1 on my seed node. I should see it bound to my internal IP, which I have configured in the storage-conf.xml file.

I have rebooted the servers and relaunched cassandra. Still, I see the localhost address insead of the correct internal IP address.

Is it that my .yaml file is overriding the storage-conf.xml file? If so, how do I delete the appropriate things in the .yaml? Or how do I tell Cassandra to look for my storage-conf.xml file?

A few things I have tried: renaming the cassandra.yaml file. What happens is that cassandra will not load. If i rename the storage-conf.xml, cassandra does load.

When I installed Cassandra, it did not come with a storage-conf.xml file. I had to grab it off the apache wiki.


xml is not used in modern cassandra versions. yaml is the source of truth and the converter is intended as a one time thing for people upgrading.


I figured it out. Cassandra was NOT loading storage-conf.xml it was loading cassandra.yaml.

When I ran bin/cassandra -f, I saw that was actually one of the first lines.

I fixed the problem by using the bin/config-converter tool and replacing the cassandra.yaml with the output of the converter tool:

cd [path to cassandra]/conf
mv cassandra.yaml __old_cassandra.yaml
../bin/config-converter storage-conf.xml cassandra.yaml

I then found that cassandra wouldn't start. I received this error:

ERROR 05:58:03,117 Fatal exception during initialization
org.apache.cassandra.config.ConfigurationException: Saved cluster name Test Cluster != configured name 

The way I fixed that was by going to the folder where Cassandra stores the system data which was: cd /var/lib/cassandra/data/system/ and deleting the contents rm -f *.*

Then, Cassandra started fine. I repeated the steps on my second node. It worked.

The command bin/nodetool -h localhost ring

Reveals that I have two nodes up and running. Success.

Now, my only question is--going forward--when I want to modify storage-conf.xml will I have to copy it again to a yaml? Or will Cassandra automatically load my changes?

0

精彩评论

暂无评论...
验证码 换一张
取 消