如何查询Gemfire客户端连接的数量?

时间:2015-08-06 18:18:34

标签: gemfire

我试图在任何给定时间查找有多少客户端连接到Gemfire服务器。我在documentation中找到currentClientConnections,但不清楚如何阅读此数据。我尝试运行VMWare VSD,但它在Windows下启动时崩溃。

有关如何访问此数据的任何想法?

3 个答案:

答案 0 :(得分:0)

您可以使用GemFire Shell show metrics中的gfsh命令获取currentClientConnections,如下所示:

gfsh>show metrics --member=serv1 --port=40404

您可以在输出的缓存服务器部分中看到currentClientConnections:

<snip>
cache-server  | clientConnectionCount            | 0
              | hostnameForClients               |
              | getRequestAvgLatency             | 0
              | putRequestAvgLatency             | 0
              | totalConnectionsTimedOut         | 0
<snip>

gfsh可以找到有关$("#textarea").val('');的更多信息。

答案 1 :(得分:0)

您还可以使用JConsole或其他JMX客户端通过JMX访问此信息。如果直接连接到服务器节点,则可以访问该服务器的GemFire MBean。如果您连接到GemFire JMX Manager节点(默认情况下为Locator),那么您将看到每个服务器节点的DistributedMXBean以及MemberMXBeans和CacheServerMXBeans。

+GemFire
    +Distributed [1]
        +System --> DistributedSystemMXBean [2]
            ...getNumClients() [3]
    +Member [4]
        +member1 --> MemberMXBean [5]
        +member2 --> MemberMXBean [5]
        +CacheServer
            +2090
                +member1 --> CacheServerMXBean [6]
                    ..getClientConnectionCount() [7]
            +2091
                +member2 --> CacheServerMXBean [6]
                    ..getClientConnectionCount() [7]

[1] these MBeans are viewable only in the JMX Manager (Locator by default)
[2] ObjectName is GemFire:service=System,type=Distributed
[3] returns the total number of client connections across the entire cluster 
(number of client connections, not the number of unique clients)
[4] these MBeans are viewable in each server node as well as federated in the JMX Manager (Locator by default)
[5] ObjectName is GemFire:type=Member,member={0}
[6] ObjectName is GemFire:service=CacheServer,port={0},type=Member,member={1}
[7] returns the number of client connections for this server

答案 2 :(得分:0)

以下命令行对我有用:

</html>

意思是,它列出了所有统计信息,只打印watch -n1 "gemfire stats -archive=logs/server/stats/gemfire_stats.gfs | grep -i currentClientConnections"的值,并且每秒重复一次。