RedHat6.5安装zookeeper单机
版本号:
Redhat6.5 zookeeper-3.4.6 JDK1.8
zookeeper下载
官网下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
百度云盘下载地址:链接:http://pan.baidu.com/s/1jIHYV7S 密码:pddz
1安装zookeeper
1.1创建对应的目录和文件
在maste机器的/usr/local目录下新建一个名为zookeeper的文件夹,并将下载的压缩包zookeeper-3.4.6.tar.gz上传上去
如图:
在master机器上执行命令创建两个目录:
mkdir /usr/local/zookeeper/data
mkdir /usr/local/zookeeper/dataLog
创建完成后,如图:
在master机器的/usr/local/zookeeper/zookeeper-3.4.6/conf目录内都创建一个名为zoo.cfg的文件:
cd /usr/local/zookeeper/zookeeper-3.4.6/conf
cp zoo_sample.cfg zoo.cfg
如图:
1.2修改配置文件zoo.cfg
把集群内master、slave1、slave2三台机器的zookeeper的zoo.cfg配置文件都修改成一样的内容,主要是在末尾增加配置:
- dataDir=/usr/local/zookeeper/data
- dataLogDir=/usr/local/zookeeper/dataLog
配置完之后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=/usr/local/zookeeper/data
- dataLogDir=/usr/local/zookeeper/dataLog
说明:dataDir和dataLogDir需要自己创建,目录可以自己制定,对应即可。
1.3配置zookeeper环境变量
sudo gedit /etc/profile
在每个节点配置环境变量/etc/profile
- #set zookeeper environment
- export ZOOKEEPER_HOME=/usr/local/zookeeper/zookeeper-3.4.6
- export PATH=$ZOOKEEPER_HOME/bin:$PATH
source /etc/profile
2 启动和测试
2.1 启动zookeeper
下面的步骤是手动启动zookeeper的步骤。
执行启动的命令是:
/usr/local/zookeeper/zookeeper-3.4.6/bin/zkServer.sh start
- [root@master zookeeper-3.4.6]# zkServer.sh start
- JMX enabled by default
- Using config: /usr/local/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
- Starting zookeeper ... STARTED
2.2 测试
jps
- [root@master zookeeper-3.4.6]# jps
- 4849SecondaryNameNode
- 5714Master
- 5810Worker
- 4676DataNode
- 5126NodeManager
- 5015ResourceManager
- 6008QuorumPeerMain
- 4542NameNode
- 6031Jps
6008 QuorumPeerMain
zkServer.sh status
- [root@master zookeeper-3.4.6]#
- JMX enabled bydefault
- Using config:/usr/local/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
- Mode: standalone
参考自:http://blog.csdn.net/pucao_cug/article/details/72228973
RedHat6.5安装zookeeper单机的更多相关文章
- RedHat6.5安装kafka单机
版本号: Redhat6.5 JDK1.8 zookeeper-3.4.6 kafka_2.11-0.8.2.1 1.软件环境 已经搭建好的zookeeper: RedHat6.5 ...
- RedHat6.5安装Spark单机
版本号: RedHat6.5 RHEL 6.5系统安装配置图解教程(rhel-server-6.5) JDK1.8 http://blog.csdn.net/chongxin1/arti ...
- Dubbo(三) 安装Zookeeper 单机-集群
一.下载zookeeper zookeeper下载地址:https://www.apache.org/dyn/closer.cgi/zookeeper/点击下载 二.启动配置 选择合适版本下载后解压到 ...
- RedHat6.5安装zookeeper集群
版本号: Redhat6.5 zookeeper-3.4.6 JDK1.8 zookeeper下载 官网下载地址:https://mirrors.tuna.tsinghua.edu.cn/apac ...
- zookeeper(二):linux centos下安装zookeeper(单机和集群)
下载 http://zookeeper.apache.org/releases.html 解压 tar –zxvf zookeeper-3.4.6.tar.gz 解压文件到"/usr/loc ...
- 云服务器 - 安装zookeeper单机环境
由于电脑中病毒,被人当做肉鸡挖矿了...所以很多东西都要重装, 之前没有写过zk如何安装,所以安装的时候顺便来记录一下分享出来 第一步上传zk安装包到服务器,如图: 解压: tar -zxvf zoo ...
- centos8安装zookeeper(单机方式)
一,下载zookeeper: 1,官网地址 http://zookeeper.apache.org/ 找到这个地址: https://mirrors.tuna.tsinghua.edu.cn/apac ...
- RedHat6.5安装kafka集群
版本号: Redhat6.5 JDK1.8 zookeeper-3.4.6 kafka_2.11-0.8.2.1 1.软件环境 1.3台RedHat机器,master.slave1. ...
- zookeeper(单机/集群)安装与配置
一.安装与单机配置 1.下载: wget http://archive.apache.org/dist/zookeeper/stable/zookeeper-3.4.6.tar.gz 如果网站下载不了 ...
随机推荐
- python scrapy解码方法和时间格式转换
import scrapy from datetime import datetime class BianSpider(scrapy.Spider): name = 'bian' # allowed ...
- svg相关
1.指定点缩放公式 translate(-centerX*(factor-1), -centerY*(factor-1)) scale(factor)
- C和C++内存模型
以下内容,大部分整理自网络 C分为四个区:堆,栈,静态全局变量区,常量区 C++内存分为5个区域(堆栈全常代 ): 堆 heap : 由new分配的内存块,其释放编译器不去管,由我们程序自己控制(一个 ...
- PHP安全之webshell和后门检测(转)
基于PHP的应用面临着各种各样的攻击: XSS:对PHP的Web应用而言,跨站脚本是一个易受攻击的点.攻击者可以利用它盗取用户信息.你可以配置Apache,或是写更安全的PHP代码(验证所有用户输入) ...
- Java基础(2)面向对象和封装,对象的创建和使用、java对象的内存图
1 类和对象 类:是一类事物的描述,抽象的.猫 对象:是一类事物的实例,具体的.某只猫 2 类的定义 成员变量和成员方法 //定义一个学生类 public class Student { //成员变量 ...
- apache php upload file
/********************************************************************************* * apache php uplo ...
- Ubuntu16.04安装OpenCV3.2以及PCL1.8
最近在学习slam14讲,需要配置一些环境<视觉slam十四讲> 这本书中已经给出如何配置相关环境的比较详细的说明,但是有些环境并无卵用,比如OpenCV以及PCL 这里给出自己屡试不爽的 ...
- [LeetCode&Python] Problem 350. Intersection of Two Arrays II
Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1 ...
- [LeetCode&Python] Problem 771: Jewels and Stones
You're given strings J representing the types of stones that are jewels, and S representing the ston ...
- C语言--第八周作业评分(5班)
作业链接:https://edu.cnblogs.com/campus/hljkj/CS2017-5/homework/1400 一.评分要求 要求1 完成14.15周的所有PTA中题目集,总共4次题 ...