2016-04-23 23 views
0

我正在使用Elastic-Beanstalk将我的Web服务器部署到多个实例。 我配置了一个端点/version,我希望服务器告诉我它运行的是哪个版本,并希望从我处理哪个实例(以验证LB如预期的那样工作)。确定为您服务的AWS实例

我想是这样工作的:

app.get('/version', function (req, res) { 
    var instance = getInstanceInfo(); 
    res.end(instance + 'v0.0.2'); 
}); 

将如何getInstanceInfo()样子?

感谢

+0

的[从内部找出实例ID可能的复制一个ec2机器](http://stackoverflow.com/questions/625644/find-out-the-instance-id-from-within-an-ec2-machine) –

回答

相关问题