学做网站要什么学历,免费游戏链接入口,网站都要交域名费么,国家建设工程信息网站zookeeper 安装模式有三种#xff1a;单机模式#xff1a;单机单 server#xff1b;集群模式#xff1a;多机多 server#xff0c;形成集群#xff1b;伪集群模式#xff1a;单机多 server#xff0c;形成伪集群。 ~ 本篇内容包括#xff1a;Zookeeper 官网下载、Zook… zookeeper 安装模式有三种单机模式单机单 server集群模式多机多 server形成集群伪集群模式单机多 server形成伪集群。 ~ 本篇内容包括Zookeeper 官网下载、Zookeeper 单机模式部署、Zookeeper 集群安装、Zookeeper 集群安装 文章目录一、Zookeeper 官网下载二、Zookeeper 单机模式部署1、安装 JDK2、安装 Zookeeper3、修改 Zookpeeper 配置4、运行 Zookeeper三、Zookeeper 集群安装1、安装JDK每一台服务器2、安装 Zookeeper3、修改 Zookpeeper 配置4、运行 Zookeeper四、Zookeeper 集群启动停止脚本一、Zookeeper 官网下载 进入官网下载 Zookeeper这里我们使用的版本为 Zookeeper-3.5.7 Zookeeper 官网地址 http://zookeeper.apache.org/
zookeeper 安装模式有三种单机模式单机单 server集群模式多机多 server形成集群伪集群模式单机多 server形成伪集群。
二、Zookeeper 单机模式部署
1、安装 JDK
# 安装JDK
可以参照Java基础Java程序设计环境
2、安装 Zookeeper
# 官网下载
# 拷贝 apache-zookeeper-3.5.7-bin.tar.gz 到 Linux系统下
# 解压到指定目录
tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module/# 改名
mv apache-zookeeper-3.5.7-bin zookeeper-3.5.73、修改 Zookpeeper 配置
# 进入conf目录
# mv zoo_sample.cfg zoo.cfg
# mkdir /opt/module/zookeeper-3.5.7/zkData
# vi zoo.cfg
# The number of milliseconds of each tick
tickTime2000
# The number of ticks that the initial
# synchronization phase can take
initLimit10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir/opt/module/zookeeper-3.5.7/zkData
# the port at which the clients will connect
clientPort2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns60
#
# 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.snapRetainCount3
# Purge task interval in hours
# Set to 0 to disable auto purge feature
#autopurge.purgeInterval14、运行 Zookeeper
# 启动Zookeeperbin/zkServer.sh start
# 查看进程jps
# 客户端访问bin/zkCli.sh
三、Zookeeper 集群安装
1、安装JDK每一台服务器
# 安装JDK
可以参照Java基础Java程序设计环境
2、安装 Zookeeper
# 拷贝 apache-zookeeper-3.5.7-bin.tar.gz 到 Linux系统下每一台服务器
# 解压到指定目录每一台服务器
tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module/# 改名每一台服务器
mv apache-zookeeper-3.5.7-bin zookeeper-3.5.73、修改 Zookpeeper 配置
# 进入conf目录每一台服务器
# mv zoo_sample.cfg zoo.cfg每一台服务器
# mkdir /opt/module/zookeeper-3.5.7/zkData每一台服务器
# vi /opt/module/zookeeper-3.5.7/zkData/myid填写每天服务器对应的 ID
# vi zoo.cfg每一台服务器
# The number of milliseconds of each tick
tickTime2000
# The number of ticks that the initial
# synchronization phase can take
initLimit10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir/opt/module/zookeeper-3.5.7/zkData
# the port at which the clients will connect
clientPort2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns60
#
# 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.snapRetainCount3
# Purge task interval in hours
# Set to 0 to disable auto purge feature
#autopurge.purgeInterval1
server.1master:2888:3888
server.2slave1:2888:3888
server.3slave2:2888:38884、运行 Zookeeper
# 启动服务每台机器执行bin/zkServer.sh start
# 查看每个节点状态bin/zkServer.sh status
四、Zookeeper 集群启动停止脚本
#!/bin/bashcase $1 in
start){for i in master slave1 slave2doecho ----- zookeeper $i 启动-----ssh $i /opt/module/zookeeper-3.5.7/bin/zkServer.sh startdone
}
;;
stop){for i in master slave1 slave2doecho ----- zookeeper $i 停止-----ssh $i /opt/module/zookeeper-3.5.7/bin/zkServer.sh stopdone
}
;;
status){for i in master slave1 slave2doecho ----- zookeeper $i 状态-----ssh $i /opt/module/zookeeper-3.5.7/bin/zkServer.sh statusdone
}
;;
esac