Skip to content

Commit

Permalink
show hosts (#1442)
Browse files Browse the repository at this point in the history
* show hosts

The `show hosts` command displays the version

* Update 6.show-hosts.md
  • Loading branch information
cooper-lzy authored Feb 8, 2022
1 parent 92f6614 commit 3682202
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 100 deletions.
30 changes: 14 additions & 16 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,13 @@ Storage 服务加入集群后,可以执行命令`SHOW HOSTS`查看机器状态

```ngql
nebula> SHOW HOSTS;
+------------------+------+----------+--------------+----------------------+------------------------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+------------------+------+----------+--------------+----------------------+------------------------+
| "192.168.10.100" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "192.168.10.101" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "192.168.10.102" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "Total" | | | 0 | | |
+------------------+------+----------+--------------+----------------------+------------------------+
+------------------+------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------------------+------+----------+--------------+----------------------+------------------------+---------+
| "192.168.10.100" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "192.168.10.101" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "192.168.10.102" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
+------------------+------+----------+--------------+----------------------+------------------------+---------+
```

在返回结果中,查看 **Status** 列,可以看到所有 Storage 服务都在线。
Expand Down Expand Up @@ -139,14 +138,13 @@ nebula> SHOW HOSTS;

```ngql
nebula> SHOW HOSTS;
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
| "storaged0" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
| "storaged1" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
| "storaged2" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
| "Total" | | | 15 | "basketballplayer:15" | "basketballplayer:15" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.0.0" |
| "storaged1" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.0.0" |
| "storaged2" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.0.0" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
```

如果** Leader distribution **分布不均匀,请执行命令`BALANCE LEADER`重新分配。更多信息,请参见 [Storage 负载均衡](../8.service-tuning/load-balance.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,38 @@ SHOW HOSTS [GRAPH | STORAGE | META];

```ngql
nebula> SHOW HOSTS;
+-------------+-------+----------+--------------+----------------------------------+------------------------------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+-------------+-------+----------+--------------+----------------------------------+------------------------------+
| "storaged0" | 9779 | "ONLINE" | 8 | "docs:5, basketballplayer:3" | "docs:5, basketballplayer:3" |
| "storaged1" | 9779 | "ONLINE" | 9 | "basketballplayer:4, docs:5" | "docs:5, basketballplayer:4" |
| "storaged2" | 9779 | "ONLINE" | 8 | "basketballplayer:3, docs:5" | "docs:5, basketballplayer:3" |
+-------------+-------+----------+--------------+----------------------------------+------------------------------+
+-------------+-------+----------+--------------+----------------------------------+------------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+-------+----------+--------------+----------------------------------+------------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 8 | "docs:5, basketballplayer:3" | "docs:5, basketballplayer:3" | "3.0.0" |
| "storaged1" | 9779 | "ONLINE" | 9 | "basketballplayer:4, docs:5" | "docs:5, basketballplayer:4" | "3.0.0" |
| "storaged2" | 9779 | "ONLINE" | 8 | "basketballplayer:3, docs:5" | "docs:5, basketballplayer:3" | "3.0.0" |
+-------------+-------+----------+--------------+----------------------------------+------------------------------+---------+
nebula> SHOW HOSTS GRAPH;
+-----------+------+----------+---------+---------------+--------+
+-----------+------+----------+---------+--------------+---------+
| Host | Port | Status | Role | Git Info Sha | Version |
+-----------+------+----------+---------+--------------+---------+
| "graphd" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "2.6.0" |
| "graphd1" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "2.6.0" |
| "graphd2" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "2.6.0" |
| "graphd" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.0.0" |
| "graphd1" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.0.0" |
| "graphd2" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.0.0" |
+-----------+------+----------+---------+--------------+---------+
nebula> SHOW HOSTS STORAGE;
+-------------+------+----------+-----------+--------------+---------+
| Host | Port | Status | Role | Git Info Sha | Version |
+-------------+------+----------+-----------+--------------+---------+
| "storaged0" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "2.6.0" |
| "storaged1" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "2.6.0" |
| "storaged2" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "2.6.0" |
| "storaged0" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.0.0" |
| "storaged1" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.0.0" |
| "storaged2" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.0.0" |
+-------------+------+----------+-----------+--------------+---------+
nebula> SHOW HOSTS META;
+----------+------+----------+--------+--------------+---------+
| Host | Port | Status | Role | Git Info Sha | Version |
+----------+------+----------+--------+--------------+---------+
| "metad2" | 9559 | "ONLINE" | "META" | "3ba41bd" | "2.6.0" |
| "metad0" | 9559 | "ONLINE" | "META" | "3ba41bd" | "2.6.0" |
| "metad1" | 9559 | "ONLINE" | "META" | "3ba41bd" | "2.6.0" |
| "metad2" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.0.0" |
| "metad0" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.0.0" |
| "metad1" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.0.0" |
+----------+------+----------+--------+--------------+---------+
```
30 changes: 14 additions & 16 deletions docs-2.0/3.ngql-guide/9.space-statements/1.create-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,25 @@ nebula> SHOW CREATE SPACE my_space_4;

```ngql
nebula> SHOW HOSTS;
+-------------+------+----------+--------------+--------------------------------+--------------------------------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+
| "storaged0" | 9779 | "ONLINE" | 8 | "basketballplayer:3, test:5" | "basketballplayer:10, test:10" |
| "storaged1" | 9779 | "ONLINE" | 9 | "basketballplayer:4, test:5" | "basketballplayer:10, test:10" |
| "storaged2" | 9779 | "ONLINE" | 3 | "basketballplayer:3" | "basketballplayer:10, test:10" |
| "Total" | | | 20 | "basketballplayer:10, test:10" | "basketballplayer:30, test:30" |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 8 | "basketballplayer:3, test:5" | "basketballplayer:10, test:10" | "3.0.0" |
| "storaged1" | 9779 | "ONLINE" | 9 | "basketballplayer:4, test:5" | "basketballplayer:10, test:10" | "3.0.0" |
| "storaged2" | 9779 | "ONLINE" | 3 | "basketballplayer:3" | "basketballplayer:10, test:10" | "3.0.0" |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
```

如果需要均衡负载,请执行如下命令:

```ngql
nebula> BALANCE LEADER;
nebula> SHOW HOSTS;
+-------------+------+----------+--------------+--------------------------------+--------------------------------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+
| "storaged0" | 9779 | "ONLINE" | 7 | "basketballplayer:3, test:4" | "basketballplayer:10, test:10" |
| "storaged1" | 9779 | "ONLINE" | 7 | "basketballplayer:4, test:3" | "basketballplayer:10, test:10" |
| "storaged2" | 9779 | "ONLINE" | 6 | "basketballplayer:3, test:3" | "basketballplayer:10, test:10" |
| "Total" | | | 20 | "basketballplayer:10, test:10" | "basketballplayer:30, test:30" |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 7 | "basketballplayer:3, test:4" | "basketballplayer:10, test:10" | "3.0.0" |
| "storaged1" | 9779 | "ONLINE" | 7 | "basketballplayer:4, test:3" | "basketballplayer:10, test:10" | "3.0.0" |
| "storaged2" | 9779 | "ONLINE" | 6 | "basketballplayer:3, test:3" | "basketballplayer:10, test:10" | "3.0.0" |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,13 @@

```bash
nebula> SHOW HOSTS;
+-------------+------+----------+--------------+----------------------+------------------------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+-------------+------+----------+--------------+----------------------+------------------------+
| "storaged0" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "storaged1" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "storaged2" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "Total" | | | 0 | | |
+-------------+------+----------+--------------+----------------------+------------------------+
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "storaged1" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "storaged2" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
```

5. 执行两次`exit` 可以退出容器。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,13 @@ $ ./nebula-console --addr 192.168.10.111 --port 9669 -u root -p nebula
Welcome to Nebula Graph!
> SHOW HOSTS;
+------------------+------+----------+--------------+----------------------+------------------------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+------------------+------+----------+--------------+----------------------+------------------------+
| "192.168.10.111" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "192.168.10.112" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "192.168.10.113" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "192.168.10.114" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "192.168.10.115" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "Total" | | | 0 | | |
+------------------+------+----------+--------------+----------------------+------------------------+
+------------------+------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------------------+------+----------+--------------+----------------------+------------------------+---------+
| "192.168.10.111" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "192.168.10.112" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "192.168.10.113" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "192.168.10.114" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
| "192.168.10.115" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.0.0" |
+------------------+------+----------+--------------+----------------------+------------------------+---------+
```
Loading

0 comments on commit 3682202

Please sign in to comment.