При запуске Микроинтегратора WSO2 внутри контейнера docker в качестве задачи в AWS я получаю в журналах ошибку об имени хоста? В Dockerfile я специально не устанавливаю имя хоста контейнера. Я создал задачу с помощью инструмента Cloudformation и не получаю эту ошибку при локальном запуске контейнера. Я также пробовал работать на другом VP C, но безрезультатно. Ошибка остается.
FYI: предполагается, что он принимает трафик c на порт 8290 и позволяет ему отправлять исходящие сообщения на любой IP-адрес в мире. В настоящее время у меня есть правила для входящего и исходящего трафика, разрешающие 0.0.0.0/0 для всех протоколов.
Полная ошибка выглядит следующим образом:
в org.eclipse.osgi. internal.framework.BundleContextImpl.registerService (BundleContextImpl. java: 544) на org.wso2.micro.integrator.ntask.core.internal.TasksDSComponent.activate (TasksDSComponent. java: 88) на sun.reflectd.Access invoke0 (собственный метод) в sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl. java: 62) в sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl. java: 43) в *1022*. invoke (Method. java: 498) в org.eclipse.equinox.internal.ds.model.ServiceComponent.activate (ServiceComponent. java: 260) в org.eclipse.equinox.internal.ds.model.ServiceComponentProp. активировать (ServiceComponentProp. java: 146) в org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build (ServiceComponentProp. java: 345) в org.eclipse.equinox.internal.ds.InstanceP rocess.buildComponent (InstanceProcess. java: 620) в org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents (InstanceProcess. java: 197)
На случай, если кому-то интересно: Я установил новый VP C в комплекте со шлюзом inte rnet, маршрутами и таблицами маршрутов. Экземпляр будет запущен, но я никак не могу подключиться к нему.
Для получения задачи и ее доступности запускается следующий сценарий:
{
"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"
}
}
}