dubbo+zookeeper
Dubbo是阿里巴巴开源的基于 Java 的高性能 RPC(一种远程调用) 分布式服务框架(SOA),致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案
ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件。它是一个为分布式应用提供一致性服务的软件,提供的功能包括:配置维护、域名服务、分布式同步、组服务等
实验环境
centos6.5_x64
实验软件
jdk-8u152-linux-x64.tar.gz
apache-tomcat-8.5.24.tar.gz
dubbo-admin-2.6.0.war
zookeeper-3.4.11.tar.gz
软件安装
cp -pv /etc/hosts /etc/hosts.bak
echo 192.168.10.18 dub1 >> /etc/hosts
sed -i.bak 's/centos6/dub1/g' /etc/sysconfig/network
sed -i.bak 's/https/http/g' /etc/yum.repos.d/epel.repo
service ntpd restart && ntpdate 192.168.10.18 && clock -w
echo SELINUX=disabled > /etc/sysconfig/selinux
service iptables stop && chkconfig --level 35 iptables off
tar zxvf /root/jdk-8u152-linux-x64.tar.gz && mv /root/jdk1.8.0_152 /usr/local/java
tar zxvf /root/apache-tomcat-8.5.24.tar.gz && mv /root/apache-tomcat-8.5.24 /usr/local/tomcat
tar zxvf /root/zookeeper-3.4.11.tar.gz && mv /root/zookeeper-3.4.11 /usr/local/zk1
cp -pv /etc/profile /etc/profile.bak
export JAVA_HOME=/usr/local/java >> /etc/profile
export PATH=$PATH:$JAVA_HOME/bin >> /etc/profile
export CATALINA_HOME=/usr/local/tomcat >> /etc/profile
export JAVA_HOME CATALINA_HOME >> /etc/profile
source /etc/profile && java -version
java version '1.8.0_152
/usr/local/tomcat/bin/configtest.sh
INFO: Initialization processed in 1308 ms
/usr/local/tomcat/bin/startup.sh
Tomcat started.
mkdir -pv /usr/local/zk1/data 创建zookeeper数据目录
mv /usr/local/zk1/conf/zoo_sample.cfg /usr/local/zk1/conf/zoo.cfg
echo 1 > /usr/local/zk1/data/myid
cat /usr/local/zk1/conf/zoo.cfg
dataDir=/usr/local/zk1/data
clientPort=2181
maxClientCnxns=100
tickTime=2000
initLimit=10
syncLimit=5
zookeeper.connect=192.168.10.18:2181
touch /etc/init.d/zookeeper && chmod +x /etc/init.d/zookeeper
cat /etc/init.d/zookeeper
#!/bin/bash
#chkconfig:2345 20 90
#description:zookeeper
#processname:zookeeper
ZK_PATH=/usr/local/zk1
export JAVA_HOME=/usr/local/java
case $1 in
start) sh $ZK_PATH/bin/zkServer.sh start;;
stop) sh $ZK_PATH/bin/zkServer.sh stop;;
status) sh $ZK_PATH/bin/zkServer.sh status;;
restart) sh $ZK_PATH/bin/zkServer.sh restart;;
*) echo 'require start|stop|status|restart' ;;
esac
/usr/local/tomcat/bin/shutdown.sh
cp -pv /root/dubbo-admin-2.6.0.war /usr/local/tomcat/webapps/dubbo-admin
/usr/local/tomcat/bin/startup.sh
ll /usr/local/tomcat/webapps/
dubbo-admin
dubbo-admin.war
dubbo-governance.log
service zookeeper start
chkconfig --level 35 zookeeper on 设置开机启动
netstat -tuplna | grep 2181
tcp 0 0 :::2181 :::* LISTEN 1655/java
netstat -tuplna | grep 8080
tcp 0 0 :::8080 :::* LISTEN 1443/java
http://serviceip:8080/dubbo-admin/
用户名/密码 root/root