一、zk安装
一、window 环境安装
二、linux下安装
1、下载zookeeper
网址 https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
2、 解压tar包
3、 移动到指定位置并改名为zookeepe
- 配置zoo.cfg, 当然也可以把zk注册为开机启动,需要写脚本
4.1 拷贝/usr/local/zookeeper/conf/zoo_sample.cfg
到同一个目录下改个名字叫zoo.cfg
4.2 设置zoo.cfg中的数据存放位置—dataDir=/opt/zk/temp/zookeeper
[root@instance-45oh6r0z conf]# cat zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/opt/zk/temp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
4.3 启动zk 进入到bin目录下运行命令: ./zkServer.sh start
三、安装dubbo-admin管理控制台
dubbo本身并不是一个服务软件。它其实就是一个jar包能够帮你的java程序连接到zookeeper,并利用zookeeper消费、提供服务。所以你不用在Linux上启动什么dubbo服务。
但是为了让用户更好的管理监控众多的dubbo服务,官方提供了一个可视化的监控程序,不过这个监控即使不装也不影响使用,dubbo控制台中可查看注册服务信息消费信息,以及对服务的容错,负载均衡管理。
dubbo的控制台有两个版本:一个war工程,一个是Springboot工程的jar,这讲解jar的安装。
1、下载dubbo-admin https://github.com/apache/incubator-dubbo-ops
2、进入目录,修改dubbo-admin配置
修改 src\main\resources\application.properties 指定zookeeper地址
3、打包dubbo-admin
mvn clean package -Dmaven.test.skip=true
4、运行dubbo-admin,因为是一个Springboot工程所以可以直接 java -jar 启动
java -jar dubbo-admin-0.0.1-SNAPSHOT.jar
5、访问控制台: http://localhost:7001 即可,注意自己的ip与dubbo控制台的端口我这里是7001
默认使用root/root 登陆
四、监控中心安装 dubbo-monitor-simple
1 、 监控中心安装
2、配置监控中心 — dubbo:monitor
Simple Monitor 挂掉不会影响到 Consumer 和 Provider 之间的调用,所以用于生产环境不会有风险。
Simple Monitor 采用磁盘存储统计信息,请注意安装机器的磁盘限制,如果要集群,建议用mount共享磁盘。