One, Linux under Zookeeper installation
1. Install the Java Environment and configure the Java-related environment variable $java_home.
Jdk-6u27-linux-i586.bin Run Environment Package
yum-y Install glibc.i686 glibc-devel.i686
chmod +x Jdk-6u27-linux-i586.bin
./jdk-6u27-linux-i586.bin
MV JDK1.6.0_27/USR/LOCAL/JDK
[Email protected] jdk]#/usr/local/jdk/bin/java-version
Java Version "1.6.0_27"
Java (TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot (TM) Client VMs (build 20.2-b06, mixed mode, sharing)
[Email protected] jdk]# VIM/ETC/BASHRC
Export JRE_HOME=/USR/LOCAL/JDK
Export Java_bin=/usr/local/jdk/bin
Export path= $JRE _home/bin: $PATH
Export classpath=.: $JRE _home/lib/dt.jar: $JRE _home/lib/tools.jar
Export Jre_home java_bin PATH CLASSPATH
: Wq
[[email protected] JDK] #source/ETC/BASHRC
or download the Java package
TAR-ZXVF Java.tar
MV java/usr/local/
[Email protected] jdk]# VIM/ETC/BASHRC
Export Jre_home=/usr/local/java
Export Java_bin=/usr/local/java/bin
Export path= $JRE _home/bin: $PATH
Export classpath=.: $JRE _home/lib/dt.jar: $JRE _home/lib/tools.jar
Export Jre_home java_bin PATH CLASSPATH
2. Installing the Tomcat software package (apache-tomcat-7.0.70.tar.gz)
Unpacking Packages
TAR-ZXVF apache-tomcat-7.0.70.tar.gz
MV Apache-tomcat-7.0.70/usr/local/tomcat
webapps/root/Web Directory
Logs Log Directory
Conf configuration file
Bin can execute commands
shutdown.sh Stop Service
startup.sh Start Service
Start Tomcat service default listener 8080 port
Netstat-untlalp | grep:8080
3. Install the ZOOKEEPER-3.4.8.TAR.GZ package
(1) Unpacking the package
TAR-ZXVF zookeeper-3.4.8.tar.gz
The executable files are in the bin/directory, and the configuration is in the conf/directory
(2) build configuration
conf/Directory has a zoo_sample.cfg, is a template configuration file
Cp-p zoo_sample.cfg zoo.cfg
copying a copy into Zoo.cfg
There are two more important configurations:
Datadir=/usr/local/zookeeper/data # Data storage location, can be modified as needed
clientport=2181 # Service Listening port, can be modified as needed
(3) Start-up service
bin/zkserver.sh start
If it does not start successfully, a check whether the Java_home is set correctly, two see if the port is conflicting
(4) Start the client test
Start command:
Bin/zkcli.sh-server 127.0.0.1:2181
Second, installation Dubbo
(1) DownloadDubbo-admin-2.8.4a.warpackage, inLinuxof theTomcatdeployment, the first Tomcat root files are deleted, theDubbo-admin-2.8.4a.warplaced inTomcatof theWebapps/rootand then unzip it:
rm-rf/usr/local/tomcat/webapps/root/*
MV dubbo-admin-2.8.4a.war/usr/local/tomcat/webapps/root/
Unzip Dubbo-admin-2.8.4a.war view file has the following content
Crossdomain.xml CSS Dubbo-admin-2.8.4a.war favicon.ico images js Meta-inf spryassets web-inf
(2) then to webapps/root/web-inf dubbo.properties file, which points to zookeeper , using the zookeeper registry,:
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/76/wKiom1gxE-WxLJH1AAAcOZrOll8310.png-wh_ 500x0-wm_3-wmp_4-s_4289477502.png "title=" Qq20161120110848.png "alt=" wkiom1gxe-wxljh1aaacozroll8310.png-wh_50 "/
(3) then start :
[Email protected] web-inf]#/usr/local/tomcat/bin/startup.sh
Boot complete, http://localhost:8080 access test, Default user name and password: root/root
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/72/wKioL1gxE_Lz81NLAAAyU-HqI4Y248.png-wh_500x0-wm_3 -wmp_4-s_3302283282.png "title=" Qq20161120110900.png "alt=" Wkiol1gxe_lz81nlaaayu-hqi4y248.png-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8A/76/wKiom1gxFFDg3V49AAB7Lb0df8I487.png-wh_500x0-wm_3 -wmp_4-s_4068775162.png "title=" Qq20161120111011.png "alt=" Wkiom1gxffdg3v49aab7lb0df8i487.png-wh_50 "/>
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/72/wKioL1gxFF7QgKDeAACWQZO3bGY443.png-wh_500x0-wm_3 -wmp_4-s_449741965.png "title=" Qq20161120111053.png "alt=" Wkiol1gxff7qgkdeaacwqzo3bgy443.png-wh_50 "/>
The following is the configuration of the Application.properties file in the project
Jdbc.driver=com. MySQL.jdbc.Driver
jdbc.url=jdbc:mysql://172.16.2.59:3306/oms_gb?useunicode=yes&characterencoding=utf8&allowmultiqueries= True
Jdbc.username=admin
Jdbc.password=admin
jdbc.pool.minidle=10
Jdbc.pool.maxidle=20
jdbc.pool.maxactive=150
#当前应用名称
Dubbo.application.name=oms
#当前应用负责人
Dubbo.application.owner=jiaohua.wu
#当前应用负责人组织
Dubbo.application.organization=winit
#dubbo. Registry.protocol=multicast
#dubbo. registry.address=224.5.6.7:1234
#注册中心地址协议
Dubbo.registry.protocol=zookeeper
#注册中心地址
dubbo.registry.address=172.16.2.78:2181
#dubbo. registry.address=172.16.2.59:2181
#服务注册类型 false: Static type (Monitoring center management on downline) true: Automatic Management
Dubbo.registry.dynamic=true
#服务协议 Dubbo, RMI, Hessian, HTTP, WebService, Thrift, memcached, Redis
#缺省配置为dubbo协议, the use of a single long connection and NIO asynchronous communication, suitable for small data volume of large concurrent service calls, and the number of service consumer machines is much larger than the number of service provider machines.
Dubbo.protocol.protocol=dubbo
#服务数据通信端口
dubbo.protocol.port=20810
#all all messages are distributed to the thread pool, including requests, responses, connection events, disconnect events, heartbeat, and so on.
#direct all messages are not distributed to the thread pool and are executed directly on the IO thread.
#message only request response messages are distributed to the thread pool, other connection disconnect events, heartbeat and other messages are executed directly on the IO thread.
#execution only requests messages to the thread pool, without response, response, and other connection disconnect events, heartbeat, and so on, directly on the IO thread.
#connection on the IO thread, the connection disconnect events are placed in the queue, executed one by one, and other messages are distributed to the thread pool.
Dubbo.protocol.dispatcher=all
#fixed a fixed-size thread pool, start-up threads, do not shut down, have been held. Default
#cached cache thread pool, idle one minute automatically delete, rebuild when needed.
#limited A scalable thread pool, but the number of threads in the pool only grows and does not shrink. (to avoid a sudden high-flow performance problem when shrinking).
dubbo.protocol.threadpool=limited
#初始化线程池数量
dubbo.protocol.threads=200
#provider服务超时 (set provider end, consumer not recommended)
dubbo.timeout=60000
#consumer启动试不检查provider
Dubbo.check=false
#provider是否验证参数
Dubbo.validation=true
#provider并发数
dubbo.executes=500
#集群模式 Failover: Failure auto-Toggle (default), Ailfast: One-time call failed, failsafe: Fail-safe, failback: Failed recovery timed re-send, broadcast: Broadcast call failed
Dubbo.cluster=failover
#失败重试次数
dubbo.retries=2
#负载平衡 random: Stochastic, Roundrobin: Round robin, leastactive: Minimum number of active calls, Consistenthash: consistent hash value
Dubbo.loadbalance=random
This article is from the "Down to earth" blog, make sure to keep this source http://343614597.blog.51cto.com/7056394/1874745
Linux installation Dubbo+zookeeper