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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2023/12/10 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 macos brew zookeeper,安装后zookeeper启动失败? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、Zookeeper安裝流程

執行如下安裝命令:

brew install zookeeper

執行截圖如下:

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

brew info zookeeper

執行截圖如下:

二、Zookeeper啟動、狀態查詢、及關閉

啟動執行命令:

zkServer start

執行截圖如下:

狀態查詢執行命令:

zkServer status

執行截圖如下(啟動失敗,翻車現場截圖):

紅線部分說明未啟動成功,后面細談

關閉執行命令:

zkServer stop

執行截圖如下:

三、Zookeeper 啟動失敗

在上方我們在啟動 zookeeper 時,看到好多博客要么沒有截圖,要么直接把啟動失敗截圖當啟動成功附上了…

當然有的小伙伴也不一定遇到這個問題哈,我們先給出錯誤提示:

Error contacting service. It is probably not running

如果沒有出現該錯誤的小伙伴,可以關閉這篇文章了,下面內容主要是出錯解決:

啟動失敗的場景:

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

經過一系列排除,最終解決方法:卸載…

是的,你沒有聽錯,由于 brew 無法選擇下載的 zookeeper 版本,默認下載最新版本,而出現這種情況,大概率是版本問題,跟本地 jdk 不兼容…

don’t say so much …

執行卸載命令:

brew uninstall zookeeper

執行截圖:

四、手動安裝Zookeeper

1、下載zookeeper

官網下載路徑:https://zookeeper.apache.org/releases.html#download

推薦下載版本:3.4.14

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

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

2、配置環境變量

打開環境變量文件:

open ~/.bash_profile

添加如下:

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

修改保存文件后執行:

source ~/.bash_profile

3、修改zookeeper -> conf文件

打開 zookeeper 文件下的 conf 文件夾,然后找到 zoo_sample.cfg 文件,

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

    # 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、啟動zookeeper

    終端下執行 zkServer.sh start

    zkServer.sh start

    執行效果截圖:

    五、Zookeeper常用命令

    啟動:zkServer.sh start

    關閉:zkServer.sh stop

    狀態:zkServer.sh status

    重啟:zkServer.sh restart

    博客園持續更新,關注訂閱,未來,我們一起成長。

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

    總結

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

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。