Ubuntu 安装zookeeper
下载zookeeper Zookeeper下载
下载以后将文件迁移到/home/Hadoop/文件夹下面
hongdada@ubuntu:~/Downloads$ sudo mv zookeeper-3.4.9.tar.gz /home/Hadoop
tar -zxvf解压
hongdada@ubuntu:/home/Hadoop$ sudo tar -zxvf zookeeper-3.4.9.tar.gz
将文件夹zookeeper-3.4.9改成zookeeper
hongdada@ubuntu:/home/Hadoop$ sudo mv zookeeper-3.4.9 zookeeper
解压以后conf文件夹中创建zoo_sample.cfg的副本zoo.cfg
hongdada@ubuntu:/home/Hadoop$ cd zookeeper
hongdada@ubuntu:/home/Hadoop/zookeeper$ cd conf
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ mp zoo_sample.cfg zoo_cfg
mp:未找到命令
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ cp zoo_sample.cfg zoo.cfg
cp: 无法创建普通文件'zoo.cfg': 权限不够
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ sudo cp zoo_sample.cfg zoo.cfg
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ sudo gedit zoo.cfg
原始的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
修改为:
# 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/Hadoop/zookeeper/data # 数据持久化路径
dataLogDir=/home/Hadoop/zookeeper/log #日志保存路径
server.1=192.168.1.203:2888:3888 # 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
说明:
syncLimit=5 # Leader与Follower之间的最大响应时间单位,响应超过syncLimit*tickTime,Leader认为Follwer死掉,从服务器列表中删除Follwer。
initLimit=10 # 投票选举新leader的初始化时间。
tickTime=2000 # Zookeeper服务器心跳时间,单位毫秒
clientPort=2181 # 连接端口
dataDir=/home/Hadoop/zookeeper/data # 数据持久化路径
dataLogDir=/home/Hadoop/zookeeper/log # 日志保存路径
server.1=10.10.100.10:2888:3888
设置环境变量:
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ export ZOOKEEPER_HOME=/home/Hadoop/zookeeper
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ export PATH=$PATH:$ZOOKEEPER_HOME/bin
启动zookeeper:
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ cd .
hongdada@ubuntu:/home/Hadoop/zookeeper/conf$ cd ../
hongdada@ubuntu:/home/Hadoop/zookeeper$ cd bin
hongdada@ubuntu:/home/Hadoop/zookeeper/bin$ zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/Hadoop/zookeeper/bin/../conf/zoo.cfg
mkdir: 无法创建目录"/home/Hadoop/zookeeper/data # 数据持久化路径": 权限不够
Starting zookeeper ... /home/Hadoop/zookeeper/bin/zkServer.sh: 行 140: ./zookeeper.out: 权限不够
/home/Hadoop/zookeeper/bin/zkServer.sh: 行 149: /home/Hadoop/zookeeper/data # 数据持久化路径/zookeeper_server.pid: 没有那个文件或目录
FAILED TO WRITE PID
hongdada@ubuntu:/home/Hadoop/zookeeper/bin$ sudo zkServer.sh start
[sudo] hongdada 的密码:
sudo: zkServer.sh:找不到命令
hongdada@ubuntu:/home/Hadoop/zookeeper/bin$ sudo ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/Hadoop/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
启动是./zkServer.sh start
http://jingyan.baidu.com/article/456c463b60bd380a5931446f.html
http://blog.csdn.net/cruise_h/article/details/19046357
Ubuntu 安装zookeeper的更多相关文章
- Ubuntu安装zookeeper问题
在Ubuntu系统安装zookeeper后,启动报错: root@host8:/usr/solrcould/service1/zookeeper-3.5.0-alpha# sh bin/zkServe ...
- Linux系统Ubuntu安装zookeeper
1. 下载zookeeper二进制安装包 下载地址:http://apache.dataguru.cn/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz ...
- Mac OS、Ubuntu 安装及使用 Consul
Consul 概念(摘录): Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置.与其他分布式服务注册与发现的方案,比如 Airbnb 的 SmartStac ...
- Ubuntu 13 Zookeeper 集群配置
一. 目标 在Linux集群搭建Zookeeper集群,并配置管理Web管理系统. 二. 先决条件 本文档中基于VirtualBox Ubuntu Server 13.04 虚机(启动SSH服务器)构 ...
- Ubuntu安装部署Kafka
Ubuntu安装部署Kafka 环境: Ubuntu 18.04.4 LTS ,JDK1.8,kafka_2.12-2.3.1 确保已经安装了JDK,JDK安装过程不再赘述.可参考文章xxxx 一.下 ...
- ubuntu安装mysql
好记性不如烂笔头,记录一下,ubuntu安装mysql的指令. 安装MySQL: sudo apt-get install mysql-server sudo apt-get install mysq ...
- ubuntu安装vim时提示 没有可用的软件包 vim,但是它被其它的软件包引用了 解决办法
ubuntu安装vim时提示 没有可用的软件包 vim-gtk3,但是它被其它的软件包引用了 解决办法 本人在ubuntu系统安装vim 输入 sudo apt-get install vim 提示 ...
- docker 1.8+之后ubuntu安装指定版本docker-engine
这边记录ubuntu安装过程,首先是官网文档 If you haven’t already done so, log into your Ubuntu instance. Open a termina ...
- Eclipse安装ZooKeeper插件
Eclipse在线安装插件奇慢的解决办法 安装ZooKeeper插件步骤如下:Step 1. 在 Eclipse 菜单打开Help -> Install New Software…Step 2. ...
随机推荐
- LeetCode——Best Time to Buy and Sell Stock III
Description: Say you have an array for which the ith element is the price of a given stock on day i. ...
- 心脏滴血HeartBleed漏洞研究及其POC
一.漏洞原理: 首先声明,我虽然能看懂C和C++的每一行代码,但是他们连在一起我就不知道什么鬼东西了.所以关于代码说理的部分只能参考其他大牛的博客了. /* 据说源码中有下面两条语句,反正我也没看过源 ...
- 在Linux中的.iso文件的处理方法
1,mkdir /a 2,mount MLNX_OFED_LINUX-4.4-2.0.7.0-rhel7.3-x86_64.iso /a3,cd /a4,这样就可以对文件进行操作了
- 【BZOJ3011】[Usaco2012 Dec]Running Away From the Barn 可并堆
[BZOJ3011][Usaco2012 Dec]Running Away From the Barn Description It's milking time at Farmer John's f ...
- .net asp 在1.asp页面嵌入另一个页面2.asp
<iframe src="http://www.baidu.com" width="100%" height="100%" onloa ...
- java对象转化成String类型
在java项目的实际开发和应用中,常常需要用到将对象转为String这一基本功能.本文将对常用的转换方法进行一个总结.常用的方法有Object#toString(),(String)要转换的对象,St ...
- 三进制状态压缩DP(旅行商问题TSP)HDU3001
http://acm.hdu.edu.cn/showproblem.php?pid=3001 Travelling Time Limit: 6000/3000 MS (Java/Others) ...
- Mybatis 搭配 阿里druid连接池 连接 oracle 或 mysql
DRUID介绍 DRUID是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0.DBCP.PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监控DB池连接和SQL的执行情况,可以说是针 ...
- nginx集群配置
一.nginx集群目标 以nginx作为代理服务器,分别在两台部署web站点的机器上面轮询访问. 3台机器IP地址分别为: 1)192.168.189.133 (nginx代理服务器) 2)192 ...
- 免费访问:谷歌搜索,Gmail邮箱,Chrome商店
分享个免费的google的服务的方法 1,插件下载: http://note.youdao.com/noteshare?id=6a3e52f8d4ccf63c751eeddd625a118d 2,使用 ...