[英]How do I change Grafana docker container environment variables on AWS Fargate to use a mysql database
How do I change Grafana Docker container environment variables on AWS Fargate to use a mysql database?如何更改 AWS Fargate 上的 Grafana Docker 容器环境变量以使用 mysql 数据库? I am very new to AWS and containers.我对 AWS 和容器非常陌生。 Is it through the cmd line?是通过 cmd 行吗? When I type "docker ps -a" my containers do not show up.当我输入“docker ps -a”时,我的容器没有出现。 I've tried looking through the Grafana documentation but I think that's if you are running the containers locally.我试过浏览 Grafana 文档,但我认为这是在本地运行容器的情况下。 Would it be the same for AWS? AWS 也会这样吗? I've looked into SSHing into the containers, but that requires me to alter the task definition in Terraform.我已经研究过通过 SSH 连接到容器中,但这需要我更改 Terraform 中的任务定义。
You need to define correct variables in the ECS task definition , eg:您需要在 ECS 任务定义中定义正确的变量,例如:
GF_DATABASE_TYPE: mysql
GF_DATABASE_HOST: my-mysql:3306
GF_DATABASE_USER: my-user
GF_DATABASE_PASSWORD: my-password
Of course you may need to more if you have specific DB configuration.当然,如果您有特定的数据库配置,您可能需要更多。 All options are documented: https://grafana.com/docs/grafana/latest/administration/configuration/#database所有选项都记录在案: https ://grafana.com/docs/grafana/latest/administration/configuration/#database
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.