1. 程式人生 > >CentOS6.5安裝Zookeeper

CentOS6.5安裝Zookeeper

1. 下載安裝檔案zookeeper-3.4.6.tar.gz 2. 還是copy到虛擬機器的centos系統桌面 3. 新建/usr/loca/zookeeper資料夾 [[email protected] ~]# mkdir -pv /usr/local/zookeeper 4.拷貝檔案到指定資料夾 [[email protected] ~]# cd /root/Desktop/ [[email protected] ~]# cp ./zookeeper-3.4.6.tar.gz /usr/local/zookeeper 5. 解壓 [[email protected] ~]# tar -zxvf jdk-8u121-linux-x64.tar.gz 6. 配置環境變數 [[email protected] ~]#cd /etc/ [
[email protected]
~]#cp ./profile ./profile.bak -- 把檔案備份一下 [[email protected] ~]#vi /etc/profile -- 編輯此配置檔案 在檔案末尾新增此段內容: -- 開始和--中間的一段.(注意,儘量保持環境變數名全大寫,下劃線隔開. 保持規範) -- 開始 export ZOOKEEPER_INSTALL=/usr/local/zookeeper/zookeeper-3.4.6/ export PATH=$PATH:$ZOOKEEPER_INSTALL/bin -- 結束 7. 配置檔案修改 [[email protected]
zookeeper-3.4.6]# cd /usr/local/zookeeper/zookeeper-3.4.6/conf/ -- 進入檔案所在路徑 [[email protected] conf]# cp zoo_sample.cfg zoo.cfg -- 將zoo.sample.cfg拷貝出一份zoo.cfg出來. 檔名強制 8. 檔案內容如下: [[email protected] conf]# vi zoo.cfg -- 按i進入編輯模式. 修改完成之後, esc退出編輯模式, 大寫字母Z雙擊即可儲存. # 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 -- 這裡要設定一下檔案路徑 路徑必須存在,不存在的話就新建一個唄 dataLogDir=/tmp/zookeeper/log -- 日誌路徑 路徑必須存在,不存在的話就新建一個唄 # the port at which the clients will connect clientPort=2181 -- 如果是多機器的話,在clientPort處新增伺服器的ip # 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 修改完之後 通過 > # cat zoo.cfg 檢視. 9. 開啟服務,關閉服務, 檢視 [
[email protected]
bin]# cd /usr/local/zookeeper/zookeeper.3.4.6/bin/ [[email protected] bin]# ./zkServer.sh stop -- 停止服務 JMX enabled by default Using config: /usr/local/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg Stopping zookeeper ... STOPPED [[email protected] bin]# ./zkServer.sh start -- 開啟服務 JMX enabled by default Using config: /usr/local/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg Starting zookeeper ... STARTED [[email protected] bin]# ./zkServer.sh status -- 檢視狀態 JMX enabled by default Using config: /usr/local/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg Mode: standalone [[email protected] bin]# [[email protected] bin]# ./zkCli.sh -- 客戶端啟動, 可以檢視啟動狀態和日誌 Connecting to localhost:2181 2017-03-08 06:15:26,918 [myid:] - INFO [main:[email protected]] - Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT 2017-03-08 06:15:26,923 [myid:] - INFO [main:[email protected]] - Client environment:host.name=localhost 2017-03-08 06:15:26,923 [myid:] - INFO [main:[email protected]] - Client environment:java.version=1.8.0_121 2017-03-08 06:15:26,925 [myid:] - INFO [main:[email protected]] - Client environment:java.vendor=Oracle Corporation 2017-03-08 06:15:26,926 [myid:] - INFO [main:[email protected]] - Client environment:java.home=/usr/local/java/jdk1.8.0_121/jre 2017-03-08 06:15:26,926 [myid:] - INFO [main:[email protected]] - Client environment:java.class.path=/usr/local/zookeeper/zookeeper-3.4.6/bin/../build/classes:/usr/local/zookeeper/zookeeper-3.4.6/bin/../build/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../conf:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib: 2017-03-08 06:15:26,926 [myid:] - INFO [main:[email protected]] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 2017-03-08 06:15:26,926 [myid:] - INFO [main:[email protected]] - Client environment:java.io.tmpdir=/tmp 2017-03-08 06:15:26,926 [myid:] - INFO [main:[email protected]] - Client environment:java.compiler=<NA> 2017-03-08 06:15:26,930 [myid:] - INFO [main:[email protected]] - Client environment:os.name=Linux 2017-03-08 06:15:26,930 [myid:] - INFO [main:[email protected]] - Client environment:os.arch=amd64 2017-03-08 06:15:26,930 [myid:] - INFO [main:[email protected]] - Client environment:os.version=2.6.32-431.el6.x86_64 2017-03-08 06:15:26,931 [myid:] - INFO [main:[email protected]] - Client environment:user.name=root 2017-03-08 06:15:26,931 [myid:] - INFO [main:[email protected]] - Client environment:user.home=/root 2017-03-08 06:15:26,931 [myid:] - INFO [main:[email protected]] - Client environment:user.dir=/usr/local/zookeeper/zookeeper-3.4.6/bin 2017-03-08 06:15:26,940 [myid:] - INFO [main:[email protected]] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 [email protected] Welcome to ZooKeeper! 2017-03-08 06:15:27,039 [myid:] - INFO [main-SendThread(localhost:2181):[email protected]] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error) JLine support is enabled 2017-03-08 06:15:27,290 [myid:] - INFO [main-SendThread(localhost:2181):[email protected]] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session [zk: localhost:2181(CONNECTING) 0] 2017-03-08 06:15:27,445 [myid:] - INFO [main-SendThread(localhost:2181):[email protected]] - Session establishment complete on server localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x15aae45f1330000, negotiated timeout = 30000 WATCHER:: WatchedEvent state:SyncConnected type:None path:null [email protected] bin]# ps -ef | grep zookeeper -- 檢視zookeeper的服務程序. 看樣子還是挺嗨的. root 9779 9774 0 05:26 pts/0 00:00:09 /usr/local/java/jdk1.8.0_121/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /usr/local/zookeeper/zookeeper-3.4.6/bin/../build/classes:/usr/local/zookeeper/zookeeper-3.4.6/bin/../build/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../conf:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib: org.apache.zookeeper.ZooKeeperMain root 10188 10183 0 06:14 pts/0 00:00:00 /usr/local/java/jdk1.8.0_121/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /usr/local/zookeeper/zookeeper-3.4.6/bin/../build/classes:/usr/local/zookeeper/zookeeper-3.4.6/bin/../build/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../conf:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib: org.apache.zookeeper.ZooKeeperMain root 10230 1 0 06:15 pts/1 00:00:01 /usr/local/java/jdk1.8.0_121/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /usr/local/zookeeper/zookeeper-3.4.6/bin/../build/classes:/usr/local/zookeeper/zookeeper-3.4.6/bin/../build/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../conf:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /usr/local/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg root 10282 10277 0 06:15 pts/0 00:00:01 /usr/local/java/jdk1.8.0_121/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /usr/local/zookeeper/zookeeper-3.4.6/bin/../build/classes:/usr/local/zookeeper/zookeeper-3.4.6/bin/../build/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/usr/local/zookeeper/zookeeper-3.4.6/bin/../conf:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib:.:/usr/local/java/jdk1.8.0_121/lib/dt.jar:/usr/local/java/jdk1.8.0_121/lib/tools.jar:/usr/local/java/jdk1.8.0_121/jre/lib: org.apache.zookeeper.ZooKeeperMain root 10314 8885 0 06:18 pts/0 00:00:00 grep zookeeper [[email protected] bin]# 10 到此, zookeeper的單機版安裝完成.

