伺服器設置 1. 安裝64位JDK; 2. 設置Linux文件系統為Ext4 3.開啟2181,7771,7772防火牆埠 源碼編碼 1. 安裝Maven 2. 安裝OpenSesame 下載地址:https://github.com/alibaba/opensesame.git,將openses ...
伺服器設置
1. 安裝64位JDK;
2. 設置Linux文件系統為Ext4
3.開啟2181,7771,7772防火牆埠
源碼編碼
1. 安裝Maven
2. 安裝OpenSesame
下載地址:https://github.com/alibaba/opensesame.git,將opensesame-master.zip解壓到本地目錄,如d:\pomLocal\opensesame-master,如下圖:
a、安裝2.0版本:cd 到d:\pomLocal\opensesame-master,執行 mvn clean install -Dmaven.test.skip=true
b、安裝1.0版本:修改d:\pomLocal\opensesame-master\pom.xml中的<version>2.0</version>為<version>1.0</version>cd 到d:\pomLocal\opensesame-master,執行 mvn clean install -Dmaven.test.skip=true
3. 下載Dubbo源碼:下載地址:https://github.com/alibaba/dubbo.git/trunk,進入到源碼解壓目錄下運行install.bat或DOS命令行切換到解壓目錄運行:mvn clean install -Dmaven.test.skip=true,會生成管理中心和監測中心
dubbo.git/dubbo-admin/target/dubbo-admin-2.5.4-SNAPSHOT.war,
dubbo.git/dubbo-simple/dubbo-monitor-simple/target/dubbo-monitor-simple-2.5.4-SNAPSHOT-assembly.tar.gz;
管理中心需要通過web容器部署,dubbo-monitor不依賴web容易,通過\dubbo-monitor-simple-2.5.4-SNAPSHOT\bin\start.sh可以直接啟動監測服務。
4.Zookeeper配置(Duboo NameService)
a、下載Zookeeper:zookeeper.apache.org,刪除源碼信息,保留以下文件即可:
將zookeeper-3.3.4/conf目錄下麵的 zoo_sample.cfg修改為zo o.cfg,配置文件內容如下所示:
- #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.
10. # do not use /tmp for storage, /tmp here is just
11. # example sakes
12. dataDir=/usr/framework/zookeeper/datas
13. dataLogDir=/usr/framework/zookeeper/logs
14. # the port at which the clients will connect
15. clientPort=2181
16. # the maximum number of client connections.
17. # increase this if you need to handle more clients
18. #maxClientCnxns=60
19. #
20. # Be sure to read the maintenance section of the
21. # administrator guide before turning on autopurge.
22. #
23. # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
24. #
25. # The number of snapshots to retain in dataDir
26. autopurge.snapRetainCount=3
27. # Purge task interval in hours
28. # Set to "0" to disable auto purge feature
29. autopurge.purgeInterval=1
30. server.1=192.168.1.119:7772:7771
31. server.2=192.168.1.120:7772:7771
32. server.3=192.168.1.121:7772:7771
33. server.4=192.168.1.122:7772:7771
b、 在對應的/home/hadoop/storage/zookeeper,建議myid文件,內容設置參照zoo.cfg,如果當前ip為119,那麼myid內容為1,ip為120,myid內容為2,以此類推
c、啟動,通過jps命令可以查看ZooKeeper伺服器進程,名稱為QuorumPeerMain。
- cd zookeeper-3.3.4/
bin/zkServer.sh start
在客戶端連接ZooKeeper伺服器,執行如下命令:
[plain] view plaincopy
- bin/zkCli.sh -server dynamic:2181
上面dynamic是我的主機名,如果在本機執行,則執行如下命令即可:
[plain] view plaincopy
- bin/zkCli.sh
客戶端連接信息如下所示:接著,可以使用help查看Zookeeper客戶端可以使用的基本操作命令。