aws中使用linux搭建web无法访问,amazon-web-services – 无法访问部署在AWS Elast...

我想用Prometheus和Grafana监控我的应用程序,在AWS Elastic Beanstalk上使用Docker运行,但是在正确部署它时遇到问题.

这是我的Dockerrun.aws.json:

{

"AWSEBDockerrunVersion": "2",

"volumes": [

{

"name": "prometheus-conf",

"host": {

"sourcePath": "/var/app/current/prometheus"

}

}

],

"containerDefinitions": [

{

"name": "prometheus-app",

"image": "prom/prometheus",

"essential": true,

"memory": 512,

"portMappings": [

{

"hostPort": 9090,

"containerPort": 9090

}

],

"mountPoints": [

{

"sourceVolume": "prometheus-conf",

"containerPath": "/opt/prometheus"

}

],

"command": [

"--config.file=/opt/prometheus/prometheus.yml"

]

},

{

"name": "grafana",

"image": "grafana/grafana",

"essential": true,

"memory": 256,

"links": [

"prometheus-app"

],

"portMappings": [

{

"hostPort": 3000,

"containerPort": 3000

}

]

}

]

}

这是prometheus文件夹中的prometheus.yml:

global:

scrape_interval: 15s

evaluation_interval: 15s

rule_files:

scrape_configs:

- job_name: 'prometheus'

# metrics_path defaults to '/metrics'

# scheme defaults to 'http'.

static_configs:

- targets: ['localhost:9090']

- job_name: 'jParser'

static_configs:

- targets: ['jParser.fpemryt2er.us-east-2.elasticbeanstalk.com']

当我在eb cli中使用eb本地运行本地运行时,一切正常,我可以访问localhost:9090上的prometheus和localhost:3000上的grafana.

当我使用eb deploy将其部署到AWS Elastic Beanstalk时,该过程成功结束,我可以在我的仪表板中看到该实例,但是在一分钟状态OK切换到Severe,消息环境健康已从Ok转换为Severe. ELB运行状况失败或不适用于所有实例. 100.0%的ELB请求失败了HTTP 5xx(10分钟前):

83Rrt.png

但是,当我在EC2管理控制台中查看此实例时,它显示该实例正在运行而没有任何问题:

VllsU.png

在我的任务定义控制台中,我也可以看到Prometheus和Grafana运行没有任何问题:

jYzJo.png

但无论如何,我不能通过EB url:port提供的输入来达到prometheus和grafana,例如:jd-env.8myne2inmq.us-west-2.elasticbeanstalk.com:9090.我还尝试使用EC2控制台中显示的公共DNS和IP,但它也不起作用.

在我的负载均衡器中,我打开了端口9090和3000:

0bRNv.png

请帮助我让这些应用程序正常运行.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值