linux安装zookeeper

2021/9/10 7:06:24

本文主要是介绍linux安装zookeeper,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

目录

1.下载

2.解压

3.修改配置

4.启动


1.下载

官网下载地址:https://zookeeper.apache.org/releases.html

我这里选择的是3.6.3版本

[root@iZm5e452n3se0jvpdlgbdpZ home]# wget https://downloads.apache.org/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz

2.解压

[root@iZm5e452n3se0jvpdlgbdpZ home]# tar -zxvf apache-zookeeper-3.6.3-bin.tar.gz
[root@iZm5e452n3se0jvpdlgbdpZ home]# mv apache-zookeeper-3.6.3-bin /usr/local/zookeeper

解压并移动到/usr/local文件夹下

3.修改配置

进入zookeeper下conf文件夹,复制zoo_sample文件一份,重命名为zoo.cfg

[root@iZm5e452n3se0jvpdlgbdpZ /]# cd /usr/local/zookeeper/conf/

[root@iZm5e452n3se0jvpdlgbdpZ conf]# cp zoo_sample.cfg  zoo.cfg

修改dataDir=/usr/local/zookeeper/data
dataLogDir=/usr/local/zookeeper/logs

#创建data和logs文件夹
[root@iZm5e452n3se0jvpdlgbdpZ zookeeper]# cd ..
[root@iZm5e452n3se0jvpdlgbdpZ zookeeper]# mkdir data
[root@iZm5e452n3se0jvpdlgbdpZ zookeeper]# mkdir logs

4.启动

[root@iZm5e452n3se0jvpdlgbdpZ bin]# cd bin

[root@iZm5e452n3se0jvpdlgbdpZ bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

--------------------
#启动成功,查看zookeeper进程
[root@iZm5e452n3se0jvpdlgbdpZ bin]# ps -ef|grep zookeeper
root     21440     1  1 16:50 pts/2    00:00:01 /usr/java/jdk1.8.0_131/bin/java -Dzookeeper.log.dir=/usr/local/zookeeper/bin/../logs -Dzookeeper.log.file=zookeeper-root-server-iZm5e452n3se0jvpdlgbdpZ.log -Dzookeeper.root.logger=INFO,CONSOLE -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p -cp /usr/local/zookeeper/bin/../zookeeper-server/target/classes:/usr/local/zookeeper/bin/../build/classes:/usr/local/zookeeper/bin/../zookeeper-server/target/lib/*.jar:/usr/local/zookeeper/bin/../build/lib/*.jar:/usr/local/zookeeper/bin/../lib/zookeeper-prometheus-metrics-3.6.3.jar:/usr/local/zookeeper/bin/../lib/zookeeper-jute-3.6.3.jar:/usr/local/zookeeper/bin/../lib/zookeeper-3.6.3.jar:/usr/local/zookeeper/bin/../lib/snappy-java-1.1.7.jar:/usr/local/zookeeper/bin/../lib/slf4j-log4j12-1.7.25.jar:/usr/local/zookeeper/bin/../lib/slf4j-api-1.7.25.jar:/usr/local/zookeeper/bin/../lib/simpleclient_servlet-0.6.0.jar:/usr/local/zookeeper/bin/../lib/simpleclient_hotspot-0.6.0.jar:/usr/local/zookeeper/bin/../lib/simpleclient_common-0.6.0.jar:/usr/local/zookeeper/bin/../lib/simpleclient-0.6.0.jar:/usr/local/zookeeper/bin/../lib/netty-transport-native-unix-common-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/netty-transport-native-epoll-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/netty-transport-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/netty-resolver-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/netty-handler-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/netty-common-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/netty-codec-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/netty-buffer-4.1.63.Final.jar:/usr/local/zookeeper/bin/../lib/metrics-core-3.2.5.jar:/usr/local/zookeeper/bin/../lib/log4j-1.2.17.jar:/usr/local/zookeeper/bin/../lib/json-simple-1.1.1.jar:/usr/local/zookeeper/bin/../lib/jline-2.14.6.jar:/usr/local/zookeeper/bin/../lib/jetty-util-ajax-9.4.39.v20210325.jar:/usr/local/zookeeper/bin/../lib/jetty-util-9.4.39.v20210325.jar:/usr/local/zookeeper/bin/../lib/jetty-servlet-9.4.39.v20210325.jar:/usr/local/zookeeper/bin/../lib/jetty-server-9.4.39.v20210325.jar:/usr/local/zookeeper/bin/../lib/jetty-security-9.4.39.v20210325.jar:/usr/local/zookeeper/bin/../lib/jetty-io-9.4.39.v20210325.jar:/usr/local/zookeeper/bin/../lib/jetty-http-9.4.39.v20210325.jar:/usr/local/zookeeper/bin/../lib/javax.servlet-api-3.1.0.jar:/usr/local/zookeeper/bin/../lib/jackson-databind-2.10.5.1.jar:/usr/local/zookeeper/bin/../lib/jackson-core-2.10.5.jar:/usr/local/zookeeper/bin/../lib/jackson-annotations-2.10.5.jar:/usr/local/zookeeper/bin/../lib/commons-cli-1.2.jar:/usr/local/zookeeper/bin/../lib/audience-annotations-0.5.0.jar:/usr/local/zookeeper/bin/../zookeeper-*.jar:/usr/local/zookeeper/bin/../zookeeper-server/src/main/resources/lib/*.jar:/usr/local/zookeeper/bin/../conf:.:/usr/java/jdk1.8.0_131/lib/dt.jar:/usr/java/jdk1.8.0_131/lib/tools.jar -Xmx1000m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /usr/local/zookeeper/bin/../conf/zoo.cfg



这篇关于linux安装zookeeper的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程