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. ...
随机推荐
- Suricata规则配置
Suricata 规则配置 IDS/IPS/WAF IPS.IDS和WAF分别是入侵防御系统和入侵检测系统以及WEB应用防火墙的简称,很多人说这些玩意不就是盒子吗已经过时了,其实不是,SIEM其实是有 ...
- Eclipse 真机调试检测不到手机解决方案
想用Eclipse真机调试,但是死活检测不到手机. 手机已经打开了usb调试模式. 开始用的华为Mate9,后面试了下小米,都不行. 在网上搜了一堆,什么安全驱动.adb占用.删除360手机助手.修改 ...
- 监控linux流量python版
python版监控linux流量 直接上代码,使用OptionParser来传入参数 #coding:utf-8 #------------- #Author:Hu #Data:20150520 #- ...
- (java部署篇)eclipse ~ 自动补全词的各种控制(转)
#这种方法只适用于Eclipse Classic版本(这个版本带有插件的源码) 在使用Eclispe的过程,感觉自动补全做的不好,没有VS的强大.下面说两个增强自动补全的方法: 1.增加Eclipse ...
- js对字符串进行加密和解密方法!
在做一些微信小程序,或混合 app 的时候,或者是考虑到一些 JS 数据安全的问题.可能会使用到 JS 对用户信息进行缓存. 例如在开发:微信小程序对用户进行加密缓存,开发混合APP对用户信息进行加密 ...
- [Android] 配置安卓模拟器,使得dex文件不被优化成odex
最近做一个模块,需要将apk里面加载的dex文件dump出来,所以需要配置让dalvik不要把dex文件优化成odex. 1. 配置build.prop 主要是通过修改文件/system/build. ...
- SELECT INTO 和 INSERT INTO SELECT
做数据库开发的过程中难免会遇到有表数据备份的,而SELECT INTO……和INSERT INTO SELECT…… 这两种语句就是用来进行表数据复制,下面简单的介绍下: 1.INSERT INTO ...
- poj2185 Milking Grid【KMP】
Milking Grid Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 10084 Accepted: 4371 Des ...
- Oracle管理监控之测试环境清理用户脚本
--PL/SQL块删除用户 declare cursor cur_duser is select sid, serial# from v$session where username in ( ...
- 利用burpsuite实现重放攻击
1.什么是重放攻击? 顾名思义,重复的会话请求就是重放攻击.可能是因为用户重复发起请求,也可能是因为请求被攻击者获取,然后重新发给服务器. 附上详细的解释:http://blog.csdn.net/k ...