项目场景:
用jps查看的结果
用./zkCli.sh -server 192.168.2.140:2182测试博报错
[root@hadoop102 bin]# ./zkCli.sh -server 192.168.2.140:2182
用./zkServer.sh status 查看没有启动
[root@hadoop102 bin]# ./zkServer.sh status
问题描述:
1.注意上图中进图的是root用户,同时又进入了atguigu的用户,结果是jps,用kill -9 可以杀死进程,但是在root用户,kill不了进程4897,原因分析:
1.可以系统没有刷新解决方案:
1.系统重启,jps就OK了.
总结注意点:
1.注意始终使用的用户
测试图:
输入./zkCli.sh -server 192.168.2.140:2181
./zkCli.sh -server 192.168.2.140:2181
输入./zkServer.sh status
./zkServer.sh status
个人建议,以上两种都试一下,看自己有没有安装成功.
配置文件
# The number of milliseconds of each tick
#这个时间是作为zookeeper服务器之间或者客户端之间维持心跳的时间间隔
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
#配置zookeeper接收客户端初始化连接时最长能忍受多少个心跳时间间隔
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
#Leader与Follower之间发送消息,请求和应答时间长度
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
#数据目录需要提前创建
dataDir=/home/hadoop/app/zookeeper-3.4.10/data
#日志目录需要提前创建
dataLogDir=/home/hadoop/app/zookeeper-3.4.10/log
# the port at which the clients will connect
#客户端将连接的端口
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
#server.每个节点服务编号=服务器ip地址:集群通信端口:选举端口
server.1=hadoop3-1:2888:3888
server.2=hadoop3-2:2888:3888
server.3=hadoop3-3:2888:3888