1.
2.安裝JVM
3.OS環(huán)境配置:
關(guān)閉防火墻:service iptables stop
vi/etc/sysctl.conf
vm.zone_reclaim_mode=0
vm.max_map_count = 262144
vm.swappiness = 1
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536
vi/etc/hosts
192.168.99.6 JacK6
192.168.99.7 JacK7
192.168.99.8 JacK8
192.168.99.9 JacK9
4.添加用戶:
useradd -d /data/hadoop -m hadoop
passwd hadoop
5.配置存儲(chǔ):掛在硬盤等
6.Cassandra的安裝:
1.建立相關(guān)目錄:
mkdir -p /data/hadoop/Cassandra_2.2.10
mkdir -p /data/tmp_data/cassan_data/commitlog
mkdir -p /data/tmp_data/cassan_data/saved_caches
mkdir -p /data/tmp_data/cassan_data/tables
2.上傳壓縮包凹联,解壓文件:
tar -xvf /data/tar/apache-cassandra-2.1.18-bin.tar.gz -C /data/hadoop/Cassandra_2.2.18/
cd /data/hadoop/Cassandra_2.2.18/apache-cassandra-2.1.18-bin
mv * ../
cd ..
rm -rf apache-cassandra-2.1.10-bin
3.修改配置文件:
1.修改cassandra.yaml
cd /data/hadoop/Cassandra_2.2.10/conf/
cp cassandra.yaml cassandra.yaml.bak
1.配置基本配置項(xiàng)
vi cassandra.yaml
cluster_name: 'Cluster_JacK'
data_file_directories:
- /data/tmp_data/cassan_data/tables
commitlog_directory: /data/tmp_data/cassan_data/commitlog
saved_caches_directory: /data/tmp_data/cassan_data/saved_caches
seeds: "192.168.99.6"(可以是自己也可以是集群中的任意節(jié)點(diǎn))
listen_address: 192.168.99.6
rpc_address: 192.168.99.6
cp cassandra-env.sh cassandra-env.sh.bak
2.配置遠(yuǎn)程JMX訪問(暫時(shí)不配)
vi cassandra-env.sh
if [ "x$LOCAL_JMX" = "x" ]; then
LOCAL_JMX=no
fi
cp/usr/java/jdk1.8.0_51/jre/lib/management/jmxremote.password.template?? /etc/cassandra/jmxremote.password
chown cassandra.cassandra /etc/cassandra/jmxremote.password
chmod 400 /etc/cassandra/jmxremote.password
echo "cassandra cassandrapassword">>/etc/cassandra/jmxremote.password
sed -i '/controlRole/icassandra readwrite'/usr/java/jdk1.8.0_51/jre/lib/management/jmxremote.access
3.配置用戶與權(quán)限(暫時(shí)不配)
修改cassandra.yaml中的以下兩行
authenticator: PasswordAuthenticator
authorizer: CassandraAuthorizer
在cassandra啟動(dòng)后,在第一個(gè)seed節(jié)點(diǎn)執(zhí)行以下命令:
echo "ALTER KEYSPACE system_auth WITHREPLICATION={'class':'org.apache.cassandra.locator.SimpleStrategy','replication_factor':'8'};"|cqlsh 10.202.20.191? -ucassandra -pcassandra
注:上面8為整個(gè)集群節(jié)點(diǎn)數(shù)锥惋,因?yàn)闄?quán)限認(rèn)證表需要全集群同步
echo "create user admin with password '123456'superuser;"|cqlsh 10.202.20.191?-ucassandra -pcassandra
echo "drop user cassandra;"|cqlsh 10.202.20.191? -uadmin -p123456
4.其他節(jié)點(diǎn):修改相應(yīng)的監(jiān)聽地址即可listen_address和rpc_address
?7.啟動(dòng)驗(yàn)證
cd /data/hadoop/Cassandra_2.2.10/bin
若在啟動(dòng)過程中報(bào)如下錯(cuò)誤:listen地址設(shè)置成本機(jī)的IP地址或者防火墻未關(guān)閉
ERROR 03:09:13 Exception encountered during startup
java.lang.RuntimeException: Unable to gossip with any seeds
8.使用cqlsh報(bào)如下錯(cuò)誤:
[hadoop@JacK7 bin]$ ./cqlsh
No appropriate python interpreter found.
僅支持python2.7,所以安裝python2.7