gpt4 book ai didi

docker - 使用 Fargate 在 ECS 上运行 Redis

转载 作者:行者123 更新时间:2023-12-02 19:47:52 25 4
gpt4 key购买 nike

在我的应用程序中,我使用了 ruby​​ 和 rails 应用程序。该应用程序在 ngix+passanger 上运行。我也使用过 Redis 和 sidekiq。我想在 ECS Fargate 上运行我的应用程序。
我已经实现了以下步骤:

  • 使用 docker 文件
  • 创建 Docker 镜像
  • 网站
  • 网络服务器
  • 雷迪斯
  • Sidekiq
  • 将 docker 镜像推送到 ECR
  • 使用 Fargate 创建任务
  • 使用 Fargate 在 ECS 上运行任务

  • 我的 docker-compose 文件如下:
    version: '3.7' 

    services:
    web:
    build:
    context: .
    dockerfile: ./Dockerfile
    ports :
    - 3000:3000
    env_file:
    - .env

    webserver:
    build :
    context: .
    dockerfile: ./nginx/Dockerfile
    links:
    - 'web'
    ports :
    - 80:80
    env_file:
    - .env

    redis:
    build :
    context: .
    dockerfile: ./redis/Dockerfile
    volumes:
    - ../../tmp/db:/var/lib/redis/data
    ports:
    - '6379:6379'

    sidekiq:
    build: .
    command: 'bundle exec sidekiq'
    当我运行任务时,我收到如下错误:
    错误
    enter image description here

    最佳答案

    在您的 Fargate 任务中,确保安全组允许端口 6379。在我看来,他的端口上的流量没有通过,导致运行状况检查失败并使任务不健康并被调度程序删除。

    关于docker - 使用 Fargate 在 ECS 上运行 Redis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62620144/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com