在单机环境下和创建集群。

需要注意的点:

  • 配置数据文件myid 1/2/3 对应server.1/2/3
  • 通过./zkCli.sh -server [ip]:[port]  检测集群是否创建成功

在zoo.cfg配置文件下最下方写上

# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataLogDir=/usr/local/zookeeper01/logs ############需要重新设置下,日志存放的地方
dataDir=/usr/local/zookeeper01/data ############需要重新设置下,数据存放的地方
# the port at which the clients will connect
clientPort=
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=
#
# 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=
# Purge task interval in hours
# Set to "" to disable auto purge feature
#autopurge.purgeInterval=
server.=localhost::
server.=localhost::
server.=localhost::

但是注意,这个配置文件上面的   dataDir= /usr/local/zookeeper01/data

然后我们到dataDir对应的目录去创建一个myid的文件  内容是1

其他两个依次类推。

然后重启zkServer.sh restart

zk创建集群的更多相关文章

  1. Redis创建集群报错

    Redis创建集群报错: 1:任何一个集群节点中都不能存在数据,如果有备份一下删除掉aof文件或rdb文件 2: nodes-集群端口.conf 文件存的会有报错记录,所以该文件也要删除

  2. redis创建集群——[ERR] Sorry, can't connect to node 192.168.X.X

    创建集群或者连接时会出现错误:只能用127.0.0.1创建 这是需要修改redis.conf 把bind注释掉 protected-mode no 有些旧版本注释requirepass 技术交流群:8 ...

  3. 16、Redis手动创建集群

    写在前面的话:读书破万卷,编码如有神 --------------------------------------------------------------------------------- ...

  4. redis 创建集群时 出现的错误解决方式

    1. 创建集群时报以下错误 (1)错误1 ./redis-trib.rb create --replicas 1 XXXXXX:5301 XXXXXX:5302 XXXXXX:5303 XXXXXX: ...

  5. zk伪集群部署

    jdk 配置 # tar xf jdk-8u161-linux-x64.tar.gz -C /usr/local/ # vim /etc/profile.d/jdk.sh export JAVA_HO ...

  6. 创建集群corosync

    #环境准备 #设置主机名解析yum -y install pcs pacemaker corosync fence-agents-allsystemctl start pcsd.servicesyst ...

  7. 【学习随手记】kubeadm 查看创建集群需要的镜像版本,附拉取镜像脚本

    查看创建集群需要的镜像版本 kubeadm config images list [--kubernetes-version <version>] 国内拉取镜像脚本 一般而言,直接使用ku ...

  8. KingbaseES V8R6C5B041手工创建集群测试案例

    ​ 案例说明: KingbaseES V8R6C5B041版本和以前的KingbaseES R6有一定的区别,增加了"securecmdd"的工具,并且在install.conf配 ...

  9. Zookeeper的基本原理(zk架构、zk存储结构、watch机制、独立安装zk、集群间同步复制)

    1.Hbase集群的高可用性与伸缩性 HBase可以实现对Regionserver的监控,当个别Regionserver不可访问时,将其负责的分区分给其他Regionsever,其转移过程较快,因为只 ...

随机推荐

  1. IDEA 根据 Mysql 自动生成

    1 找到 没有的,file--project structure--modules--+--JPA 2  找到如下 添加Mysql连接,记得 Text Connecting一下看看 然后刷新,就可以出 ...

  2. 牛客寒假算法训练1 D 欧拉(容斥)

    1 #include<bits/stdc++.h> using namespace std; ; typedef long long ll; int p[maxn],a[maxn]; ll ...

  3. Codeforces1023E Down or Right 【贪心】

    题目分析: 从起点开始询问终点连通性,优先右走.从终点开始询问起点连通性,优先上走. 代码: #include<bits/stdc++.h> using namespace std; in ...

  4. Shell基础 - Bash基础功能

    历史命令 history选项: -c 清空历史命令 -w 立即保存历史命令Linux 下输入过的历史命令,都会保存在根目录下的:~/root/.bash_history 文件中默认保存 1000 条, ...

  5. 【刷题】LOJ 556 「Antileaf's Round」咱们去烧菜吧

    题目描述 你有 \(m\) 种物品,第 \(i\) 种物品的大小为 \(a_i\) ​,数量为 \(b_i\)​( \(b_i=0\) 表示有无限个). 你还有 \(n\) 个背包,体积分别为 \(1 ...

  6. 分离式部署LNMP

    -------Nginx----------PHP+NFS------------MySql------192.168.56.202 192.168.56.201 192.168.56.200安装My ...

  7. JMeter5.1企业级应用应用常用功能详解(含插件安装)

    apache jmeter是100%的java桌面应用程序,它被设计用来加载被测试软件功能特性.度量被测试软件的性能.jmeter可以模拟大量的服务器负载,并且jmeter提供图形化的性能分析. JM ...

  8. Nginx反向代理后端多节点下故障节点的排除思路

    仔细想来,其实是个非常简单的问题:开发和运维觉得两个后端节点跑起来压力太大了,就扩充了两个新的后端节点上去,这一加就出问题了,访问时页面间歇性丢失,这尼玛什么情况...想了半天没思路,查了Nginx的 ...

  9. 最全面的 Spring 学习笔记

    http://www.codeceo.com/article/learn-spring.html 来源:泊浮目 分享到:更多36 Spring致力于提供一种方法管理你的业务对象.在大量Java EE的 ...

  10. Django 获取访问者信息

    request内的META里有请求用户的信息 #定义视图方法 def get_ip(request): #打印头部所以信息 # print(request.META) # 获取ip信息 if &quo ...