centos安装zookeeper,并集群配置

所有机器操作都一样!

注:zookeeper配置集群时 需把防火墙关掉 或者暴露配置文件里配置的端口,

并且在dataDir目录下要有myid文件

1 下载

wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz

2 解压

tar -zxvf  zookeeper-3.4.10.tar.gz

3 修改配置文件

复制配置文件 zoo_sample.cfg 到zoo.cfg

cp zoo_sample.cfg zoo.cfg

vim zoo.cfg

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/log/zookeeper
# 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.purgeInterv
server.0=192.168.174.128:2888:3888
server.1=192.168.174.129:2888:3888

4  在  dataDir=/home/log/zookeeper  目录下新建 myid 文件

写入一个字符 0

保存。

5 启动 ./zkServer.sh start

ZooKeeper JMX enabled by default
Using config: /home/service/zookeeper-3.4.10/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

6 查看启动状态 ./zkServer.sh status

  

ZooKeeper JMX enabled by default
Using config: /home/service/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: leader

zookeeper命令

./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}

start 启动

start-foreground 有启动过程的启动

stop 停止

restart 重启

status 查看启动状态

原文地址:https://www.cnblogs.com/syscn/p/10010126.html

时间: 2024-11-05 11:38:35

centos安装zookeeper,并集群配置的相关文章

linux zookeeper 集群配置

                                                                                    linux zookeeper 集群配置 一.前期准备     1.下载zookeeper安装包: http://zookeeper.apache.org/releases.html     2.jdk安装:jdk-8u131-linux-x64.rpm 二.创建软件存放目录: zook     1.[[email protect

(01)安装zookeeper集群

本篇记录在3台服务器(192.168.7.151.192.168.7.152.192.168.7.153)上安装zookeeper集群的过程 一.安装过程 1.解压(zookeeper-3.4.6.tar.gz在/usr/local下) [[email protected] local]# tar -zxvf zookeeper-3.4.6.tar.gz 2.配置环境变量 [[email protected] zookeeper-3.4.6]# vim /etc/profile 添加如下配置:

zookeeper集群配置与启动——实战

1,准备: A:三台linxu服务器: 10.112.29.177 10.112.29.172 10.112.29.174 命令 hostname 得到每台机器的 hostname vm-10-112-29-177 vm-10-112-29-172 vm-10-112-29-174 分别创建 /opt/zookeeper/server1/data /opt/zookeeper/server1/dataLog /opt/zookeeper/server2/data /opt/zookeeper/s

Zookeeper 安装及集群配置注意点

Zookeeper在ubuntu下安装及集群搭建,关于集群搭建,网上很多文章 可以参考:https://www.ibm.com/developerworks/cn/opensource/os-cn-zookeeper/index.html 总结几点: a.  zookeeper启动依赖与java环境. b. zookeeper 启动文件是在其bin目录下zkServer.sh,启动方法:zkServer.sh start c.  查看zookeeper 启动状态 zkServer.sh stat

solrCloud+tomcat+zookeeper集群配置

http://www.tuicool.com/articles/NNjAFr 概述: SolrCloud 是基于Solr和Zookeeper的分布式搜索方案,它的主要思想是使用Zookeeper作为集群的配置信息中心. 它有几个特色功能: 1)集中式的配置信息 2)自动容错 3)近实时搜索 4)查询时自动负载均衡 安装zookeeper 上面也说了 SolrCloud 是基于Solr和Zookeeper的分布式搜索方案,所有要部署solrCloud+tomcat+zookeeper的集群,必须先

Linux系统运维之Zookeeper集群配置

一.简介 ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件.ZooKeeper的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效.功能稳定的系统提供给用户. 1. ZooKeeper的基本运转流程 1.选举Leader,选举机制大于1/2. 2.同步数据. 3.选举Leader过程中算法有很多,但要达到的选举标准是一致的. 4.Leader要具有最高的执行ID,类似root权限. 5

centos下zookeeper集群搭建

单机模式: 1)  首先下载zookeeper压缩包, 这里采用zookeeper3.4.8.... wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz 2)   解压缩 首先创建文件夹,这里放到/user/zookeeper/文件夹下 mkdir zookeeper1 mkdir zookeeper2 mkdir zookeeper3 创建三个文件夹用于存放三个实例,下面解压

安装zookeeper集群及出现的问题

A:安装zookeeper(完全分布式(使用虚拟机安装)) 1.上传zk安装包 2.解压 3.配置(先在一台节点上配置)    3.1添加一个zoo.cfg配置文件    $ZOOKEEPER/conf    mv zoo_sample.cfg zoo.cfg        3.2修改配置文件(zoo.cfg)        dataDir=/itcast/zookeeper-3.4.5/data                server.1=itcast05:2888:3888      

zookeeper集群配置

zookeeper集群网上demo一大堆,补充一下一些不明白的地方 1 复制2份zookeeper,savle作为备份节点 2.配置zoo.cfg # The number of milliseconds of each tick tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit=10 # The number of ticks that can pass