gpt4 book ai didi

amazon-web-services - 云中的微积分器主机名问题

转载 作者:行者123 更新时间:2023-12-02 20:57:50 25 4
gpt4 key购买 nike

当在 docker 容器中运行 WSO2 Micro-integrator 作为 AWS 中的任务时,我在日志中收到有关主机名的错误?在 Dockerfile 中,我没有以任何方式专门设置容器的主机名。我使用 Cloudformation 工具创建了任务,并且在本地运行容器时没有收到此错误。我也尝试在不同的 VPC 上运行,但没有任何结果。错误仍然存​​在。

仅供引用:它应该接受端口 8290 上的流量,并允许它向外发送到世界上的任何 IP。目前,我将入站和出站规则设置为允许在 0.0.0.0/0 上使用所有协议(protocol)。

完整的错误如下:

at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:544) at org.wso2.micro.integrator.ntask.core.internal.TasksDSComponent.activate(TasksDSComponent.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)



如果有人想知道:
我已经设置了一个新的 VPC,包括互联网网关、路由和路由表。该实例将运行,但我无法以任何方式连接到它。

运行以下脚本以获取任务并使其可用:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"myVPC": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "10.0.1.0/16",
"Tags": [
{"Key":"Name", "Value":"myVPC"
}
]
},
},
"myInternetGateway" : {
"Type" : "AWS::EC2::InternetGateway",
"Properties" : {
}
},
"myRouteTable": {
"Type" : "AWS::EC2::RouteTable",
"Properties" : {
"VpcId" : {
"Ref": "myVPC"
}
}
},
"mySubPublic": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"AvailabilityZone": "eu-central-1a",
"CidrBlock": "10.0.1.0/28",
"MapPublicIpOnLaunch": true,
"VpcId": {
"Ref": "myVPC"
}
},
"DependsOn": "myInternetGateway"
},
"mySubnetRoutetable": {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"RouteTableId" : {
"Ref": "myRouteTable"
},
"SubnetId" : {
"Ref": "mySubPublic"
}
}
},
"myVPCGatewayAttachment": {
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"InternetGatewayId" : {
"Ref": "myInternetGateway"
},
"VpcId" : {
"Ref": "myVPC"
}
}
},
"myRoute": {
"Type" : "AWS::EC2::Route",
"Properties" : {
"GatewayId" : {
"Ref": "myInternetGateway"
},
"DestinationCidrBlock": "0.0.0.0/0",
"RouteTableId" : {
"Ref": "myRouteTable"
}
}
},
"mySecGroup": {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "my security group for all incoming and outgoing.",
"GroupName" : "mySecGroup",
"SecurityGroupEgress" : [ {
"CidrIp" : "0.0.0.0/0",
"Description" : "Allow machine to reach internet.",
"FromPort" : -1,
"IpProtocol" : -1,
"ToPort" : -1
} ],
"SecurityGroupIngress" : [ {
"CidrIp" : "0.0.0.0/0",
"Description" : "Allow machine to be reached from the entire internet.",
"FromPort" : -1,
"IpProtocol" : -1,
"ToPort" : -1
} ],
"VpcId" : {"Ref": "myVPC"}
},
"DependsOn": "myVPC"
},
"myCluster": {
"Type": "AWS::ECS::Cluster",
"Properties": {
"ClusterName": "myCluster"
},
"DependsOn": [
"myVPC"
]
},
"myLogs": {
"Type" : "AWS::Logs::LogGroup",
"Properties" : {
"LogGroupName" : "myLogGroup",
"RetentionInDays" : 7
}
},
"myDockerTask": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
"ContainerDefinitions": [
{
"Cpu": 1024,
"Image": "<NRHERE>.dkr.ecr.eu-central-1.amazonaws.com/my",
"Memory": 2048,
"MemoryReservation": 2048,
"Name": "myESBContainer",
"LogConfiguration": {
"LogDriver": "awslogs",
"Options": {
"awslogs-group": {"Ref": "myLogs"},
"awslogs-region": "eu-central-1",
"awslogs-stream-prefix": "my"
}
}
}
],
"Cpu": "1024",
"ExecutionRoleArn": "arn:aws:iam::<NRHERE>:role/ecsTaskExecutionRole",
"Family": "myESB",
"Memory": "2048",
"NetworkMode": "awsvpc",
"RequiresCompatibilities": [
"FARGATE",
"EC2"
],
"TaskRoleArn": "arn:aws:iam::<NRHERE>:role/ecsTaskExecutionRole"
},
},
"myService": {
"Type" : "AWS::ECS::Service",
"Properties" : {
"Cluster" : {"Fn::GetAtt": ["myCluster", "Arn"]},
"DesiredCount" : 1,
"DeploymentController": {"Type": "ECS"},

"LaunchType" : "FARGATE",
"NetworkConfiguration" : {
"AwsvpcConfiguration" : {
"AssignPublicIp" : "ENABLED",
"SecurityGroups" : [ {"Fn::GetAtt": ["mySecGroup", "GroupId"]} ],
"Subnets" : [ {"Ref": "mySubPublic"}]
}
},
"SchedulingStrategy" : "REPLICA",
"ServiceName" : "myService",
"TaskDefinition": {"Ref": "myDockerTask"}
},
"DependsOn": "mySubPublic"
},
"myDeadLetterQueue": {
"Type" : "AWS::SQS::Queue",
"Properties" : {
"QueueName" : "myDeadLetterQueue"
}
},
"myQueue": {
"Type" : "AWS::SQS::Queue",
"Properties" : {
"QueueName" : "myQueue",
"RedrivePolicy": {
"deadLetterTargetArn" : {"Fn::GetAtt": ["myDeadLetterQueue", "Arn"]},
"maxReceiveCount" : 2
}
},
"DependsOn": "myDeadLetterQueue"
}
}
}

最佳答案

最终发现了问题。该软件无法识别自己,因为它使用 localhost 而不是 127.0.0.1 进行本地环回。
由于我无法控制该软件,因此我尝试将以下内容添加到 VPC:

"EnableDnsSupport": true,
"EnableDnsHostnames": true,

这有效,任务现在能够解析它自己的主机名,不再崩溃。

关于amazon-web-services - 云中的微积分器主机名问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62017131/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com