栏目分类:
子分类:
返回
终身学习网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
终身学习网 > IT > 前沿技术 > 云计算 > 云平台

在腾讯云安装docker及zookeeper和dubbo

云平台 更新时间:发布时间: 百科书网 趣学号

开放端口,如果是做实验,就先在云安全策略组,全部开发吧。也可以有选择的开放对应的端口,用什么就开放什么。

1.查看当前centos版本

yum install -y redhat-lsb

lsb_release –a

 2.按照docker要求系统为64位,系统内核版本为3.10以上

uname –r

查看是否已安装docker列表

yum list installed | grep docker

3.    安装docker:
yum -y install docker

4.    启动docker:
systemctl start docker
5.    查看服务是否启动:
systemctl status docker
6.阿里云镜像加速

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://01sy6s7g.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

systemctl status docker

7.设置开机自动启动命令:
systemctl enable docker.service

安装dubbo-admin

docker search dubbo-admin
docker pull chenchuxin/dubbo-admin

安装zookeeper
docker search 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 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
## 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

启动dubbo-admin:

docker run -d  --name dubbo-admin  -v /home/dubbo/dubbo-admin:/data  -p 8180:8080  -e DUBBO_REGISTRY="zookeeper://172.17.0.2:2181"  -e DUBBO_ROOT_PASSWORD=root  -e DUBBO_GUEST_PASSWORD=guest  --restart=always  chenchuxin/dubbo-admin


# 注意 -e DUBBO_REGISTRY=zookeeper://ip:port 填写自己的zookeeper ip和端口号
# -e DUBBO_ROOT_PASSWORD 配置控制台root账号 密码 
# -e DUBBO_GUEST_PASSWORD 配置控制台guest账号 密码 
#-v 是宿主机与容器的挂载目录 #-p 是访问的端口号

运行:用户名 root/root或guest/guest

转载请注明:文章转载自 www.051e.com
本文地址:http://www.051e.com/it/1044642.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 ©2023-2025 051e.com

ICP备案号:京ICP备12030808号