首页 > 其他分享 >Installing Zookeeper-3.7.1 openEuler

Installing Zookeeper-3.7.1 openEuler

时间:2022-11-17 01:12:21浏览次数:137  
标签:opt zookeeper java Zookeeper server 3.7 apache org openEuler

一、Installing Zookeeper-3.7.1 openEuler

地址

是下载哪个文件呢!!!

1 下载

mkdir /opt/software && cd /opt/software
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz

2 解压

tar -zxvf /opt/software/apache-zookeeper-3.7.1-bin.tar.gz -C /opt/ && cd /opt/apache-zookeeper-3.7.1-bin/bin && ls
mv /opt/apache-zookeeper-3.7.1-bin /opt/zookeeper-371 && cd /opt/zookeeper-371 && ll

3 复制

将zookeeper/conf路径下的zoo_sample.cfg修改为zoo.cfg

cd /opt/zookeeper-371/conf && cp /opt/zookeeper-371/conf/zoo_sample.cfg /opt/zookeeper-371/conf/zoo.cfg

4 修改 zoo.cfg

打开zoo.cfg配置文件,修改dataDir路径

vim /opt/zookeeper-371/conf/zoo.cfg

# 心跳检查的时间 2秒
tickTime=2000
# 初始化时 连接到服务器端的间隔次数,总时间10*2=20秒
initLimit=10
# ZK Leader 和follower 之间通讯的次数,总时间5*2=10秒
syncLimit=5
# 存储内存中数据快照的位置,如果不设置参数,更新事务日志将被存储到默认位置。
dataDir=/opt/zookeeper-371/zkData
# ZK 服务器端的监听端口  
clientPort=2181
# ZK 端口号,默认8080
admin.serverPort=9091

5 创建zkData文件夹

mkdir /opt/zookeeper-371/zkData

6 日志目录

ll /opt/zookeeper-371/log/

7 启动 Zookeeper

[root@ecs-65685 ~]# /opt/zookeeper-371/bin/zkServer.sh
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-371/bin/../conf/zoo.cfg
Usage: /opt/zookeeper-371/bin/zkServer.sh [--config <conf-dir>] {start|start-foreground|stop|version|restart|status|print-cmd}

# 启动
/opt/zookeeper-371/bin/zkServer.sh start
# 状态
/opt/zookeeper-371/bin/zkServer.sh status

8 查看进程是否启动

[root@ecs-65685 ~]# jps
2530 WrapperSimpleApp
9667 QuorumPeerMain
9814 Jps

9 配置环境变量

vim /etc/profile
export PATH=$PATH:/opt/zookeeper-371/bin
# 配置立即生效
source /etc/profile

 

二、报错

1 Starting zookeeper ... FAILED TO STAR

zookeeper文件下载错了

2 端口8080已绑定

Caused by: java.io.IOException: Failed to bind to /0.0.0.0:8080

vim /opt/apache-zookeeper-3.6.3-bin/conf/zoo.cfg
# 修改端口号
admin.serverPort=9091

报错信息

[root@ecs-65685 ~]# tail -n 100 -f  /opt/apache-zookeeper-3.6.3-bin/logs/zookeeper-root-server-ecs-65685.out
...
2022-10-12 22:34:45,845 [myid:] - ERROR [main:ZooKeeperServerMain@85] - Unable to start AdminServer, exiting abnormally
org.apache.zookeeper.server.admin.AdminServer$AdminServerException: Problem starting AdminServer on address 0.0.0.0, port 8080 and command URL /commands
	at org.apache.zookeeper.server.admin.JettyAdminServer.start(JettyAdminServer.java:189)
	at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:153)
	at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:112)
	at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:67)
	at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:140)
	at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:90)
Caused by: java.io.IOException: Failed to bind to /0.0.0.0:8080
	at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
	at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310)
	at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
	at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.eclipse.jetty.server.Server.doStart(Server.java:401)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.apache.zookeeper.server.admin.JettyAdminServer.start(JettyAdminServer.java:180)
	... 5 more
Caused by: java.net.BindException: Address already in use
	at java.base/sun.nio.ch.Net.bind0(Native Method)
	at java.base/sun.nio.ch.Net.bind(Net.java:459)
	at java.base/sun.nio.ch.Net.bind(Net.java:448)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
	at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)
	at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
	... 12 more
Unable to start AdminServer, exiting abnormally
2022-10-12 22:34:45,847 [myid:] - INFO  [main:ZKAuditProvider@42] - ZooKeeper audit is disabled.
2022-10-12 22:34:45,848 [myid:] - ERROR [main:ServiceUtils@42] - Exiting JVM with code 4

 

 

X、One Step Success

 


Y、Error message

 


Z、Related Links

 

标签:opt,zookeeper,java,Zookeeper,server,3.7,apache,org,openEuler
From: https://www.cnblogs.com/huaxiayuyi/p/16897875.html

相关文章