Ubuntu16.04安装zookeeper集群

http://apache.fayea.com/zookeeper/

[email protected]:/usr/local/zookeeper-3.4.9# vim /etc/profile

#Zookeeper Home

export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.9

export PATH=$PATH:$ZOOKEEPER_HOME/bin

[email protected]:/usr/local/zookeeper-3.4.9# mkidr data

[email protected]:/usr/local/zookeeper-3.4.9# mkidr logs

[email protected]:/usr/local/zookeeper-3.4.9# vim data/myid

1

[email protected]:/usr/local/zookeeper-3.4.9# cp conf/zoo_sample.cfg conf/zoo.cfg

[email protected]:/usr/local/zookeeper-3.4.9# vim conf/zoo.cfg

dataDir=/usr/local/zookeeper-3.4.9/data

dataLogDir=/usr/local/zookeeper-3.4.9/logs

# the port at which the clients will connect

clientPort=2181

server.1=192.168.117.34:2888:3888

server.2=192.168.117.40:2888:3888

server.3=192.168.117.38:2888:3888

然后将配置文件复制到其它2个节点

[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh start

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh status

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg

Mode: follower

[email protected]:/usr/local/zookeeper-3.4.9# netstat -antlp | grep 2181

tcp        0      0 127.0.0.1:38052         127.0.0.1:2181          TIME_WAIT   -

tcp6       0      0 :::2181                 :::*                    LISTEN      31064/java

[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh start

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh status

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg

Mode: leader

[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh start

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh status

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg

Mode: follower

连接Zookeeper集群

[email protected]:/usr/local/zookeeper-3.4.9# zkCli.sh -server node1

Connecting to node1

2017-07-31 16:54:31,066 [myid:] - INFO  [main:[email protected]] - Client environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT

2017-07-31 16:54:31,068 [myid:] - INFO  [main:[email protected]] - Client environment:host.name=node1

2017-07-31 16:54:31,068 [myid:] - INFO  [main:[email protected]] - Client environment:java.version=1.8.0_131

2017-07-31 16:54:31,069 [myid:] - INFO  [main:[email protected]] - Client environment:java.vendor=Oracle Corporation

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.class.path=/usr/local/zookeeper-3.4.9/bin/../build/classes:/usr/local/zookeeper-3.4.9/bin/../build/lib/*.jar:/usr/local/zookeeper-3.4.9/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper-3.4.9/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper-3.4.9/bin/../lib/netty-3.10.5.Final.jar:/usr/local/zookeeper-3.4.9/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper-3.4.9/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper-3.4.9/bin/../zookeeper-3.4.9.jar:/usr/local/zookeeper-3.4.9/bin/../src/java/lib/*.jar:/usr/local/zookeeper-3.4.9/bin/../conf:.:/usr/lib/jvm/java-8-openjdk-amd64/lib://usr/lib/jvm/java-8-openjdk-amd64/jre/lib

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.library.path=/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/lib64::/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.io.tmpdir=/tmp

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.compiler=<NA>

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:os.name=Linux

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:os.arch=amd64

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:os.version=4.8.0-36-generic

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:user.name=root

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:user.home=/root

2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:user.dir=/usr/local/zookeeper-3.4.9

2017-07-31 16:54:31,071 [myid:] - INFO  [main:[email protected]] - Initiating client connection, connectString=node1 sessionTimeout=30000 [email protected]

Welcome to ZooKeeper!

2017-07-31 16:54:31,084 [myid:] - INFO  [main-SendThread(node1:2181):[email protected]] - Opening socket connection to server node1/192.168.117.34:2181. Will not attempt to authenticate using SASL (unknown error)

JLine support is enabled

2017-07-31 16:54:31,123 [myid:] - INFO  [main-SendThread(node1:2181):[email protected]] - Socket connection established to node1/192.168.117.34:2181, initiating session

[zk: node1(CONNECTING) 0] 2017-07-31 16:54:31,196 [myid:] - INFO  [main-SendThread(node1:2181):[email protected]] - Session establishment complete on server node1/192.168.117.34:2181, sessionid = 0x15d97c546110000, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null

[zk: node1(CONNECTED) 0]

时间: 2024-10-09 21:14:22

Ubuntu16.04安装zookeeper集群的相关文章

Ubuntu16.04安装Kafka集群

下载 http://kafka.apache.org/downloads.html http://mirror.bit.edu.cn/apache/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz [email protected]:/usr/local/kafka_2.11-0.11.0.0/config# vim server.properties broker.id=2            每个节点不同 log.retention.hours=168 mess

Ubuntu16.04安装HBASE集群

http://mirrors.hust.edu.cn/apache/hbase/ http://mirrors.hust.edu.cn/apache/hbase/1.3.1/hbase-1.3.1-bin.tar.gz [email protected]:/usr/local/hbase-1.3.1# vim /etc/profile #Hbase_Home export HBASE_HOME=/usr/local/hbase-1.3.1 export PATH=$PATH:$HBASE_HOM

(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 添加如下配置:

Linux安装zookeeper集群

测试在Linux虚拟机:node02.node03.node04装入zookeeper集群 1.下载zookeeper.地址:http://archive.apache.org/dist/zookeeper/ 拷贝下载zookeeper放入Linux机器中,我这里放入在software目录下. 解压:zookeeper到指定目录tar  -xf  zookeeper-3.4.6.tar.gz  /opt/ht 配置zookeeper的环境变量:vi  /etc/profile 进入zookeep

ubuntu16.04搭建hadoop集群环境

1. 系统环境Oracle VM VirtualBoxUbuntu 16.04Hadoop 2.7.4Java 1.8.0_111 master:192.168.19.128slave1:192.168.19.129slave2:192.168.19.130 2. 部署步骤在虚拟机环境中安装三台Ubuntu 16.04虚拟机,在这三台虚拟机中配置一下基础配置2.1 基础配置1.安装 ssh和opensshsudo apt-get install sshsudo apt-get install r

安装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      

docker 使用compose安装zookeeper集群

新建文件 docker-compose.yml version: '2' services: zookeeper1: image: zookeeper container_name: zk1.cloud ports: - "2181:2181" environment: - SERVER_ID=1 - ADDITIONAL_ZOOKEEPER_1=server.1=0.0.0.0:2888:3888 - ADDITIONAL_ZOOKEEPER_2=server.2=zk2.cloud

Linux下安装zookeeper集群

首先,准备三台Linux虚拟机 三台机器 centos01 :192.168.1.168(lxs001)   centos03 :192.168.1.178(lxs003)   centos03 :192.168.1.188(lxs003)  三台机器 下载 zookeeper: 进入 opt 目录 下载 zookeeper:wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz 解压zookee

安装zookeeper集群

1.时间同步检查 ntpdate time.nist.gov 2.关闭防火墙 service iptables stop 3.上传zookeeper-3.4.6到/root(说明:请自行下载) 4.解压zookeeper-3.4.6 tar -zxvf zookeeper-3.4.6 5.移动zookeeper-3.4.6到/home mv zookeeper-3.4.6 /home cd /home/zookeeper-3.4.6 ls cd conf/ ls 6.创建zookeeper的配置