我尝试过更改端口(改为8080),使用多个端口映射,并多次重新创建服务,但没有任何效果。
当然,负载均衡器会因为未通过健康检查而终止该任务。
有什么可能出问题的地方吗?我从2017年就发现了一些Github关于这个的问题,但是在EC2支持的ECS实例上,这个问题已经被声称修复了。
{
"ipcMode": null,
"executionRoleArn": "ROLE_ARN",
"containerDefinitions": [
{
"dnsSearchDomains": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "/drone",
"awslogs-region": "eu-central-1",
"awslogs-stream-prefix": "drone-server/"
}
},
"entryPoint": null,
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
],
"command": null,
"linuxParameters": null,
"cpu": 256,
"environment": [...],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"secrets": [...],
"dockerSecurityOptions": null,
"memory": 512,
"memoryReservation": 512,
"volumesFrom": [],
"stopTimeout": 30,
"image": "drone/drone:1",
"startTimeout": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": false,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "drone-server"
}
],
"placementConstraints": [],
"memory": "512",
"taskRoleArn": "ROLE_ARN",
"compatibilities": [
"EC2",
"FARGATE"
],
"taskDefinitionArn": "TASK_DEFINITION_ARN",
"family": "drone-server",
"requiresAttributes": [
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.execution-role-awslogs"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.task-iam-role"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.container-ordering"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.secrets.ssm.environment-variables"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.task-eni"
}
],
"pidMode": null,
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256",
"revision": 14,
"status": "ACTIVE",
"proxyConfiguration": null,
"volumes": []
}```
对于EC2上的ECS,您的容器端口(如80)被映射到主机上的动态端口(如35467),然后用“instance”类型向TargetGroup注册该端口。(技术上,如果您发送一个零作为映射到容器上的端口80的主机端口,就会发生这种情况。AWS将此视为“动态分配主机上的端口”)
Fargate的最大区别在于它使用附加到任务的ENI进行网络连接,并且每个任务都有自己的私有IP地址(如果您想要的话,也可以是公共的)。
然后,使用该唯一IP地址(与实例唯一端口相反),它将端口80的唯一IP地址注册到TargetGroup(类型为'IP')。
所以有两件事可能出了问题...首先,在Fargate上,您的任务必须具有相同的主机端口和容器端口(例如80:80),并且您必须确保它注册到TargetGroup的类型为'ip'。
我不是一个terraform用户,所以不确定这在您的控制范围内,但我怀疑这两件事中的一件是不对的,并导致您的web服务/任务不能正确启动。
下面是任务定义JSON以供参考:
{
"ipcMode": null,
"executionRoleArn": "ROLE_ARN",
"containerDefinitions": [
{
"dnsSearchDomains": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "/drone",
"awslogs-region": "eu-central-1",
"awslogs-stream-prefix": "drone-server/"
}
},
"entryPoint": null,
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
],
"command": null,
"linuxParameters": null,
"cpu": 256,
"environment": [...],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"secrets": [...],
"dockerSecurityOptions": null,
"memory": 512,
"memoryReservation": 512,
"volumesFrom": [],
"stopTimeout": 30,
"image": "drone/drone:1",
"startTimeout": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": false,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "drone-server"
}
],
"placementConstraints": [],
"memory": "512",
"taskRoleArn": "ROLE_ARN",
"compatibilities": [
"EC2",
"FARGATE"
],
"taskDefinitionArn": "TASK_DEFINITION_ARN",
"family": "drone-server",
"requiresAttributes": [
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.execution-role-awslogs"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.task-iam-role"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.container-ordering"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.secrets.ssm.environment-variables"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.task-eni"
}
],
"pidMode": null,
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256",
"revision": 14,
"status": "ACTIVE",
"proxyConfiguration": null,
"volumes": []
}```
它一直在跟我说这个网络是没有定义的。错误:Service使用了未定义的网络但是,我看到docker network ls存在这样的网络。我错过了什么:(我需要你的帮助。我在谷歌上读了很多关于它的文章,但是找不到正确的解决方法。
网络服务提供弹性公网IP、NAT网关、DNS解析等功能。 弹性公网IP 弹性公网IP(Elastic IP)是一种NAT IP,通过与虚拟机绑定,将弹性公网IP与虚拟机的私有地址进行NAT映射,实现虚拟机与公网之间的通信。 NAT网关 NAT网关能够为公有云VPC网络中虚拟机提供IP地址转换功能,使虚拟机可以访问外网或提供互联网服务。 DNS解析 DNS解析用于将简单好记的域名解析为计算机用于通信
我一直试图让spark在我的本地机器上运行kubernetes。然而,我在试图理解服务网络是如何工作的方面遇到了一个问题。 我在笔记本电脑上用容器运行kubernetes: null kubectl create-f Kubernetes/examples/spark/spark-master-controller.yaml kubectl create-f Kubernetes/examples
Twisted Twisted 是一个事件驱动的网络引擎。他可以被用来构建多种网络协议的应用程序,包括:HTTP 服务器和客户端;使用 SMTP、POP3、IMAP 或者 SSH 协议测应用程序和 IM (即时消息)等应用 更多。 PyZMQ PyZMQ 是 ZeroMQ 的 Python 绑定。ZeroMQ 是一个高性能的异步消息库,它的一个很大的优势在于其可以被用作一个消息队列而不需要消息代理
主要内容:一、网络的整体架构,二、服务端的流程,三、源码分析,四、总结一、网络的整体架构 在前面介绍Redis的整体流程时,初步介绍过服务端的网络代码,现在先看一下整体的架构: 1、服务处理(EPoll) 如果没有接触过网张编程的,特别是对LINUX上的编程模型一点都不清楚的。这块可能是个麻烦.Redis为了保证在不两同的平台的高效可行的运行,采用了在不同平台自适应使用不同的网络编程模型,这其中包括一些可能比较专用的平台,如Solaries10中的 evport,m
问题内容: 通常,我在端口3000上使用Rails开发服务器。 水豚/黄瓜使用。如果我从默认驱动程序交换到selenium,则看起来它尝试在端口80上进行连接。 我想了解: 使用selenium时,是否需要在测试环境中单独实例化测试服务器。 如果上述问题的答案是肯定的,那么我该如何做才能在Web驱动程序之间无缝切换而不必不断进行更改? 如果有人举了一个env.rb配置示例,可以帮助您,请告诉我!