Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add http port for show hosts #1145

Merged
merged 3 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ We recommend that you check the machine status to make sure that all the Storage

```ngql
nebula> SHOW HOSTS;
+------------------+------+----------+--------------+----------------------+------------------------+---------+
| 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" |
+------------------+------+----------+--------------+----------------------+------------------------+---------+
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| "192.168.10.100" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.101" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.102" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
```

From the **Status** column of the table in the returned results, you can see that all the Storage services are online.
Expand Down Expand Up @@ -134,13 +134,13 @@ From the **Status** column of the table in the returned results, you can see tha

```ngql
nebula> SHOW HOSTS;
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
| 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" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
+-------------+-----------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+-----------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
| "storaged0" | 9779 | 19669 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.1.0" |
| "storaged1" | 9779 | 19669 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.1.0" |
| "storaged2" | 9779 | 19669 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" | "3.1.0" |
+-------------+-----------+-----------+-----------+--------------+----------------------------------+------------------------+---------+
```

If the **Leader distribution** is uneven, use `BALANCE LEADER` to redistribute the partitions. For more information, see [BALANCE](../8.service-tuning/load-balance.md).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SHOW HOSTS

The `SHOW HOSTS` statement shows the host and version information of Graph Service, Storage Service, and Meta Service.
The `SHOW HOSTS` statement shows the cluster information, including port, status, leader, partition, and version information, or specify to shows the host information of Graph, Storage, or Meta service.
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved

## Syntax

Expand All @@ -17,38 +17,38 @@ SHOW HOSTS [GRAPH | STORAGE | META];

```ngql
nebula> SHOW HOSTS;
+-------------+-------+----------+--------------+----------------------------------+------------------------------+---------+
| 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" |
+-------------+-------+----------+--------------+----------------------------------+------------------------------+---------+
+-------------+-------+-----------+----------+--------------+----------------------------------+------------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+-------+-----------+----------+--------------+----------------------------------+------------------------------+---------+
| "storaged0" | 9779 | 19669 | "ONLINE" | 8 | "docs:5, basketballplayer:3" | "docs:5, basketballplayer:3" | "3.1.0" |
| "storaged1" | 9779 | 19669 | "ONLINE" | 9 | "basketballplayer:4, docs:5" | "docs:5, basketballplayer:4" | "3.1.0" |
| "storaged2" | 9779 | 19669 | "ONLINE" | 8 | "basketballplayer:3, docs:5" | "docs:5, basketballplayer:3" | "3.1.0" |
+-------------+-------+-----------+----------+--------------+----------------------------------+------------------------------+---------+

nebula> SHOW HOSTS GRAPH;
+-----------+------+----------+---------+--------------+---------+
| Host | Port | Status | Role | Git Info Sha | Version |
+-----------+------+----------+---------+--------------+---------+
| "graphd" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.0.0" |
| "graphd1" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.0.0" |
| "graphd2" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.0.0" |
| "graphd" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.1.0" |
| "graphd1" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.1.0" |
| "graphd2" | 9669 | "ONLINE" | "GRAPH" | "3ba41bd" | "3.1.0" |
+-----------+------+----------+---------+--------------+---------+

nebula> SHOW HOSTS STORAGE;
+-------------+------+----------+-----------+--------------+---------+
| Host | Port | Status | Role | Git Info Sha | Version |
+-------------+------+----------+-----------+--------------+---------+
| "storaged0" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.0.0" |
| "storaged1" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.0.0" |
| "storaged2" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.0.0" |
| "storaged0" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.1.0" |
| "storaged1" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.1.0" |
| "storaged2" | 9779 | "ONLINE" | "STORAGE" | "3ba41bd" | "3.1.0" |
+-------------+------+----------+-----------+--------------+---------+

nebula> SHOW HOSTS META;
+----------+------+----------+--------+--------------+---------+
| Host | Port | Status | Role | Git Info Sha | Version |
+----------+------+----------+--------+--------------+---------+
| "metad2" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.0.0" |
| "metad0" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.0.0" |
| "metad1" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.0.0" |
| "metad2" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.1.0" |
| "metad0" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.1.0" |
| "metad1" | 9559 | "ONLINE" | "META" | "3ba41bd" | "3.1.0" |
+----------+------+----------+--------+--------------+---------+
```
28 changes: 14 additions & 14 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 @@ -90,25 +90,25 @@ On some large clusters, the partition distribution is possibly unbalanced becaus

```ngql
nebula> SHOW HOSTS;
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
| 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" |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
+-------------+------+-----------+----------+--------------+--------------------------------+--------------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+------+-----------+----------+--------------+--------------------------------+--------------------------------+---------+
| "storaged0" | 9779 | 19669 | "ONLINE" | 8 | "basketballplayer:3, test:5" | "basketballplayer:10, test:10" | "3.1.0" |
| "storaged1" | 9779 | 19669 | "ONLINE" | 9 | "basketballplayer:4, test:5" | "basketballplayer:10, test:10" | "3.1.0" |
| "storaged2" | 9779 | 19669 | "ONLINE" | 3 | "basketballplayer:3" | "basketballplayer:10, test:10" | "3.1.0" |
+-------------+------+-----------+----------+--------------+--------------------------------+--------------------------------+---------+
```

To balance the request loads, use the following command.

```ngql
nebula> BALANCE LEADER;
nebula> SHOW HOSTS;
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
| 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" |
+-------------+------+----------+--------------+--------------------------------+--------------------------------+---------+
+-------------+------+-----------+----------+--------------+--------------------------------+--------------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+------+-----------+----------+--------------+--------------------------------+--------------------------------+---------+
| "storaged0" | 9779 | 19669 | "ONLINE" | 7 | "basketballplayer:3, test:4" | "basketballplayer:10, test:10" | "3.1.0" |
| "storaged1" | 9779 | 19669 | "ONLINE" | 7 | "basketballplayer:4, test:3" | "basketballplayer:10, test:10" | "3.1.0" |
| "storaged2" | 9779 | 19669 | "ONLINE" | 6 | "basketballplayer:3, test:3" | "basketballplayer:10, test:10" | "3.1.0" |
+-------------+------+-----------+----------+--------------+--------------------------------+--------------------------------+---------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ Using Docker Compose can quickly deploy Nebula Graph services based on the prepa
nebula> ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779;

nebula> SHOW HOSTS;
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| 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" |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| "storaged0" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "storaged1" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "storaged2" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
```

!!! Note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +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 | 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" |
+------------------+------+----------+--------------+----------------------+------------------------+---------+
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| "192.168.10.111" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.112" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.113" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.114" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
| "192.168.10.115" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
+------------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
```
Loading