相關推薦

CentOS6.5安裝Zookeeper

1. 下載安裝檔案zookeeper-3.4.6.tar.gz 2. 還是copy到虛擬機器的centos系統桌面 3. 新建/usr/loca/zookeeper資料夾 [[email protected] ~]# mkdir -pv /usr/

Centos6.5 安裝zabbix3

reload 地址 dlx operation $1 按鈕 mes load target 1.安裝PHP Zabbix 3.0對PHP的要求最低為5.4,而CentOS6默認為5.3.3,完全不滿足要求,故需要利用第三方源,將PHP升級到5.4以上,註意,不支持PHP7

【Linux】 CentOS6.5安裝Python2.7以及pip等工具

自己 lin 存在 lean prefix nbsp ase 路徑 details 原文地址http://blog.csdn.net/u012538536/article/details/47360929。 CentOS6.5下是原來就有python的,我的鏡像裏面自帶的

centos6.5 安裝rabbitMQ3.6.6

local 加密 通信 centos6.5 安裝rabbitMQ3.6.61.安裝依賴包yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC unixODBC-devel2.安裝語

170503、centos6.5安裝mysql5.6.30

pro groupadd init.d 解決方法 pad 配置文件 虛擬機 isp cnblogs 準備:虛擬機地址:192.168.0.110 安裝目錄/usr/local/ 首先卸載已經安裝的mysql使用命令查看rpm -qa | grep mysql卸載使用 rp

