简体   繁体   English

如何更改 AWS Fargate 上的 Grafana docker 容器环境变量以使用 mysql 数据库

[英]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.

相关问题 docker容器中的'aws configure'不会使用环境变量或配置文件 - 'aws configure' in docker container will not use environment variables or config files 如何在 AWS-ECR 中为 docker 映像使用环境变量? - How to use environment variables for a docker image in AWS-ECR? aws fargate 为环境变量添加参数 - aws fargate adding a parameter for environment variables 如何在AWS ECS docker容器中获取AWS凭据? - How do I get AWS credentials in the AWS ECS docker container? 如何增加 AWS Fargate 容器中的磁盘空间? - How can I increase the disk space in AWS Fargate container? AWS上的Docker-环境变量未从主机继承到容器 - Docker on AWS - Environment Variables not inheriting from host to container AWS XRay SDK 无法读取 docker 容器内的环境变量 - AWS XRay SDK fails to read environment variables within a docker container 如何使用AWS CLI设置加密的Lambda环境变量? - How do I use the AWS CLI to set encrypted Lambda environment variables? 我可以从 docker 容器内访问 AWS Fargate 任务 ID 吗? - Can I access a AWS Fargate task id from inside a docker container? 在使用 Node.js 连接到 S3 时,如何让我在 AWS Fargate 容器中运行的代码承担 IAM 角色? - How do I enable my code runing in a AWS Fargate container to assume an IAM role when connecting to S3 with Node.js?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM