zookeeper官网地址:
http://zookeeper.apache.org/
官网quick-start教程:
http://zookeeper.apache.org/doc/current/zookeeperStarted.html
在官网找到下载地址
http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
如果是本地安装的话,就直接点击下载下来,解压就行
如果是远程服务器的话,可以在服务器上用curl下载
如果下载到本地想上传到服务器的话,可以用scp命令上传到服务器(scp zookeeper-3.3.6.tar.gz [email protected]:/usr/)
我个人是安装到阿里云的云服务器,过程如下:
进入usr目录新建个zookeeper目录
cd /usr/
mkdir zookeeper
cd zookeeper/
通过curl下载安装包并且解压到当前目录
curl -O http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
tar zxvf zookeeper-3.3.6.tar.gz
zookeeper 的启动需要一个配置文件xx.cfg,这个文件zookeeper-3.3.6/conf目录下。默认的是zoo_sample.cfg。我复制一份这个文件,命名为zoo.cfg。
cd zookeeper-3.3.6/conf/
cp zoo_sample.cfg zoo.cfg
然后返回zookeeper-3.3.6目录,启动下试试
./bin/zkServer.sh start
JMX enabled by default
Using config: /usr/zookeeper/zookeeper-3.3.6/bin/../conf/zoo.cfg
Starting zookeeper ... ./zkServer.sh:行103: /tmp/zookeeper/zookeeper_server.pid: 没有那个文件或目录
FAILED TO WRITE PID
报错了,看来是zoo.cfg中的默认配置有问题,得改一改
报错找不到目录,进入zoo.cfg看到默认的是 dataDir=/tmp/zookeeper,这个目录是真的不存在,
在zookeeper-3.3.6下创建新的tmp目录,修改dataDir为:dataDir=/usr/zookeeper/zookeeper-3.3.6/tmp
再试试
./bin/zkServer.sh start
JMX enabled by default
Using config: /usr/zookeeper/zookeeper-3.3.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
启动成功
关闭命令就是:./zkServer.sh stop 呗
可以本地连接下
./bin/zkCli.sh -server localhost:2181
查看当前节点列表:ls /
反正没报错并且有数据返回,感觉很完美
dubbo-admin就是在dubbo的官网下载个war包,然后解压到tomcat的ROOT目录中,启动tomcat就可以了。
wget http://apache.etoak.com/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz
tar zxvf apache-tomcat-6.0.35.tar.gz
cd apache-tomcat-6.0.35
rm -rf webapps/ROOT
wget http://code.alibabatech.com/mvn/releases/com/alibaba/dubbo-admin/2.4.1/dubbo-admin-2.4.1.war
unzip dubbo-admin-2.4.1.war -d webapps/ROOT
但是我官网下载的war包启动报错,我的jdk版本是1.8,而这个包最高只支持1.7,会报一个getter setter的错。
ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uriBrokerService': Cannot create inner bean '(inner bean)' of type [com.alibaba.citrus.service.uribroker.impl.URIBrokerServiceImpl$URIBrokerInfo] while setting bean property 'brokers' with key [0]; nested excepti
on is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#25': Cannot create inner bean 'server' of type [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker] while setting constructor argument; nested exception is org.springframework.beans.fact
ory.BeanCreationException: Error creating bean with name 'server': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]: Bean property 'URIType'
is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)
解决方法有两个
1. 安装1.7的jdk
2. 去网上找个能用的包
为了省事,我去网上找的包,地址如下:
http://download.csdn.net/download/sunpeng_sp/10155979
安装好启动tomcat,直接访问localhost:8080就可以进入页面了,账号root密码root
参考
http://dubbo.io/books/dubbo-admin-book/install/zookeeper.html
http://dubbo.io/books/dubbo-admin-book/install/admin-console.html