Nebula:Installation:修订间差异
第25行: | 第25行: | ||
</pre> | </pre> | ||
== Create space == | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
(root@nebula) [(none)]> SHOW HOSTS; | (root@nebula) [(none)]> SHOW HOSTS; | ||
第63行: | 第63行: | ||
+-------------+------+----------+--------------+----------------------+------------------------+---------+ | +-------------+------+----------+--------------+----------------------+------------------------+---------+ | ||
Got 3 rows (time spent 2.566ms/3.501ms) | Got 3 rows (time spent 2.566ms/3.501ms) | ||
</syntaxhighlight> | |||
== Create tags== | |||
<syntaxhighlight lang="bash"> | |||
CREATE TAG player(name string, age int); | |||
CREATE TAG team(name string); | |||
CREATE EDGE follow(degree int); | |||
CREATE EDGE serve(start_year int, end_year int); | |||
show tags; | |||
+----------+ | |||
| Name | | |||
+----------+ | |||
| "player" | | |||
| "team" | | |||
+----------+ | |||
Got 2 rows (time spent 7.586ms/12.390458ms) | |||
Fri, 13 Oct 2023 02:59:50 UTC | |||
(root@nebula) [basketballplayer]> show edges; | |||
+----------+ | |||
| Name | | |||
+----------+ | |||
| "follow" | | |||
| "serve" | | |||
+----------+ | |||
Got 2 rows (time spent 2.871ms/4.843209ms) | |||
</syntaxhighlight> | |||
== Insert Data== | |||
<syntaxhighlight lang="bash"> | |||
</syntaxhighlight> | |||
== Query == | |||
<syntaxhighlight lang="bash"> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Database]] | [[Category:Database]] | ||
[[Category:Nebula]] | [[Category:Nebula]] |
2023年10月13日 (五) 03:00的版本
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)]>
Create space
(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)
Create tags
CREATE TAG player(name string, age int);
CREATE TAG team(name string);
CREATE EDGE follow(degree int);
CREATE EDGE serve(start_year int, end_year int);
show tags;
+----------+
| Name |
+----------+
| "player" |
| "team" |
+----------+
Got 2 rows (time spent 7.586ms/12.390458ms)
Fri, 13 Oct 2023 02:59:50 UTC
(root@nebula) [basketballplayer]> show edges;
+----------+
| Name |
+----------+
| "follow" |
| "serve" |
+----------+
Got 2 rows (time spent 2.871ms/4.843209ms)