简体   繁体   中英

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? I am very new to AWS and containers. Is it through the cmd line? When I type "docker ps -a" my containers do not show up. I've tried looking through the Grafana documentation but I think that's if you are running the containers locally. Would it be the same for AWS? I've looked into SSHing into the containers, but that requires me to alter the task definition in Terraform.

You need to define correct variables in the ECS task definition , eg:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM