尝试与弹性beantalk一起运行时出现Prisma错误

时间:2018-12-19 20:24:40

标签: amazon-web-services amazon-elastic-beanstalk prisma

运行$ docker-compose up时,我有一个可以在本地正常运行的pyramida项目。我将docker-compose.yml文件转换为Dockerrun.aws.json。但是现在,当我尝试通过$ eb local run在本地运行项目时,出现错误

mysql_1   | Version: '5.7.24'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
prisma_1  | Exception in thread "main" java.sql.SQLTransientConnectionException: database - Connection is not available, request timed out after 5001ms.

下面是我的Dockerrun.aws.json文件:

{
"AWSEBDockerrunVersion": "2",
"containerDefinitions": [
    {
    "environment": [
        {
        "name": "MYSQL_ROOT_PASSWORD",
        "value": "prisma"
        }
    ],
    "essential": true,
    "memory": 128,
    "image": "mysql:5.7",
    "mountPoints": [
        {
        "containerPath": "/var/lib/mysql",
        "sourceVolume": "Mysql"
        }
    ],
    "name": "mysql",
    "portMappings": [
        {
        "containerPort": 3306,
        "hostPort": 3306
        }
    ]
    },
    {
    "environment": [
        {
        "name": "PRISMA_CONFIG",
        "value": "port: 4466\ndatabases:\n  default:\n    connector: mysql\n    host: mysql\n    port: 3306\n    user: root\n    password: prisma\n    migrations: true\n"
        }
    ],
    "essential": true,
    "memory": 128,
    "image": "prismagraphql/prisma:1.21",
    "name": "prisma",
    "portMappings": [
        {
        "containerPort": 4466,
        "hostPort": 4466
        }
    ]
    }
],
"family": "",
"volumes": [
    {
    "host": {
        "sourcePath": "mysql"
    },
    "name": "Mysql"
    }
]
}

该错误消息使我相信将pyramida容器连接到mysql实例时存在问题。如果我不得不猜测它是PRISMA_CONFIG值,但不是我不确定100%。有人可以告诉我我在做什么错吗?

1 个答案:

答案 0 :(得分:0)

您不能在那里那些7 -> 4 + 3 -> (2 + 2) + (2 + 1) -> ((1 + 1) + (1 + 1)) + ((1 + 1) + 1)。 YAML关注真正的运输和空间。