小白在云服务搭建dubbo和zookeeper

题注:自己的改 ip, 不要一头脑的复制。

第一步:用终端工具连接上阿里云。

 

第二步:查看dubbo-admin镜像

执行拉取指令,默认选择 latest 版本;
 docker pull chenchuxin/dubbo-admin
查看镜像:
docker images

由于我们端口已经被占用我们需要更改端口,还要去阿里云开放端口
我开放的是 8081 3306 8080

第三步:查看本地镜像和检索拉取Zookeeper 镜像

# 检索 ZooKeeper 镜像
docker search zookeeper \ 

# 拉取 ZooKeeper 镜像最新版本
docker pull zookeeper:latest
第一步:创建ZooKeeper 挂载目录(数据挂载目录、配置挂载目录和日志挂载目录)
 
mkdir -p /usr/local/zookeeper/data # 数据挂载目录
mkdir -p /usr/local/zookeeper/conf # 配置挂载目录
mkdir -p /usr/local/zookeeper/logs # 日志挂载目录 
第二步:添加ZooKeeper配置文件,在挂载配置文件目录(/usr/local/zookeeper/conf)下,新增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=/data
# the port at which the clients will connectclientPort=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
## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMet
ricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true 
第三步启动zookeeper:
docker run -d \
--name zookeeper \
--privileged=true \
-p 2181:2181 \
--restart=always \
-v /usr/local/zookeeper/data:/data \
-v /usr/local/zookeeper/conf:/conf \
-v /usr/local/zookeeper/logs:/datalog \
zookeeper
查看zookeeper容器地地址
docker inspect zookeeper
启动容器:
docker run -d \
-p 8081:8080 \
-e dubbo.registry.address=zookeeper://172.17.0.3:2181 \
-e dubbo.admin.root.password=root \
-e dubbo.admin.guest.password=guest \
chenchuxin/dubbo-admin 
# 注意 -e DUBBO_REGISTRY=zookeeper://ip:port 填写自己的 zookeeper ip 和端口号
# -e DUBBO_ROOT_PASSWORD 配置控制台 root 账号 密码
# -e DUBBO_GUEST_PASSWORD 配置控制台 guest 账号 密码
#-v 是宿主机与容器的挂载目录
#-p 是访问的端口号
去浏览器运行
如图显示,zookeeperdubbo也已经正启动

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值