@Zookeeper可視化工具。 ZK 安裝 node-zk-browser。2015.10.22親測可用


zookeeper基本是基於API和console進行znode的操作,並沒有一個比較方便的操作界面,這里也發現了taobao 伯岩寫的一個工具,可以比較方便的查詢zookeeper信息。

工具的開發語言主要是node.js(最近比較火),其標榜的是無阻塞的api使用。其原理主要是基於google的V8(chrome的javascript的解析器,C語言編寫),node.js本身是基於js語法進行開發,通過V8解析為C語言的執行代碼

其標榜的無阻塞I/O實現,那可想而知就是linux系統下的select/poll的I/O模型。有興趣的可以看下node.js的官網,下載一個玩玩。

 


通過git下載源碼后,需要安裝下node.js的幾個模塊express, express-namespace, zookeeper。

node.js下有個比較方便的模塊管理器npm,類似於redhat的rpm,ubuntu的apt-get。


step 1 nodejs安裝:

(a).下載nodejs,注意一定要是v0.8.14版本,否則可能版本不兼容,報各種錯誤。

wget https://github.com/joyent/node/archive/v0.8.14.zip
(b)解壓
unzip v0.8.14.zip
(c)進入目錄安裝
(d)設置安裝目錄
./configure --prefix=/home/zk-browser/nodejs
(e)編譯安裝
make && make install

step 2 設置環境變量

vim ~/.bash_profile
export PATH=$PATH:/home/zk-browser/nodejs/bin
export NODE_PATH= /home/ zk-browser/nodejs: /home/lizhitao /zk-browser/nodejs/lib/node_modules
source  ~/.bash_profile

step 3 驗證nodejs安裝

(a)創建hello_rocky.js文件,進行編輯:

var http = require("http");
http.createServer(function(request, response) {
        response.writeHead(200, {"Content-Type":"text/plain"});
        response.write("hello rocky");
        response.end();
        }).listen(5000);
(b)運行:
node hello_rocky.js

(c)打開瀏覽器驗證:

http://ip:5000/如果顯示”hello rocky”就說明安裝成功了

step 4 安裝node-zk-browser

(a)下載軟件:

git clone https://github.com/killme2008/node-zk-browser.git 或 

wget https://github.com/killme2008/node-zk-browser/archive/master.zip

(b)解壓:

unzip master.zip

step 5 安裝node-zk-browser依賴包

進入  /usr/local/zkmanager/node-zk-browser-master 目錄下。
注意: 安裝過程可能會失敗  需要觀察  npm 的安裝  info。 

(a)安裝ejs、express、express-namespace、zookeeper   (這個zookeeper 只是一個工程名)

npm install -d ejs
npm install -d express
npm install -d express-namespace
npm install -d zookeeper


安裝之后,會在 node_modules  下出現4個目錄   ejs  express    express-namespace    zookeeper  4個文件 最后運行  npm install -d  出現 OK  完畢。

如果 ZK 下載不下來  就喊我發你郵箱好了。
程序員(不閑聊) 109912073 有個Q群。 去里面問我  rocky



3 配置
進入 node-zk-browser-master 目錄 
修改 app.js 


var zkclient = new ZkClient(host);
修改host 為自己ZK的 IP:端口
4 啟動服務
./start.sh
5 查看
瀏覽器輸入 http://IP:3000  默認3000. 就可以訪問了






                                                                                                                        God has given me a gift. Only one. I am the most complete fighter in the world. My whole life, I have trained. I must prove I am worthy of someting.                                                             rocky_24












附件列表

     


    免責聲明!

    本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



     
    粵ICP備18138465號   © 2018-2025 CODEPRJ.COM