Dubbo recommends using zookeeper as the registry for the service.
Registration Center Server (192.168.1.100) configuration, installing zookeeper:
Install the zookeeper on the 192.168.1.100 machine as a registered hub server
1. Set the alias name for the 192.168.1.100 hostname and add it in the/etc/hosts file:
# Zookeeper Servers
192.168.1.100 master-provider-01
2, to http://apache.fayea.com/zookeeper/download zookeeper-3.4.6:
$ wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
3, Decompression zookeeper installation package
$ TAR-ZXVF zookeeper-3.4.6.tar.gz
3, Decompression zookeeper installation package:
$ TAR-ZXVF zookeeper-3.4.6.tar.gz
4. Create the following directory under the/home/jqlin/zookeeper-3.4.6 directory:
$ cd/home/jqlin/zookeeper-3.4.6
$ mkdir Data
$ mkdir Logs
5, a copy of the Zoo_sample.cfg file under the zookeeper-3.4.6/conf directory, named Zoo.cfg
$ CP zoo_sample.cfg Zoo.cfg
6. Modify the Zoo.cfg configuration file
Xxxx
7. Create the myID file under Datadir=/home/jqlin/zookeeper-3.4.6/data
Edit the myID file and enter the corresponding number on the corresponding IP machine. As on zookeeper, the contents of the myID file are 1. If the installation is configured only on a single point, then there is only one server.1.
$ VI myID
8. Configuring Zookeeper Environment variables
Jqlin users to modify the Vi/home/jqlin/.bash_profile, add the following:
# Zookeeper Env
Export zookeeper_home=/home/jqlin/zookeeper-3.4.6
Export path= $ZOOKEEPER _home/bin: $PATH
Make the configuration file effective
$ source/home/jqlin/.bash_profile
9. Open Ports 2181, 2888, 3888 to be used in the firewall
Switch to root user rights and execute the following command:
# chkconfig Iptables on
# service Iptables Start
Edit/etc/sysconfig/iptables
# Vi/etc/sysconfig/iptables
Add the following 3 lines:
-A input-m state--state new-m tcp-p TCP--dport 2181-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 2888-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 3888-j ACCEPT
To restart the firewall:
# Service Iptables Restart
To view the firewall port status:
# Service Iptables Status
XXX Firewall Information
10, start and test zookeeper (to use Jqlin user start, do not use root):
(1) Use the Jqlin user to the/home/jqlin/zookeeper-3.4.6/bin directory to execute:
$ zkserver.sh Start
(2) Enter the JPS command to view the process:
$ JPS
1456 Quorumpeermain
1475 Jps
Wherein, Quorumpeermain is the zookeeper process, starts the normal
(3) View status:
$ zkserver.sh Status
(4) View Zookeeper service output information:
Because the service information output file is in/home/jqlin/zookeeper-3.4.6/bin/zookeeper.out
$ tail-500f Zookeeper.out
11. Stop the Zookeeper process:
$ zkserver.sh Stop
12. Configure zookeeper Boot using Jqlin User:
Edit/etc/rc.local file, add:
Su-jqlin-c '/home/jqlin/zookeeper-3.4.6/bin/zkserver.sh start '
Install Dubbo Registration Center (Zookeeper-3.4.6)--single node