SHOW SESSIONSGraph
登录 NebulaGraph 数据库时,会创建对应会话,用户可以查询会话信息。
注意事项Graph
- 执行
exit
退出登录时,客户端会调用 APIrelease
,释放会话并清除会话信息。如果没有正常退出,且没有在配置文件 Graph 设置空闲会话超时时间(session_idle_timeout_secs
),会话不会自动释放。对于未自动释放的会话,需要手动删除指定会话 (TODO: coding)。
SHOW SESSIONS
查询所有 Graph 服务上的会话信息。
SHOW LOCAL SESSIONS
从当前连接的 Graph 服务获取会话信息,不会查询其他 Graph 服务上的会话信息。
SHOW SESSION <Session_Id>
查询指定 Session ID 的会话信息。
语法Graph
SHOW [LOCAL] SESSIONS;
SHOW SESSION <Session_Id>;
示例Graph
nebula> SHOW SESSIONS;
+------------------+----------+--------------------+----------------------------+----------------------------+------------------+----------+--------------------+
| SessionId | UserName | SpaceName | CreateTime | UpdateTime | GraphAddr | Timezone | ClientIp |
+------------------+----------+--------------------+----------------------------+----------------------------+------------------+----------+--------------------+
| 1635128818397714 | "root" | "test" | 2021-10-25T02:26:58.397714 | 2021-10-25T08:31:31.846846 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1635254859271703 | "root" | "basketballplayer" | 2021-10-26T13:27:39.271703 | 2021-10-26T13:51:38.277704 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1634871229727322 | "root" | "basketballplayer" | 2021-10-22T02:53:49.727322 | 2021-10-22T02:53:56.564001 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1635750725840229 | "root" | "basketballplayer" | 2021-11-01T07:12:05.840229 | 2021-11-01T09:42:36.883617 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1635299224732060 | "root" | "basketballplayer" | 2021-10-27T01:47:04.732060 | 2021-10-27T09:04:31.741126 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1634628999765689 | "root" | "" | 2021-10-19T07:36:39.765689 | 2021-10-19T07:36:39.768064 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1634886296595136 | "root" | "basketballplayer" | 2021-10-22T07:04:56.595136 | 2021-10-22T09:48:20.299364 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1634629179882439 | "root" | "basketballplayer" | 2021-10-19T07:39:39.882439 | 2021-10-19T09:34:52.153145 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1635246158961634 | "root" | "basketballplayer" | 2021-10-26T11:02:38.961634 | 2021-10-26T11:02:51.250897 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
| 1634785346839017 | "root" | "basketballplayer" | 2021-10-21T03:02:26.839017 | 2021-10-21T11:07:40.911329 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
+------------------+----------+--------------------+----------------------------+----------------------------+------------------+----------+--------------------+
nebula> SHOW SESSION 1635254859271703;
+--------------+----------------------------+
| VariableName | Value |
+--------------+----------------------------+
| "SessionID" | 1635254859271703 |
| "UserName" | "root" |
| "SpaceName" | "basketballplayer" |
| "CreateTime" | 2021-10-26T13:27:39.271703 |
| "UpdateTime" | 2021-10-26T13:51:38.277704 |
| "GraphAddr" | "127.0.0.1:9669" |
| "Timezone" | 0 |
| "ClientIp" | "::ffff:127.0.0.1" |
+--------------+----------------------------+
参数 | 说明 |
---|---|
SessionId |
会话 ID,唯一标识一个会话。 |
UserName |
会话的登录用户名称。 |
SpaceName |
用户当前所使用的图空间。刚登录时为空("" )。 |
CreateTime |
会话的创建时间,即用户认证登录的时间。时区为配置文件中timezone_name 指定的时区。 |
UpdateTime |
用户有执行操作时,会更新此时间。时区为配置文件中timezone_name 指定的时区。 |
GraphAddr |
会话的 Graph 服务地址和端口。 |
Timezone |
保留参数,暂无意义。 |
ClientIp |
会话的客户端 IP 地址。 |
最后更新: January 14, 2022