- Create a key pair under ec2 section (Example: mykp.pem)
- Download mykp.pem
- Run this command from a linux shell to get the public key for the above .pem
- ssh-keygen -y -f /directorypath/mykp.pem
- Output will be ssh-rsa with long key
- Add this key to the target server
Friday, November 4, 2016
SSH to EC2 as a non root user directly
Default ports used by tools
Solr: 8983
Zookeeper: 2888, 3888, 2181
AWS Elasticache; 6379
Apache Tomcat: 8080
Sonarqube: 8080
If running Jenkins and Nexus on same instance, Jenkins on 8080 and Nexus on 8081
Hygieia: 3000
Pa11y: 4000
Splunk: 8000, 8089
Zookeeper: 2888, 3888, 2181
AWS Elasticache; 6379
Apache Tomcat: 8080
Jenkins: 8080
Nexus: 8080Sonarqube: 8080
If running Jenkins and Nexus on same instance, Jenkins on 8080 and Nexus on 8081
Hygieia: 3000
Pa11y: 4000
Splunk: 8000, 8089
Building Apache Zookeeper Ensemble
Zookeeper ensemble
Create a default RHEL EC2 instance
sudo lsblk
sudo file -s /dev/xvdb
sudo mkfs -t ext4 /dev/xvdb
sudo mkdir -p /apps/zookeeper
sudo mount /dev/xvdb /apps/zookeeper
sudo useradd zookeeper
sudo chown -R zookeeper:zookeeper /apps/zookeeper
sudo vi /etc/fstab
/dev/xvdb /apps/zookeper ext4 defaults,nofail 0 2
sudo su - zookeeper
or
nohup java -cp zookeeper-3.4.9.jar:lib/slf4j-api-1.6.1.jar:lib/slf4j-log4j12-1.6.1.jar:lib/log4j-1.2.16.jar:conf org.apache.zookeeper.server.quorum.QuorumPeerMain $SCRIPTS/zoo.cfg > $FS_ROOT/logs/zookeeper.log 2>&1 &
Some known issues
If the port 3888 is not listening, check myid file in data folder has correct id
Create a default RHEL EC2 instance
sudo lsblk
sudo file -s /dev/xvdb
sudo mkfs -t ext4 /dev/xvdb
sudo mkdir -p /apps/zookeeper
sudo mount /dev/xvdb /apps/zookeeper
sudo useradd zookeeper
sudo chown -R zookeeper:zookeeper /apps/zookeeper
sudo vi /etc/fstab
/dev/xvdb /apps/zookeper ext4 defaults,nofail 0 2
sudo su - zookeeper
download jdk1.8.0_102
download zookeeper-3.4.9
setup ~/.bash_profile
FS_ROOT=/apps/zookeeper
JAVA_HOME=$FS_ROOT/jdk1.8.0_102
ZOOKEEPER_HOME=$FS_ROOT/zookeeper-3.4.9
SCRIPTS=$FS_ROOT/scripts
PATH=$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH
export PATH JAVA_HOME ZOOKEEPER_HOME SCRIPTS
mkdir /apps/zookeeper/data
mkdir /apps/zookeeper/dataLog
mkdir /apps/zookeeper/logs
Create a file zoo.cfg with
tickTime=2000
dataDir=/apps/zookeeper/data
dataLogDir=/apps/zookeeper/dataLog
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888
Create a file myid in /apps/zookeeper/data directory with '1' as content
Update AWS EC2 sec group with ports 22 2181 2888 3888
Create an AMI and spin 2 more instances
update myid file on server2 as 2 and server3 as 3
update zoo.cfg server ips on all servers
create a start script start_zookeeper.sh
source ~/.bash_profile
cd $ZOOKEEPER_HOME/bin
./zkServer.sh start
./zkServer.sh start
or
nohup java -cp zookeeper-3.4.9.jar:lib/slf4j-api-1.6.1.jar:lib/slf4j-log4j12-1.6.1.jar:lib/log4j-1.2.16.jar:conf org.apache.zookeeper.server.quorum.QuorumPeerMain $SCRIPTS/zoo.cfg > $FS_ROOT/logs/zookeeper.log 2>&1 &
Some known issues
If the port 3888 is not listening, check myid file in data folder has correct id
Subscribe to:
Posts (Atom)