安装 cassandra 小记

 

这是我为公司机器上安装cassandra的小记:


The details are as follows:


 

(1)    I create a folder named cassandra-data in ~ as the data storage.


(2)    Configure the cluster name,data file directory, commitlog ,caches as follows:



edit the ~/apache-cassandra-1.0.7/conf/cassandra.yaml file ,


What I modified is as follows:


cluster_name: 'platformportal'

data_file_directories:

-          /home/portal/cassandra-data

commitlog_directory: /home/portal/cassandra-data/commitlog

saved_caches_directory: /home/portal/cassandra-data/saved_caches

 

(3)    Configure the Cassandra server’s log directory as follows:


edit the ~/apache-cassandra-1.0.7/conf/log4j-server.properties file,


Modify the log4j.appender.R.file to be /home/portal/cassandra-data/system.log

 

(4)    Start the cassandra process as follows:


cd ~/apache-cassandra-1.0.7/bin

./cassandra


(5)    Check whether the single-node ring of Cassandra cluster is working:


portal@abc :~/apache-cassandra-1.0.7/bin$ ./nodetool ring -h 172.29.54.6

Address         DC          Rack        Status State   Load            Owns    Token

  1. 172.29.54.6     datacenter1 rack1       Up     Normal  36.12 KB        100.00% 38455503507887643999897014288678782440

 


(6)    Install the ops Cassandra admin (JMX console)


I install it in ~/opscenter-2.1.2 folder



First ,since the JMX console is open to public, so we need to configure the ip address that can be reachable from other physical machine.


we edit ~/opscenter-2.1.2/conf/opscenterd.conf file ,and change the interface from 127.0.0.1 to 172.29.54.6



Second , start the admin console as follows:


cd ~/opscenter-2.1.2

./opscenter



(7)    In order to get the real-time data from Cassandra to Cassandra jmx admin ,we need to install the Cassandra agent as the bridge between cassandra node and jmx-console.


It is in ~/opscenter-2.1.2/agent folder



First ,configure it ,we run the following command:


cd ~/opscenter-2.1.2/agent/bin

./setup 172.29.54.6 172.29.54.6

After this step ,there is a file named address.yaml which will be created in the folder ~/opscenter-2.1.2/agent/conf  folder,this file manages the address that the agent “talks” with



Second ,start the agent as follows:


cd ~/opscenter-2.1.2/agent/bin

./opscenter-agent



(8)    Unluckily, I met with the following issue:



  File "build/lib/python2.7/site-packages/opscenterd/SslUtils.py", line 3, in <module>

 

          File "/home/portal/opscenter-2.1.2/lib/py-debian/2.7/amd64/OpenSSL/__init__.py", line 11, in <module>

            import rand, crypto, SSL, tsafe

        exceptions.ImportError: libssl.so.0.9.8: cannot open shared object file: No such file or directory

 

(9)    Then I need to clarify which libssl I have installed using the following command:


dpkg -l | grep libssl

 

and it shows


portal@abc:~/opscenter-2.1.2/log$ dpkg -l | grep libssl

ii  libssl1.0.0                            1.0.0e-2ubuntu4.6                       SSL shared libraries

ii  libssl1.0.0:i386                       1.0.0e-2ubuntu4.6                       SSL shared libraries

 


So the problem is clear ,we don&rsquo;t have correct version of libssl which is needed by Cassandra opsagent ,so we install the correct one:


sudo apt-get install libssl0.9.8

then ,it works.



(10)But actually, the JMX console displays no data from Cassandra node,we read the agent.log and it shows as follows:


ERROR [StompConnection receiver] 2012-08-08 00:42:40,119 failed connecting to 172.29.54.6:61620:java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)


This is because the communication between agent and opscenter is SSL secured ,so what we need to do is to remove ssl as follows:


edit ~/opscenter-2.1.2/conf/opscentered.conf, add the following line at the end of file:

use_ssl=false



 monitor the Cassandra through the JMX console: http://172.29.54.6:8888/opscenter/index.html


你可能感兴趣的:(安装cassandra)