zookeeper
zookeeper官網(wǎng)地址:
http://zookeeper.apache.org/
官網(wǎng)quick-start教程:
http://zookeeper.apache.org/doc/current/zookeeperStarted.html
在官網(wǎng)找到下載地址
http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
如果是本地安裝的話日丹,就直接點擊下載下來梨水,解壓就行
如果是遠(yuǎn)程服務(wù)器的話丁逝,可以在服務(wù)器上用curl下載
如果下載到本地想上傳到服務(wù)器的話戏蔑,可以用scp命令上傳到服務(wù)器(scp zookeeper-3.3.6.tar.gz root@xxx.xxx.xx.xx:/usr/)
我個人是安裝到阿里云的云服務(wù)器,過程如下:
進(jìn)入usr目錄新建個zookeeper目錄
cd /usr/
mkdir zookeeper
cd zookeeper/
通過curl下載安裝包并且解壓到當(dāng)前目錄
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目錄下谨朝。默認(rèn)的是zoo_sample.cfg傻寂。我復(fù)制一份這個文件完沪,命名為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中的默認(rèn)配置有問題听皿,得改一改
報錯找不到目錄,進(jìn)入zoo.cfg看到默認(rèn)的是 dataDir=/tmp/zookeeper宽档,這個目錄是真的不存在写穴,
在zookeeper-3.3.6下創(chuàng)建新的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
啟動成功
關(guān)閉命令就是:./zkServer.sh stop 唄
可以本地連接下
./bin/zkCli.sh -server localhost:2181
查看當(dāng)前節(jié)點列表:ls /
反正沒報錯并且有數(shù)據(jù)返回雌贱,感覺很完美
dubbo-admin
dubbo-admin就是在dubbo的官網(wǎng)下載個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
但是我官網(wǎng)下載的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.7的jdk
- 去網(wǎng)上找個能用的包
為了省事,我去網(wǎng)上找的包婆排,地址如下:
http://download.csdn.net/download/sunpeng_sp/10155979
安裝好啟動tomcat声旺,直接訪問localhost:8080就可以進(jìn)入頁面了,賬號root密碼root
參考
http://dubbo.io/books/dubbo-admin-book/install/zookeeper.html
http://dubbo.io/books/dubbo-admin-book/install/admin-console.html