下载zookeeper-3.4.9.tar.gz

wget http://apache.fayea.com/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz

解压到 /home/目录下:

cd /home/zookeeper-3.4.9

在/home/zookeeper-3.4.9目录下创建以下目录:

mkdir data

mkdir logs

将/home/zookeeper-3.4.9/conf/下的zoo.sample.cfg 文件拷贝一份,命名为zoo.cfg

cp zoo_sample.cfg zoo.cfg

修改zoo.cfg的配置文件:

vi 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=/tmp/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.purgeInterval=1

其他默认,dataDir修改成刚才新建的data目录,同时新增dataLogDir:

dataDir=/home/zookeeper-3.4.9/data

dataLogDir=/home/zookeeper-3.4.9/logs

保存,单机版配置已经完成。

vi /root/.bash_profile

# zookeeper env
export ZOOKEEPER_HOME=/home/zookeeper-3.4.9
export PATH=$ZOOKEEPER_HOME/bin:$PATH

source /root/.bash_profile

启动zk:

sh /home/zookeeper-3.4.9/bin/zkServer.sh start

jps:

sh zkServer.sh status

开机启动:

在/etc/rc.local文件中追加:

# java_home
export JAVA_HOME=/opt/java/jdk1.7.0_75
# zookeeper
/home/zookeeper-3.4.9/bin/zkServer.sh start

以上即可开机自动启动!!

(带用户:- user -c '/home/zookeeper-3.4.9/bin/zkServer.sh start')

zookeeper注册中心安装(单机版)的更多相关文章

  1. dubbo服务治理中间件,zookeeper注册中心 安装配置

    对传统项目架构进行拆分: 集群概念: 面向服务分布式架构: 服务层提供被注册的对象需要实现序列化接口Serializable: 配置表现层和服务层: 依赖包: 服务层: <!-- 定义dubbo ...

  2. Zookeeper注册中心搭建-单机版(三)

    Zookeeper是一个分布式协调组件,本质是一个软件. Zookeeper常用的功能有: 发布订阅功能,把 zookeeper 当作注册中心的原因. 分布式/集群管理功能 Zookeeper是Jav ...

  3. ZooKeeper注册中心安装详细步骤(单节点)

    安装 Dubbo 注册中心 Dubbo 建议使用 Zookeeper 作为服务的注册中心. 注册中心服务器(192.168.3.71)配置,安装 Zookeeper: 1. 修改操作系统的/etc/h ...

  4. @ZooKeeper注册中心安装(单节点)

    1.下载zookeeper 下载地址:https://archive.apache.org/dist/zookeeper/,这里我们使用3.4.6版本. [winner-0715@localhost ...

  5. Dubbo框架应用之(三)--Zookeeper注册中心、管理控制台的安装及讲解

    我是在linux下使用dubbo-2.3.3以上版本的zookeeper注册中心客户端.Zookeeper是Apache Hadoop的子项目,强度相对较好,建议生产环境使用该注册中心.Dubbo未对 ...

  6. Spring Cloud 系列之 ZooKeeper 注册中心

    什么是注册中心 服务注册中心是服务实现服务化管理的核心组件,类似于目录服务的作用,主要用来存储服务信息,譬如提供者 url 串.路由信息等.服务注册中心是微服务架构中最基础的设施之一. 注册中心可以说 ...

  7. 跟我学习dubbo-ZooKeeper注册中心安装(2)

    注册中心 可选方案:zookeeper.Redis 1.建议使用dubbo-2.3.3以上版本的使用zookeeper注册中心客户端 2.Zookeeper是Apache Hadoop的子项目,强度相 ...

  8. dubbo服务治理中间件,zookeeper注册中心

    对传统项目架构进行拆分: 集群概念: 面向服务分布式架构: 服务层提供被注册的对象需要实现序列化接口Serializable: 配置表现层和服务层: 依赖包: 服务层: <!-- 定义dubbo ...

  9. Dubbo(二):zookeeper 注册中心

    zookeeper 注册中心 Zookeeper 是 Apacahe Hadoop 的子项目,是一个树型的目录服务,支持变更推送,适合作为 Dubbo 服务的注册中心,工业强度较高,可用于生产环境,并 ...

随机推荐

  1. mysql 表分区 查看表分区 修改表分区

    原文地址:http://blog.csdn.net/feihong247/article/details/7885199 一.       mysql分区简介 数据库分区 数据库分区是一种物理数据库设 ...

  2. ubuntu 上使用valgrind

    Valgrind是一个GPL的软件,用于Linux(For x86, amd64 and ppc32)程序的内存调试和代码剖析.你可以在它的环境中运行你的程序来监视内存的使用情况,比如C 语言中的ma ...

  3. LintCode: Number of Airplanes in the Sky

    C++ (1)把interval数组中的所有start和所有end放在同一个数组中,然后进行排序,遇到start就起飞一架飞机,遇到一架end就降落一架飞机,所以start有个+1属性,end有个-1 ...

  4. 微信小程序 - 配置普通二维码跳小程序

    普通二维码跳小程序规则: https://developers.weixin.qq.com/miniprogram/introduction/qrcode.html#%E5%8A%9F%E8%83%B ...

  5. SqlServer和Mysql插入记录前判断是否存在,存在则插入,不存在则修改。

    SqlServer中是这样: ) ,@title,@searchKeys,@serviceIntervalSecond,@sleepMillisecondPerSearch) ELSE UPDATE ...

  6. 两个自定义对象List列表取交集(intersection)

    public static void main(String[] args) { List<Fpxx> list = ListUtils.intersection(getFpList1() ...

  7. eclipse 运行简单JAVA程序事例

    开发JAVA已经有一段时间了,不过要运行JAVA程序,还是在命令行敲命令,很不方便,很麻烦,突然想到eclipse应该也有这个功能,于是百度了一下,将步骤晒出来,供大家参考. 1.创建JAVA工程 单 ...

  8. springMvc基于注解登录拦截器

    1.首先先定义一个拦截器注解 @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) p ...

  9. Qt 使用 net-snmp 包的过程记录

    使用 C/C++ 进行 SNMP 开发,网上比较流行的主要是用 net-snmp 和 snmp++ .在 sourceforge 上以 Qt 和 snmp 为关键词进行搜索,搜到的项目 net-snm ...

  10. nagios加入被监控的机器

    此工作大约用时: 30min 准备工作, 在被监控机上 yum install -y gcc glibc glibc-common gd gd-devel xinetd openssl-devel 0 ...