Nebula:Installation:修订间差异

来自WHY42
Riguz留言 | 贡献
Riguz留言 | 贡献
第25行: 第25行:
</pre>
</pre>


<syntaxhighlight lang="bash">
(root@nebula) [(none)]> SHOW HOSTS;
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| Host        | Port | Status  | Leader count | Leader distribution  | Partition distribution | Version |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"  | "3.6.0" |
| "storaged1" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"  | "3.6.0" |
| "storaged2" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"  | "3.6.0" |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
Got 3 rows (time spent 6.392ms/10.383292ms)
(root@nebula) [(none)]> CREATE SPACE basketballplayer(partition_num=15, replica_factor=1, vid_type=fixed_string(30));
Execution succeeded (time spent 11.969ms/12.891291ms)
Fri, 13 Oct 2023 02:53:56 UTC
(root@nebula) [(none)]> SHOW SPACES;
+--------------------+
| Name              |
+--------------------+
| "basketballplayer" |
+--------------------+
Got 1 rows (time spent 3.14ms/5.527791ms)
(root@nebula) [(none)]> USE basketballplayer;
Execution succeeded (time spent 4.402ms/5.538625ms)
Fri, 13 Oct 2023 02:54:56 UTC
(root@nebula) [basketballplayer]> SHOW HOSTS;
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| Host        | Port | Status  | Leader count | Leader distribution  | Partition distribution | Version |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 5            | "basketballplayer:5" | "basketballplayer:5"  | "3.6.0" |
| "storaged1" | 9779 | "ONLINE" | 5            | "basketballplayer:5" | "basketballplayer:5"  | "3.6.0" |
| "storaged2" | 9779 | "ONLINE" | 5            | "basketballplayer:5" | "basketballplayer:5"  | "3.6.0" |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
Got 3 rows (time spent 2.566ms/3.501ms)
</syntaxhighlight>
[[Category:Database]]
[[Category:Database]]
[[Category:Nebula]]
[[Category:Nebula]]

2023年10月13日 (五) 02:56的版本

Installation

git clone -b release-3.6 https://github.com/vesoft-inc/nebula-docker-compose.git
cd nebula-docker-compose
docker-compose up -d

Get Started

Connect

docker ps | grep console
docker exec -it c1b6410dba24 sh

nebula-console -u root -p password --address=graphd --port=9669
/ # nebula-console -u root -p password --address=graphd --port=9669

Welcome!

(root@nebula) [(none)]>


(root@nebula) [(none)]> SHOW HOSTS;
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| Host        | Port | Status   | Leader count | Leader distribution  | Partition distribution | Version |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"   | "3.6.0" |
| "storaged1" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"   | "3.6.0" |
| "storaged2" | 9779 | "ONLINE" | 0            | "No valid partition" | "No valid partition"   | "3.6.0" |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
Got 3 rows (time spent 6.392ms/10.383292ms)
(root@nebula) [(none)]> CREATE SPACE basketballplayer(partition_num=15, replica_factor=1, vid_type=fixed_string(30));
Execution succeeded (time spent 11.969ms/12.891291ms)

Fri, 13 Oct 2023 02:53:56 UTC

(root@nebula) [(none)]> SHOW SPACES;
+--------------------+
| Name               |
+--------------------+
| "basketballplayer" |
+--------------------+
Got 1 rows (time spent 3.14ms/5.527791ms)

(root@nebula) [(none)]> USE basketballplayer;
Execution succeeded (time spent 4.402ms/5.538625ms)

Fri, 13 Oct 2023 02:54:56 UTC

(root@nebula) [basketballplayer]> SHOW HOSTS;
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| Host        | Port | Status   | Leader count | Leader distribution  | Partition distribution | Version |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
| "storaged0" | 9779 | "ONLINE" | 5            | "basketballplayer:5" | "basketballplayer:5"   | "3.6.0" |
| "storaged1" | 9779 | "ONLINE" | 5            | "basketballplayer:5" | "basketballplayer:5"   | "3.6.0" |
| "storaged2" | 9779 | "ONLINE" | 5            | "basketballplayer:5" | "basketballplayer:5"   | "3.6.0" |
+-------------+------+----------+--------------+----------------------+------------------------+---------+
Got 3 rows (time spent 2.566ms/3.501ms)