centos7部署dubbo-admin

1.下载zookeeper

wget https://downloads.apache.org/zookeeper/zookeeper-3.6.0/apache-zookeeper-3.6.0-bin.tar.gz

2.解压

#### 创建目录
mkdir -p /usr/local/zookeeper

#### 解压
tar zxvf apache-zookeeper-3.6.0-bin.tar.gz -C /usr/local/zookeeper/


3.修改配置文件

#### 创建数据目录
mkdir /usr/local/zookeeper/apache-zookeeper-3.6.0-bin/data

#### 进入配置文件目录
cd /usr/local/zookeeper/apache-zookeeper-3.6.0-bin/conf

#### 复制配置文件
cp zoo_sample.cfg zoo.cfg

#### 编辑配置文件
vim zoo.cfg

#### 把 dataDir=/tmp/zookeeper 改成如下
dataDir=/usr/local/zookeeper/apache-zookeeper-3.6.0-bin/data

#### 3.5后性特性默认端口8080,需要更改端口,没冲突则不需要更改
#### https://zookeeper.apache.org/doc/r3.6.0/zookeeperAdmin.html#sc_adminserver_config
admin.serverPort=9665

4.设置开机启动

vim /etc/init.d/zookeeper

#### 添加如下
#!/bin/bash
#chkconfig:2345 20 90
#description:zookeeper
#processname:zookeeper
ZK_PATH=/usr/local/zookeeper/apache-zookeeper-3.6.0-bin
export JAVA_HOME=/usr/local/java/jdk1.8.0_241
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


#### 添加权限
chmod +x /etc/init.d/zookeeper

#### 加入服务
chkconfig --add zookeeper

#### 开机自启
chkconfig zookeeper on

5.查看启动

ps -ef|grep zookeeper

6.dubbo

官方文档

1.下载dubbo-admin

git clone https://github.com/apache/dubbo-admin.git

2.设置端口

#### 在如下文件
dubbo-admin\dubbo-admin-server\src\main\resources\application.properties

#### 添加一行
server.port=8099

3.忽略test

#### 在root的pom.xml里面


	org.apache.maven.plugins
	maven-surefire-plugin
	2.21.0


#### 改为如下


	org.apache.maven.plugins
	maven-surefire-plugin
	2.21.0
	
		true
	

4.打包

#### 在IDEA里面的右边点开Maven点击dubbo-admin(root)
#### 先后执行如下2个命令
clean
install

5.部署

#### 完成后dubbo-admin\dubbo-admin-distribution\target会有个dubbo-admin-0.1.jar
#### 可以部署到本机或者linux上

请确保zookeeper已经启动
java -jar dubbo-admin-0.1.jar
或者后台运行
nohup java -jar dubbo-admin-0.1.jar  > dubbo-admin.log  2>&1 &

 

你可能感兴趣的:(dubbo,zookeeper)