centos6.5安裝Nginx

.html nginx gui 啟動 div -s uid cnblogs logs 設置源 創建文件 /etc/yum.repos.d/nginx.repo ,內容為: [nginx] name=nginx repo baseurl=http://nginx.o

centos6.5安裝xampp報錯

xampp lib.so.6 egrep安裝完xampp 5.6.3後,執行/opt/lampp/lampp報錯[[email protected]/* */_server ~]# /opt/lampp/lamppegrep: error while loading shared librari

Centos6.5 安裝配置docker

win7 64 div 系統 entos err vagrant ror virt grant 宿主機:win7 64位 vagrant封裝環境運行在VirtualBox 虛擬機上CentOS6.5,這是做測試時的一個環境,順便錯用安裝docker玩玩。 cento

CentOS6.5安裝Qt4.8.6+QtCreator2.6.1

界面 tool tools function -c 方便 安裝 src conf 工作中需要用到Qt在Linux下做開發,公司提供的電腦安裝的CentOS6.2,但是為了和windows下自己使用的QT版本一直,於是也選擇安裝了Qt5.1.0。但是在CentOS下剛開始是無

Centos6.5安裝mysql

ice .cn tab scrip bar 麻煩 repo vda messages CentOS6.5安裝與配置Mysql數據庫 時間:2014-12-11 02:11來源:Bmmboo 作者:Bmmboo 舉報 點擊:74545次 一、mysql簡介 說到數據庫,

CentOS6.5安裝MySQL5.7(也適合其他版本安裝)

服務 o-c 報錯 dev enable sta enabled 修改密碼 arch 1、查看是否已經安裝過mysql或其依賴,若已裝過要先將其刪除,否則第4步使用yum安裝時會報錯: 方法一:yum list installed | grep mysql 方法二:r

CentOS6.5安裝JDK1.8

eps roo zxvf div logs .html winscp spa 文件 一、檢查JDK版本 1 [[email protected]/* */ ~]# java -version 2 java version "1.8.0_121" 3 Java(

CentOS6.5安裝Elasticsearch5.4.1+Kibana5.4.1

elk kibana plugin:elasticsearch CentOS6.5安裝Elasticsearch5.4.1+Kibana5.4.1第一次接觸ELK,坑很多,留下記錄,讓後人少走點坑本人環境VMware虛擬機,CentOS6.5 X86_64 1G內存下載二進制包wget https

CENTOS6.5 安裝 mysql5.6 以及搭建雙主

關於 base ucc status mysq automake tables ++ 哪些 一、Mysql5.6.10安裝 1.1、必要軟件 yum -y install gcc gcc-c++ autoconf automake bison ncurses-dev

centos6.5安裝logwatch監控日誌

本地 sendmai services 需求 eve 正常 服務 ssh dev Logwatch是使用 Perl 開發的一個日誌分析工具Logwatch能夠對Linux 的日誌文件進行分析,並自動發送mail給相關處理人員,可定制需求Logwatch的mail功能是借助宿

centos6.5 安裝php-5.6.31

openss tag ack bz2 ttf 重啟 php-fpm timezone bsp 1 從PHP官網下載所需要的PHP版本 下載地址: http://php.net/get/php-5.6.31.tar.gz/from/a/mirror 把下載好的文件

VMware中CentOS6.5安裝tengine服務器

tengine通過ssh將tengine壓縮包tengine-2.1.0.tar.gz上傳到服務器上。上傳到/opt路徑下解壓tengine-2.1.0.tar.gztar -zxvf tengine-2.1.0.tar.gz 進入tengine的解壓目錄cd tengine-2.1.0安裝tengine的依

Centos6.5安裝Elasticsearch

support filter and last hat system ans .html lang 一、可以在網上下載對飲的版本:https://github.com/elastic/elasticsearch,本次安裝的是5.5.3。 1 [[email 

centos6.5安裝配置NTP,集群各機器間時間同步

rest tar 6.2 border 平滑 n) correct restrict net 試驗環境 提君博客原創 >>提君博客原創 http://www.cnblogs.com/tijun/ << IP 主機名 角色

centos6.5 安裝sftp

usermod ftp ble art forward fine sshd font user 1、創建sftp組 : groupadd sftp 2、創建一個sftp用戶,用戶名為andy : useradd -g sftp -s /bin/false andy 3