Dubbo Video Tutorial--Basic--No. 03 Section--zookeeper Registration Center installation detailed steps (single node)

Source: Internet
Author: User

This article is a course series document for the Dubbo-based Distributed System Architecture video tutorial, for more information about the course, please follow: http://www.roncoo.com


Dubbo Video Tutorial--Basic--No. 03 Section--zookeeper Registration Center installation detailed steps (single node)


installation Dubbo Registration Center (Zookeeper-3.4.6)


Dubbo Recommended Use Zookeeper as the registry for the service.


Registration Center Server (192.168.3.71) configuration, installing zookeeper:

1. Modify the operating system of the/etc/hosts file to add:

#zookeeper servers

    1. 192.168.3.71 edu-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. Unzip the Zookeeper installation package:

$ TAR-ZXVF zookeeper-3.4.6.tar.gz


4. create the following directory under the/home/wusc/zookeeper-3.4.6 directory:

$ cd/home/wusc/zookeeper-3.4.6

$ mkdir Data

$ mkdir Logs


5. Copy the Zoo_sample.cfg file in the zookeeper-3.4.6/conf directory, named as Zoo.cfg

$ cp zoo_sample.cfg Zoo.cfg


6. To Modify the zoo.cfg configuration file:

$ VI zoo.cfg

# The number of milliseconds of each tick

ticktime=2000

# The number of ticks thatthe initial

# Synchronization Phase Cantake

initlimit=10

# The number of ticks Thatcan pass between

# Sending a request andgetting an acknowledgement

Synclimit=5

# The directory where thesnapshot is stored.

# do not use/tmp Forstorage,/tmp here are just

# example Sakes.

Datadir=/home/wusc/zookeeper-3.4.6/data

Datalogdir=/home/wusc/zookeeper-3.4.6/logs

# The port at which Theclients would connect

clientport=2181

#2888, 3888 is election port

server.1=edu-provider-01:2888:3888


which

2888 Port numbers are ports that communicate between zookeeper services.

3888 is the port that zookeeper communicates with other applications.

edu-provider-01 is the host name of the IP that has been mapped in the hosts.


Initlimit : This configuration item is used to configure the Zookeeper accept client (the client here is not the client that connects the Zookeeper server, but the Follower that is connected to Leader in the Zookeeper server cluster) Server) The maximum number of heartbeat intervals that can be tolerated when a connection is initialized. The client connection failed when the zookeeper server has not received the return information of the client after 10 heartbeats (that is, ticktime) length. The total length of time is 5*2000=10 seconds.

Synclimit : This configuration item identifies the length of time that a message is sent between Leader and Follower, the duration of the request and the response, and the maximum number of ticktime, the total length of time is 2*2000=4 seconds.

server. A=b:c:d: Where A is a number, indicating this is the name of the server, B is the IP address of the server or the/etc/hosts file mapped the IP hostname, C is the server and the Leader server in the cluster to exchange information on the port; D Indicates that in case the Leader server in the cluster is hung up, a port is needed to re-elect and a new Leader is selected, which is the port that the server communicates with each other when the election is performed. If it is a pseudo-cluster configuration, because B is the same, so different Zookeeper instance communication port numbers can not be the same, so they should be assigned a different port number.

7. Create a myID file under Datadir=/home/wusc/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

1


8. WUSC The user modifies the vi/home/wusc/.bash_profileand adds the zookeeper configuration:

# Zookeeper Env

Export zookeeper_home=/home/wusc/zookeeper-3.4.6

Export path= $ZOOKEEPER _home/bin: $PATH


Make the configuration file effective

$ Source/home/wusc/.bash_profile


9. Open Ports 2181, 2888, 3888 that you want to use in your firewall

Switch to root user rights and execute the following command:

# Chkconfigiptables on

# Serviceiptables Start

Edit/etc/sysconfig/iptables

# Vi/etc/sysconfig/iptables

Add the following 3 lines:

-A input-mstate--state new-m tcp-p tcp--dport 2181-j ACCEPT

-A input-mstate--state new-m tcp-p tcp--dport 2888-j ACCEPT

-A input-mstate--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

Table:filter

Chain INPUT (Policy ACCEPT)

Num Target prot opt source destination

1 ACCEPT All – 0.0.0.0/0 0.0.0.0/0 State related,established

2 ACCEPT ICMP--0.0.0.0/0 0.0.0.0/0

3 ACCEPT All--0.0.0.0/0 0.0.0.0/0

4 ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 state NEW TCP dpt:22

5 ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 state NEW TCP dpt:2181

6 ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 state NEW TCP dpt:2888

7 ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 state NEW TCP dpt:3888

8 REJECT All--0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited


Chain FORWARD (Policy ACCEPT)

Num Target prot opt source destination

1 REJECT All--0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited


Chain OUTPUT (Policy ACCEPT)

Num Target prot opt source destination

10. Start and Test zookeeper ( to start with WUSC user, do not use root):

(1) Use the WUSC user to the/home/wusc/zookeeper-3.4.6/bin directory to execute:

$ Zkserver.shstart

(2) input JPS command to view the process:

$ JPS

1456 Quorumpeermain

1475 Jps


among them, Quorumpeermain is a Zookeeper process, start normal


(3) View Status:

$ zkserver.sh Status


(4) To View Zookeeper service output information:

Because the service information output file is in/home/wusc/zookeeper-3.4.6/bin/zookeeper.out

$ tail-500f zookeeper.out


11. Stop Zookeeper Process:

$ zkserver.sh Stop


12. Configure zookeeper boot using WUSC user boot:

Edit/etc/rc.local file, add:

Su-wusc-c '/home/wusc/zookeeper-3.4.6/bin/zkserver.shstart '


This article is from the "The Inevitable" blog, please make sure to keep this source http://wushuicheng.blog.51cto.com/9357402/1703369

Dubbo Video Tutorial--Basic--No. 03 Section--zookeeper Registration Center installation detailed steps (single node)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.