当前位置:网站首页>微服务系统架构搭建一:环境搭建
微服务系统架构搭建一:环境搭建
2022-06-13 08:10:00 【梦.之.蓝】
1,安装docker
1 卸载系统之前的docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2 设置存储库
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3 安装DOCKER引擎
sudo yum install docker-ce docker-ce-cli containerd.io
4 启动Docker.
sudo systemctl start docker
5 配置镜像加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://chqac97z.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
启动docker
systemctl start docker
2,安装redis
1 在docker hub搜索redis镜像
docker search redis
2 拉取redis镜像到本地
docker pull redis:6.0.10
3 修改需要自定义的配置(docker-redis默认没有配置文件,
自己在宿主机建立后挂载映射)
创建并修改/usr/local/redis/redis.conf
bind 0.0.0.0 开启远程权限
appendonly yes 开启aof持久化
4 启动redis服务运行容器,启动容器
docker run --name redis -v /usr/local/redis/data:/data -v /usr/local/redis/redis.conf:/usr/local/etc/redis/redis.conf -p 6379:6379 -d redis:6.0.10 redis-server /usr/local/etc/redis/redis.conf
解释: -v /usr/local/redis/data:/data # 将数据目录挂在到本地保证数据安全
-v /root/redis/redis.conf:/usr/local/etc/redis/redis.conf # 将配置文件挂在到本地修改方便
5 直接进去redis客户端。
docker exec -it redis redis-cli
6 本地远程连接redis
7 需要在腾讯云开启防火墙通过
8 设置redis连接的账号密码
3,安装postgresql
网页链接
docker安装postgresql_客官酒来了的博客-CSDN博客_docker postgresql
账号:postgres 密码:password
1.查询postgresql镜像
docker search postgres
2.拉取镜像文件
docker pull postgres:14.2
3,创建文件夹
mkdir postgresql
4,启动容器,并设置密码
docker run --name postgres \
--restart=always \
-e POSTGRES_PASSWORD=password \
-p 5432:5432 \
-v /data/postgresql:/var/lib/postgresql/data \
-d postgres:14.2
5,开启防火墙,提供外部访问
4,安装nacos
网址为
账号:nacos 密码:nacosDocker安装Nacos详细教程_秋枫萧竹的博客-CSDN博客_docker安装nacos本次教程采用的虚拟机是centos7。一、拉取镜像二、启动容器三、测试https://blog.csdn.net/qq_44697728/article/details/122677059
1,拉取镜像,安装最新稳定版,注意,在这里,qq浏览器不支持展示可视化界面
docker pull nacos/nacos-server:2.0.3
2,启动程序
docker run \
--name nacos -d \
-p 8848:8848 \
--privileged=true \
--restart=always \
-e JVM_XMS=256m \
-e JVM_XMX=256m \
-e MODE=standalone \
-e PREFER_HOST_MODE=hostname \
nacos/nacos-server:2.0.3
5,安装rabbitmq
网址为:
cd /opt/rabbitmq
mkdir data
# 拉取镜像
docker pull rabbitmq:3-management
# 查看镜像
docker images
# 启动rabbitMq
docker run -d \
-v /opt/rabbitmq/data:/var/lib/rabbitmq \
-p 5672:5672 -p 15672:15672 --name rabbitmq --restart=always \
--hostname myRabbit rabbitmq:3-management
# 启动rabbitmq_management, rabbitmq 为容器的名称,使用id也可以
docker exec -it rabbitmq rabbitmq-plugins enable rabbitmq_management
# ip+端口号登录,用户名和密码默认都是guest
浏览器访问http://192.168.124.129:15672
初始账号密码 guest guest
6,安装nginx
7,安装sentinal
网址:
拉取镜像:
docker pull bladex/sentinel-dashboard
启动:
docker run --name sentinel -d -p 8858:8858 -d bladex/sentinel-dashboard
8,安装seata
通过实践实现整合:
在这里,要指定seata的版本,指定数据库为postgresql,是否要指定kafka的日志版本
操作步骤:
9,安装zipkin链路追踪
docker run -d -p 9411:9411 openzipkin/zipkin
边栏推荐
- [complete information static game characteristics of Nash equilibrium]
- Cosmos Starport installation and startup
- 名次的确定
- [game theory complete information static game] Application of Nash equilibrium
- 【Emgu.CV】Emgu. CV. Example\ocr operation reports an error system IO. Filenotfoundexception: "failed to load file or assembly" system.drawing.common "
- BD新标签页(BdTab)插件如何登入?
- Word中批注的使用方法
- 4. fabric2.2 create and join channels (use the official demo)
- 赋予代码生命力--读代码整洁之道
- How to dynamically delete data rows in a table through JS (keep the head)
猜你喜欢
es6删除对象的某个属性
【深度学习】:《PyTorch入门到项目实战》(十二)卷积神经网络:填充(padding)和步幅(stride)
Win10系统如何修改桌面路径
[problem record] taberror: inconsistent use of tabs and spaces in indentation
Cosmos Starport installation and startup
Detailed explanation of digital certificate and Ca
Create a substrate private network
20 | 面向流水线的指令设计(上):一心多用的现代CPU
MySQL table partitioning
Overview of cross chain protocol IBC
随机推荐
[MySQL] online lock free delay free DDL artifact GH OST
赋予代码生命力--读代码整洁之道
将solidworks建的机器人模型导入到ros中
杨氏矩阵查找数字是否存在
Clickhouse column basic data type description
适合生鲜批发行业的几种精准接单方式
Openharmony notes ----------- (I)
【PYTORCH】Expected object of type torch. xxxTensor but found type torch. cuda. xxxTensor(torch0.4.0)
Edge浏览器使用BdTab新标签页插件(BD新标签页)
Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object
Success logarithm of leetcode spells and potions
字符串的逆序与比较
2022年危险化学品经营单位安全管理人员特种作业证考试题库及模拟考试
Basic operation of dfinity (ICP) development-4
获取类的属性
21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
[problem record] taberror: inconsistent use of tabs and spaces in indentation
Rust writes near smart contract
Data disorder occurs when the n-th row of the subcomponent list generated by V-for is deleted
平面合并(MATLAB)