Zookeeper可视化工具。 ZK 安装 node-zk-browser。2015.10.22亲测可用

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群。

~/.bash_profile

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
    原文地址:https://www.cnblogs.com/rocky24/p/4900804.html