cannot connect from app container to db container on ECS

1

I use Service Connect to connect Laravel app container to db container on ECS. When I ecs exec to app container and run php artisan migrate, nothing happens (no output). In addition, now I use database (mysql) as laravel cache, queue and session drivers but originally use redis. With redis configured as the drivers and run php artisan migrate I got the error like

protocol error, got 'H' as reply type byte

Note both redis and mysql works properly in local docker-compose env. I want to know the solution or trouble shooting method to this problem. Any trivial advice is welcome.

Related part of cloudformation is the following. App server service

ServiceConnectConfiguration:
        Enabled: true
        Namespace: !Ref ClusterName
        Services:
          - PortName: app-server
            DiscoveryName: app-server
            ClientAliases:
              - DnsName: app
                Port: 9000
        LogConfiguration:
          LogDriver: "awslogs"
          Options:
            awslogs-group: !Ref ECSLogGroup
            awslogs-region: !Ref AWS::Region
            awslogs-stream-prefix: app-server-service

DB server service

ServiceConnectConfiguration:
        Enabled: true
        Namespace: !Ref ClusterName
        Services:
          - PortName: db-server
            DiscoveryName: db-server
            ClientAliases:
              - DnsName: db
                Port: 3306
        LogConfiguration:
          LogDriver: "awslogs"
          Options:
            awslogs-group: !Ref ECSLogGroup
            awslogs-region: !Ref AWS::Region
            awslogs-stream-prefix: db-server-service

Due to word limit, I cannot post everything here but I will try to provide necessary info as much as I can. Related stackoverflow post Thanks,

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