Cassandra Database(8)Upgrade to 2.1.2 and OpsCenter
Our project is using version 1.2.13. The latest version is 2.1.2 now.
Some example about the 2.0.4 version, using java driver and cqlsh http://sillycat.iteye.com/admin/blogs/2011991.
Configure the cluster without other tool, http://sillycat.iteye.com/blog/2166583.
Backup and restore data
1. Useful command
List all the key spaces we have.
> describe keyspaces;
Show the structure of the one key space and its tables.
> describe keyspace device_lookup;
CREATE KEYSPACE device_lookup WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': '2'
};
USE device_lookup;
CREATE TABLE profile_devices (
brandcode ascii,
profileid bigint,
deviceid ascii,
PRIMARY KEY ((brandcode, profileid), deviceid)
) WITH COMPACT STORAGE AND
bloom_filter_fp_chance=0.100000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'sstable_size_in_mb': '5', 'class': 'LeveledCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
Opscenter
2. Try Install the Latest Version
Set it up as normal. Edit the cassandra.yaml
listen_address: ubuntu-dev1
seed_provider:
# Addresses of hosts that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn
# the topology of the ring. You must change this if you are running
# multiple nodes!
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- seeds:"ubuntu-dev1,ubuntu-dev2"
rpc_address: 0.0.0.0
broadcast_rpc_address: ubuntu-dev1
When start the cassandra server
> nohup cassandra -f conf/cassandra.yaml &
I get error message as follow:
Cassandra 2.0 and later require Java 7u25 or later.
Try to upgrade the JDK
>sudo add-apt-repository ppa:webupd8team/java
>sudo apt-get update
> sudo apt-get install oracle-java7-installer
>sudo update-alternatives --config java
>sudo update-alternatives --config javac
After the cassandra running, we can use cqlsh to connect to that.
9160 is used for thrift clients, 9042 is for native protocol clients.
Check the cluster
> nodetool -h ubuntu-dev1 status
3. Try to install OpsCenter
Find the latest version here.
> sudo ln -s /home/carl/tool/opscenter-5.0.2 /opt/opscenter-5.0.2
> sudo ln -s /opt/opscenter-5.0.2 /opt/opscenter
Start the opscenter
> bin/opscenter -f
Visit the webpage
Put ubuntu-dev1 and connect from there.
Plan to start cassandra and nodeJS later after gatling.
References:
old blog 1 ~ 7
http://sillycat.iteye.com/blog/1870661
http://sillycat.iteye.com/blog/2011524
http://sillycat.iteye.com/blog/2011525
http://sillycat.iteye.com/blog/2011526
http://sillycat.iteye.com/blog/2011991
http://sillycat.iteye.com/blog/2011992
http://sillycat.iteye.com/blog/2166583
official website