日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

macos brew zookeeper,安装后zookeeper启动失败?

發(fā)布時(shí)間:2023/12/10 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 macos brew zookeeper,安装后zookeeper启动失败? 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

一、Zookeeper安裝流程

執(zhí)行如下安裝命令:

brew install zookeeper

執(zhí)行截圖如下:

安裝后查看 zookeeper 安裝信息(默認(rèn)拉取最新版本)

brew info zookeeper

執(zhí)行截圖如下:

二、Zookeeper啟動(dòng)、狀態(tài)查詢、及關(guān)閉

啟動(dòng)執(zhí)行命令:

zkServer start

執(zhí)行截圖如下:

狀態(tài)查詢執(zhí)行命令:

zkServer status

執(zhí)行截圖如下(啟動(dòng)失敗,翻車現(xiàn)場(chǎng)截圖):

紅線部分說(shuō)明未啟動(dòng)成功,后面細(xì)談

關(guān)閉執(zhí)行命令:

zkServer stop

執(zhí)行截圖如下:

三、Zookeeper 啟動(dòng)失敗

在上方我們?cè)趩?dòng) zookeeper 時(shí),看到好多博客要么沒(méi)有截圖,要么直接把啟動(dòng)失敗截圖當(dāng)啟動(dòng)成功附上了…

當(dāng)然有的小伙伴也不一定遇到這個(gè)問(wèn)題哈,我們先給出錯(cuò)誤提示:

Error contacting service. It is probably not running

如果沒(méi)有出現(xiàn)該錯(cuò)誤的小伙伴,可以關(guān)閉這篇文章了,下面內(nèi)容主要是出錯(cuò)解決:

啟動(dòng)失敗的場(chǎng)景:

  • 端口被占用:ps -ef | grep 2181
  • zoo.cfg 配置錯(cuò)誤
  • 防火墻
  • zookeeper 版本問(wèn)題

經(jīng)過(guò)一系列排除,最終解決方法:卸載…

是的,你沒(méi)有聽(tīng)錯(cuò),由于 brew 無(wú)法選擇下載的 zookeeper 版本,默認(rèn)下載最新版本,而出現(xiàn)這種情況,大概率是版本問(wèn)題,跟本地 jdk 不兼容…

don’t say so much …

執(zhí)行卸載命令:

brew uninstall zookeeper

執(zhí)行截圖:

四、手動(dòng)安裝Zookeeper

1、下載zookeeper

官網(wǎng)下載路徑:https://zookeeper.apache.org/releases.html#download

推薦下載版本:3.4.14

我提供的鏈接:https://niceyoo.lanzoui.com/iCG1Sgm00oh

下載后解壓至:/usr/local/etc

2、配置環(huán)境變量

打開(kāi)環(huán)境變量文件:

open ~/.bash_profile

添加如下:

export ZOOKEEPER_HOME=/usr/local/etc/zookeeper-3.4.14 export PATH=$PATH:$ZOOKEEPER_HOME/bin:

修改保存文件后執(zhí)行:

source ~/.bash_profile

3、修改zookeeper -> conf文件

打開(kāi) zookeeper 文件下的 conf 文件夾,然后找到 zoo_sample.cfg 文件,

  • 將 zoo_sample.cfg 重命名為 zoo.cfg
  • 修改 dataDir 文件路徑,在 zookeeper/ 根節(jié)點(diǎn)下新建 data 目錄
  • 將 dataDir 路徑修改為:/usr/local/etc/zookeeper-3.4.14/data
  • 詳細(xì)配置如下:

    # 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=/usr/local/var/run/zookeeper/data # 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

    4、啟動(dòng)zookeeper

    終端下執(zhí)行 zkServer.sh start

    zkServer.sh start

    執(zhí)行效果截圖:

    五、Zookeeper常用命令

    啟動(dòng):zkServer.sh start

    關(guān)閉:zkServer.sh stop

    狀態(tài):zkServer.sh status

    重啟:zkServer.sh restart

    博客園持續(xù)更新,關(guān)注訂閱,未來(lái),我們一起成長(zhǎng)。

    本文首發(fā)于博客園:https://www.cnblogs.com/niceyoo/p/13666003.html

    總結(jié)

    以上是生活随笔為你收集整理的macos brew zookeeper,安装后zookeeper启动失败?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

    如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。