docker-compose安装sentinel

1.获取sentinel.zip,并上传至/data/soft目录下,目录可任意

通过网盘分享的文件:sentinel.zip 链接: 百度网盘 请输入提取码 提取码: 1234 --来自百度网盘超级会员v7的分享

  1. 解压sentinel.zip:

    unzip sentinel.zip注意:如果unzip命令不可用则需要安装unzip:sudo yum install unzip

3.进入/data/soft/sentinel目录,如下所示:

注意修改docker-compose.yml中的nacos的地址及nacos的账号和密码:

XML 复制代码
version: "3.8"
services:
  sentinel:
    container_name: sentinel-dashboard
    image: sentinel-dashboard:latest
    ports:
        - "8080:8080"
    environment:
        - "TZ=Asia/Shanghai" 
        # nacos访问地址+端口号
        - SENTINEL_NACOS_SERVER_ADDR=192.168.101.68:8848
        # nacos访问账号
        - SENTINEL_NACOS_USERNAME=nacos
        # nacos访问密码
        - SENTINEL_NACOS_PASSWORD=nacos
        # nacos访问命名空间
        - SENTINEL_NACOS_NAMESPACE=75a593f5-33e6-4c65-b2a0-18c403d20f63
        # sentinel dashboard平台登录账号
        - SENTINEL_USERNAME=sentinel
        # sentinel dashboard平台登录密码
        - SENTINEL_PASSWORD=sentinel
        # sentinel dashboard 访问端口号
        - SENTINEL_PORT=8080

执行下边的命令创建镜像,如下:

复制代码
docker build -t sentinel-dashboard .

下边启动容器:

复制代码
docker-compose up -d

启动容器成功,通过docker ps命令查看容器:

接下来访问sentinel ,地址:http://192.168.101.68:8080/#/login

需要输入账号和密码,默认都是:sentinel

项目集成sentinel

添加nacos配置文件shared-sentinel.yaml,如下:

XML 复制代码
spring:
  cloud:
    sentinel:
      transport:
        # 供sentinel dashboard平台访问端口
        port: 8719
        # sentinel控制台
        dashboard: 192.168.101.68:8080
        #服务启动直接建立心跳连接
      eager: true
相关推荐
lichenyang4531 天前
Docker 学习笔记(五):Docker Compose,用一个 YAML 启动前端、后端和 MongoDB
docker
lichenyang4531 天前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang4531 天前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang4531 天前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
Patrick_Wilson6 天前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
Suroy6 天前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭6 天前
运行你的第一个Docker容器
后端·docker·容器
宋均浩7 天前
# Docker 镜像瘦身实战:从 1.2G 到 80MB 的五个优化步骤
ci/cd·docker
程序员老赵8 天前
10 分钟部署 OpenCode:Docker 一键安装,浏览器打开就能用 AI 写代码(附完整命令与排错)
docker·容器·ai编程
WangMingHua1118 天前
LM Studio Docker 部署——本地大模型一键启动
docker