Nodejs微服务在击中其他微服务时超时

问题描述 投票:0回答:1

我在ec2实例上托管微服务。当我们在开发环境中运行它时,一切正常。但是当我在https(prod)环境中运行它时。其中一项服务无法获得以下错误的其他服务:

0|auth_mgr | error: Error Authenticating User:  Error: connect ETIMEDOUT 52.7.165.49:3001
0|auth_mgr |     at Object._errnoException (util.js:1003:13)
0|auth_mgr |     at _exceptionWithHostPort (util.js:1024:20)
0|auth_mgr |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1195:14)

当我从本地机器上击中邮差时,它可以工作:

var userURL   = configuration.url.user + '/pool/' + userName;
    request({
        url: userURL,
        method: "GET",
        json: true,
        headers: {
            "content-type": "application/json",
        }
    }, function (error, response, body) {
        if (!error && response.statusCode === 200) {
            callback(null, body);
        }
    else {
        if (!error) {
            var lookupError = new Error("Failed looking up user pool: " + response.body.Error);
            callback(lookupError, response);
        }
        else {
            callback(error, response)
        }
    }
});

网址,例如。 https://abc.xyz.com:3001/user/pool/[email protected]

javascript node.js amazon-web-services amazon-ec2
1个回答
0
投票

现在我添加了安全组来打开“任何地方”的端口。这件事对我有用。

© www.soinside.com 2019 - 2024. All rights reserved.