kafka

zookeeper 설치 및 실행

PSAwesome 2022. 9. 13. 00:20
반응형

2022.09.13 - [GCP] - gcp 방화벽 열기

 

 

wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz && \
tar xvf apache-zookeeper-3.7.1-bin.tar.gz
# user
sudo ln -sf ~/apps/jdk-11.0.7+10 ~/apps/jdk
export JAVA_HOME=~/apps/jdk
export PATH=$PATH:$JAVA_HOME/bin

# root
sudo ln -sf /home/nhn/apps/jdk-11.0.7+10 /home/nhn/apps/jdk
export JAVA_HOME=/home/nhn/apps/jdk
export PATH=$PATH:$JAVA_HOME/bin

 

 

1. 설치

wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz && \
tar xvf apache-zookeeper-3.7.1-bin.tar.gz

 

2. hosts 설정

zookeeper 서버간 host name 지정

[ip] broker01

이걸 kubernetes에서 한다면 더 편리합니다......

 

3. zoo.cfg 설정

cp apache-zookeeper-*/conf/zoo_sample.cfg apache-zookeeper-*/conf/zoo.cfg && \
vim apache-zookeeper-*/conf/zoo.cfg
  • 샘플 config 파일을 conf 디렉토리에 복사해서 설정만 추가하는 작업입니다
admin.serverPort=3333
tickTime=2000
dataDir=/tmp/zookeeper
clientPort=2181
initLimit=20
syncLimit=5
server.1=broker01:2888:3888
server.2=broker02:2888:3888
server.3=broker03:2888:3888

 

4. 주키퍼 실행



./apache-zookeeper-3.7.1-bin/bin/zkServer.sh start

java 설치

JAVA_HOME 설정 후

 

 

./bin/zkServer.sh start

 

 

반응형