AWS ELB的背后:如何从"netstat"中获取真实IP? [英] Behind AWS ELB : How to grab the Real IP from "netstat"?

查看:354
本文介绍了AWS ELB的背后:如何从"netstat"中获取真实IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在2个Linux Web服务器前面使用 AWS弹性负载平衡 (ELB).但是(根据我的要求)我需要从Web服务器的角度了解真实IP,尤其是当我使用netstat时.

I'm using AWS Elastic Load Balancing (ELB) in front of 2 Linux Web Servers. But (based on my requirement) i need to know the Real IPs from the Web Servers' perspective, especially when i use netstat.

我需要实时了解每个IP(来自NETSTAT)的传入连接数.因此,基本上在Linux (前面没有ELB)中,netstat命令下面的命令可以正常工作:

I need to know the number of incoming connections from each IPs (from NETSTAT), as in real time. So basically in Linux (without ELB in front), below netstat command perfectly works:

netstat -tn 2>/dev/null | grep :80

但是现在我只能看到ELB的内部IP ;这使整个事情变得非常困难.

But now i can only see the internal IP(s) of the ELB; which is making the whole thing quite difficult.

请问对此有什么解决方案?谢谢.

What is the solution for this please? Thanks.

推荐答案

您可以从ELB访问日志中获取客户端源IP,并使用

You could get the client source IP from ELB Access Logs and use EMR with Hive to count the number of times a client request came in from the same IP.

这篇关于AWS ELB的背后:如何从"netstat"中获取真实IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