Install Contrail Database Node
Install Database Node.Database Node consists of Cassandra,Zookeeper,Kafka.
**Target Server: Contrail1-3
1.Set variables
HOST=10.84.50.131 ## Set IP address of an Installation server
IVIP=10.84.50.139 ## Set Virtual IP address of Control/Data
ID=1 ## ID number for Zookeeper. Set unique ID number to each servers. For instance, set 1,2,3 to each servers.
host1=10.84.50.131 ## Physical IP address for Control/Data of Contrail1
host2=10.84.50.132 ## Physical IP address for Control/Data of Contrail2
host3=10.84.50.133 ## Physical IP address for Control/Data of Contrail3
2.Install package
apt-get -y install contrail-openstack-database
If error is happened like below, execute same command again.
Errors were encountered while processing:
cassandra
contrail-openstack-database
E: Sub-process /usr/bin/dpkg returned an error code (1)
3.
Create directory for
Analyticsmkdir -p /var/lib/cassandra/data/config_db_uuid
mkdir -p /var/lib/cassandra/data/ContrailAnalytics
mkdir -p /var/lib/cassandra/data
sudo chown -R cassandra /var/lib/cassandra
sudo chgrp -R cassandra /var/lib/cassandra
4.Modify /etc/cassandra/cassandra.yaml
sed -i "s/cluster_name: 'Test Cluster'/cluster_name: 'Contrail'/g" /etc/cassandra/cassandra.yaml
sed -i "s/- seeds: \"127.0.0.1\"/- seeds: \"$host2,$host3\"/g" /etc/cassandra/cassandra.yaml
sed -i "s/listen_address: localhost/listen_address: $HOST/g" /etc/cassandra/cassandra.yaml
sed -i "s/rpc_address: localhost/rpc_address: $HOST/g" /etc/cassandra/cassandra.yaml
5.Modify /etc/cassandra/cassandra-env.sh
sed -i 's/JVM_OPTS="$JVM_OPTS -Xss256k"/JVM_OPTS="$JVM_OPTS -Xss512k"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/JVM_OPTS="$JVM_OPTS -XX:MaxTenuringThreshold=1"/JVM_OPTS="$JVM_OPTS -XX:MaxTenuringThreshold=30"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -XX:+PrintGCDetails"/JVM_OPTS="$JVM_OPTS -XX:+PrintGCDetails"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -XX:+PrintGCDateStamps"/JVM_OPTS="$JVM_OPTS -XX:+PrintGCDateStamps"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -XX:+PrintHeapAtGC"/JVM_OPTS="$JVM_OPTS -XX:+PrintHeapAtGC"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -XX:+PrintTenuringDistribution"/JVM_OPTS="$JVM_OPTS -XX:+PrintTenuringDistribution"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -XX:+PrintGCApplicationStoppedTime"/JVM_OPTS="$JVM_OPTS -XX:+PrintGCApplicationStoppedTime"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -XX:+PrintPromotionFailure"/JVM_OPTS="$JVM_OPTS -XX:+PrintPromotionFailure"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -XX:PrintFLSStatistics=1"/JVM_OPTS="$JVM_OPTS -XX:PrintFLSStatistics=1"/g' /etc/cassandra/cassandra-env.sh
sed -i 's/# JVM_OPTS="$JVM_OPTS -Xloggc:\/var\/log\/cassandra\/gc-`date +%s`.log"/JVM_OPTS="$JVM_OPTS -Xloggc:\/var\/log\/cassandra\/gc-`date +%s`.log"/g' /etc/cassandra/cassandra-env.sh
6.Modify /etc/zookeeper/conf/zoo.cfg
echo "maxSessionTimeout=120000" >> /etc/zookeeper/conf/zoo.cfg
echo "autopurge.purgeInterval=3" >> /etc/zookeeper/conf/zoo.cfg
echo "server.1=$host1:2888:3888" >> /etc/zookeeper/conf/zoo.cfg
echo "server.2=$hos2:2888:3888" >> /etc/zookeeper/conf/zoo.cfg
echo "server.3=$host3:2888:3888" >> /etc/zookeeper/conf/zoo.cfg
7.Modify
/etc/zookeeper/conf/log4j.properties
sed -i 's/^#log4j.appender.ROLLINGFILE.MaxBackupIndex=/log4j.appender.ROLLINGFILE.MaxBackupIndex=/g' /etc/zookeeper/conf/log4j.properties
8.Modify
/etc/zookeeper/conf/environment
echo ZOO_LOG4J_PROP="INFO,CONSOLE,ROLLINGFILE" >> /etc/zookeeper/conf/environment
9.Modify
/var/lib/zookeeper/myid
echo $ID > /var/lib/zookeeper/myid
10.Modify
/usr/share/kafka/config/server.properties
sed -i "s/broker.id=0/broker.id=$ID/g" /usr/share/kafka/config/server.properties
sed -i 's/listeners=PLAINTEXT:\/\/:9092/#listeners=PLAINTEXT:\/\/:9092/g' /usr/share/kafka/config/server.properties
sed -i 's/#port=9092/port=9092/g' /usr/share/kafka/config/server.properties
sed -i "s/#advertised.host.name=/advertised.host.name=$HOST/g" /usr/share/kafka/config/server.properties
sed -i "s/zookeeper.connect=localhost:2181/zookeeper.connect=$host1:2181,$host2:2181,$host3:2181/g" /usr/share/kafka/config/server.properties
echo "log.cleanup.policy=compact" >> /usr/share/kafka/config/server.properties
echo "delete.topic.enable=true" >> /usr/share/kafka/config/server.properties
11.Modify
/usr/share/kafka/config/log4j.properties
sed -i 's/DailyRollingFileAppender/RollingFileAppender/g' /usr/share/kafka/config/log4j.properties
sed -i "s/DatePattern='.'yyyy-MM-dd-HH/MaxBackupIndex=10/g" /usr/share/kafka/config/log4j.properties
12.Modify
/etc/contrail/contrail-database-nodemgr.conf
sed -i "s/hostip=127.0.0.1/hostip=$HOST/g" /etc/contrail/contrail-database-nodemgr.conf
sed -i "s/server=127.0.0.1/server=$IVIP/g" /etc/contrail/contrail-database-nodemgr.conf
sed -i 's/minimum_diskGB=4/minimum_diskGB=100/g' /etc/contrail/contrail-database-nodemgr.conf
ln -s /bin/true /sbin/chkconfig
database-server-setup.sh $HOST
13.Check zookeeper status
Execute
"/usr/share/zookeeper/bin/zkServer.sh status" on all of Servers.
Zookeeper cluster is done if one of servers is
Leader, then remaining servers are
follower./usr/share/zookeeper/bin/zkServer.sh status
JMX enabled by default
Using config: /etc/zookeeper/conf/zoo.cfg
Mode: follower
14.Check cassandra status
Cassandra cluster is done if Execute "nodetool status" shows all of three servers.
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns Host ID Rack
UN 10.84.50.132 2.83 GB 256 ? 4022583f-bfeb-41af-a877-878468ef379a rack1
UN 10.84.50.133 2.68 GB 256 ? 4a7a351a-9e62-4388-9c45-b66c37a4efe2 rack1
UN 10.84.50.131 2.66 GB 256 ? ed68231d-edc0-40df-9987-411de522888a rack1
Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless
Next topic is "Install Contrail Support Service".
No comments:
Post a Comment