Memcached collect client ip address

在 ElastiCache Memcached 中如何去取得 client ip address?

Jerry’s Notes
What’s next?
2 min readMay 18, 2022

--

因為使用者無法直接登入 ElastiCache Memcached 節點中,直接使用 netstat 命令,來分析該節點實例連線的狀況。

但您可以透過連進特定節點 memcachd 服務後,使用 “stats conns” 命令來取得相關資訊。

https://github.com/memcached/memcached/blob/master/doc/protocol.txt

Connection statistics
— — — — — — — — — — -
The “stats” command with the argument of “conns” returns information
about currently active connections and about sockets that are listening
for new connections. The data is returned in the format:

補充資訊 (For Redis):

在 Redis 上面,可以使用命令 “client list” 來取得當下,有那些前端連線有連接到該節點,用於判斷是那一前端連接在操作那一些命令。以下是範例.

https://redis.io/commands/client-list

另外,您也可以透過 “info client” 命令,來取得相關 client 端連線的資訊。以下是範例,提供您參考。

--

--

Jerry’s Notes
What’s next?

An cloud support engineer focus on troubleshooting with customer reported issue ,and cloud solution architecture.