From 1946ed5ed75d2cbeaf3875416bdd09ed30776884 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:38:01 +0800 Subject: [PATCH 01/13] add systemd --- docs-2.0/reuse/source_manage-service.md | 84 +++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 5 deletions(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index a98c9e8609d..2391292f3a5 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -1,14 +1,24 @@ -You can use the `nebula.service` script to start, stop, restart, terminate, and check the Nebula Graph services. This topic takes starting, stopping and checking the Nebula Graph services for examples. +Nebula Graph supports managing services with script or systemd. This topic will describe the two methods in detail. -`nebula.service` is stored in the `/usr/local/nebula/scripts` directory by default, which is also the default installation path of Nebula Graph. If you have customized the path, use the actual path in your environment. +!!! note -## Syntax + The two methods are incompatible. It is recommended to use only one method at a cluster. + +## Manage services with script + +You can use the `nebula.service` script to manage services, including start, stop, restart, terminate, and check the Nebula Graph services. + +!!! note + + `nebula.service` is stored in the `/usr/local/nebula/scripts` directory by default, which is also the default installation path of Nebula Graph. If you have customized the path, use the actual path in your environment. + +### Syntax ```bash $ sudo /usr/local/nebula/scripts/nebula.service [-v] [-c ] - - + + ``` |Parameter|Description| @@ -25,6 +35,33 @@ $ sudo /usr/local/nebula/scripts/nebula.service |`storaged`|Set the Storage Service as the target service.| |`all`|Set all the Nebula Graph services as the target services.| +## Manage services with systemd + +For easy maintenance, Nebula Graph supports managing services with systemd. Starting, stopping, restarting, and viewing services with command `systemctl`. + +!!! note + + After installing the Nebula Graph, the `.service` files required for systemd are in the directory `etc/unit` of installation directory. The Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the directory `/usr/lib/systemd/system`, and the parameter `ExecStart` also automatically generated from the specified Nebula Graph installation path, so you can use the command `systemctl` directly. + + Otherwise, users need to move the `.service` files manually into the directory `/usr/lib/systemd/system`, and modify the file path of parameter `ExecStart` in the `.service` files. + +### Syntax + +```bash +$ systemctl +``` + +|Parameter|Description| +|-|-| +|`start`|Start the target services.| +|`stop`|Stop the target services.| +|`restart`|Restart the target services.| +|`status`|Check the status of the target services.| +|`nebula`|Set all the Nebula Graph services as the target services.| +|`nebula-metad`|Set the Meta Service as the target service.| +|`nebula-graphd`|Set the Graph Service as the target service.| +|`nebula-storaged`|Set the Storage Service as the target service.| + ## Start Nebula Graph ### In non-container environment @@ -41,6 +78,18 @@ $ sudo /usr/local/nebula/scripts/nebula.service start all [INFO] Done ``` +Users can also run the following command: + +```bash +$ systemctl start nebula +``` + +If users want to automatically start the Nebula Graph when the machine starts, run the following command: + +```bash +$ systemctl enable nebula +``` + ### In docker container (deployed with docker-compose) Run the following command in the `nebula-docker-compose/` directory to start Nebula Graph. @@ -80,6 +129,12 @@ $ sudo /usr/local/nebula/scripts/nebula.service stop all [INFO] Done ``` +Users can also run the following command: + +```bash +$ systemctl stop nebula +``` + ### In docker container (deployed with docker-compose) Run the following command in the `nebula-docker-compose/` directory to stop Nebula Graph. @@ -137,6 +192,25 @@ $ sudo /usr/local/nebula/scripts/nebula.service status all [INFO] nebula-storaged: Running as 25646, Listening on 9779 ``` +Users can also run the following command: + +```bash +$ systemctl status nebula +● nebula.service + Loaded: loaded (/usr/lib/systemd/system/nebula.service; disabled; vendor preset: disabled) + Active: active (exited) since 一 2022-03-28 04:13:24 UTC; 1h 47min ago + Process: 21772 ExecStart=/usr/local/ent-nightly/scripts/nebula.service start all (code=exited, status=0/SUCCESS) + Main PID: 21772 (code=exited, status=0/SUCCESS) + Tasks: 325 + Memory: 424.5M + CGroup: /system.slice/nebula.service + ├─21789 /usr/local/ent-nightly/bin/nebula-metad --flagfile /usr/local/ent-nightly/etc/nebula-metad.conf + ├─21827 /usr/local/ent-nightly/bin/nebula-graphd --flagfile /usr/local/ent-nightly/etc/nebula-graphd.conf + └─21900 /usr/local/ent-nightly/bin/nebula-storaged --flagfile /usr/local/ent-nightly/etc/nebula-storaged.conf +3月 28 04:13:24 xxxxxx systemd[1]: Started nebula.service. +... +``` + The Nebula Graph services consist of the Meta Service, Graph Service, and Storage Service. The configuration files for all three services are stored in the `/usr/local/nebula/etc/` directory by default. You can check the configuration files according to the returned result to troubleshoot problems. ### In docker container (deployed with docker-compose) From 8d333ce733793e295037aadab8371926eab8489a Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Tue, 29 Mar 2022 09:15:40 +0800 Subject: [PATCH 02/13] Update source_manage-service.md --- docs-2.0/reuse/source_manage-service.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index 2391292f3a5..b544855db21 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -1,5 +1,9 @@ Nebula Graph supports managing services with script or systemd. This topic will describe the two methods in detail. +!!! enterpriseonly + + Systemd only available for the Nebula Graph Enterprise Edition. + !!! note The two methods are incompatible. It is recommended to use only one method at a cluster. From dacbaf9eea1cc0d9e497f66c9ca58c9b5a0ad4a7 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:55:58 +0800 Subject: [PATCH 03/13] Update docs-2.0/reuse/source_manage-service.md Co-authored-by: abby.huang <78209557+abby-cyber@users.noreply.github.com> --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index b544855db21..4d326536980 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -6,7 +6,7 @@ Nebula Graph supports managing services with script or systemd. This topic will !!! note - The two methods are incompatible. It is recommended to use only one method at a cluster. + The two methods are incompatible. It is recommended to use only one method in a cluster. ## Manage services with script From c15adee978e33db6da99bb08e3aa1cfe734f951d Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:56:10 +0800 Subject: [PATCH 04/13] Update docs-2.0/reuse/source_manage-service.md Co-authored-by: abby.huang <78209557+abby-cyber@users.noreply.github.com> --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index 4d326536980..d3668b332bb 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -10,7 +10,7 @@ Nebula Graph supports managing services with script or systemd. This topic will ## Manage services with script -You can use the `nebula.service` script to manage services, including start, stop, restart, terminate, and check the Nebula Graph services. +You can use the `nebula.service` script to start, stop, restart, terminate, and check the Nebula Graph services. !!! note From 966d135f3564139bc98587f2ad0e23b7ff0faf14 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:56:23 +0800 Subject: [PATCH 05/13] Update docs-2.0/reuse/source_manage-service.md Co-authored-by: abby.huang <78209557+abby-cyber@users.noreply.github.com> --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index d3668b332bb..6c888d4365d 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -41,7 +41,7 @@ $ sudo /usr/local/nebula/scripts/nebula.service ## Manage services with systemd -For easy maintenance, Nebula Graph supports managing services with systemd. Starting, stopping, restarting, and viewing services with command `systemctl`. +For easy maintenance, Nebula Graph supports managing services with systemd. You can start, stop, restart, and check services with `systemctl` commands. !!! note From 78bbaa7c38b2b05a3aa321773c7e692692bd426b Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:57:18 +0800 Subject: [PATCH 06/13] Update docs-2.0/reuse/source_manage-service.md Co-authored-by: abby.huang <78209557+abby-cyber@users.noreply.github.com> --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index 6c888d4365d..dba1fd1903a 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -45,7 +45,7 @@ For easy maintenance, Nebula Graph supports managing services with systemd. You !!! note - After installing the Nebula Graph, the `.service` files required for systemd are in the directory `etc/unit` of installation directory. The Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the directory `/usr/lib/systemd/system`, and the parameter `ExecStart` also automatically generated from the specified Nebula Graph installation path, so you can use the command `systemctl` directly. + After installing the Nebula Graph, the `.service` files required for systemd are located in the `etc/unit` path under the installation directory. The Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the path `/usr/lib/systemd/system` and the parameter `ExecStart` is generated automatically based on the specified Nebula Graph installation path, so you can use `systemctl` commands directly. Otherwise, users need to move the `.service` files manually into the directory `/usr/lib/systemd/system`, and modify the file path of parameter `ExecStart` in the `.service` files. From db2ba365fa0548f0fc9fe189d0e838ffacff618d Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:57:25 +0800 Subject: [PATCH 07/13] Update docs-2.0/reuse/source_manage-service.md Co-authored-by: abby.huang <78209557+abby-cyber@users.noreply.github.com> --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index dba1fd1903a..e924a8207d0 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -47,7 +47,7 @@ For easy maintenance, Nebula Graph supports managing services with systemd. You After installing the Nebula Graph, the `.service` files required for systemd are located in the `etc/unit` path under the installation directory. The Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the path `/usr/lib/systemd/system` and the parameter `ExecStart` is generated automatically based on the specified Nebula Graph installation path, so you can use `systemctl` commands directly. - Otherwise, users need to move the `.service` files manually into the directory `/usr/lib/systemd/system`, and modify the file path of parameter `ExecStart` in the `.service` files. + Otherwise, users need to move the `.service` files manually into the directory `/usr/lib/systemd/system`, and modify the file path of the parameter `ExecStart` in the `.service` files. ### Syntax From b10b777ea3b001682ee531a9e072c3d7f47ab426 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:59:55 +0800 Subject: [PATCH 08/13] Update source_manage-service.md --- docs-2.0/reuse/source_manage-service.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index e924a8207d0..e995b248240 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -2,11 +2,11 @@ Nebula Graph supports managing services with script or systemd. This topic will !!! enterpriseonly - Systemd only available for the Nebula Graph Enterprise Edition. + Systemd only available for the Nebula Graph Enterprise Edition. !!! note - The two methods are incompatible. It is recommended to use only one method in a cluster. + The two methods are incompatible. It is recommended to use only one method in a cluster. ## Manage services with script @@ -14,7 +14,7 @@ You can use the `nebula.service` script to start, stop, restart, terminate, and !!! note - `nebula.service` is stored in the `/usr/local/nebula/scripts` directory by default, which is also the default installation path of Nebula Graph. If you have customized the path, use the actual path in your environment. + `nebula.service` is stored in the `/usr/local/nebula/scripts` directory by default, which is also the default installation path of Nebula Graph. If you have customized the path, use the actual path in your environment. ### Syntax @@ -45,9 +45,9 @@ For easy maintenance, Nebula Graph supports managing services with systemd. You !!! note - After installing the Nebula Graph, the `.service` files required for systemd are located in the `etc/unit` path under the installation directory. The Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the path `/usr/lib/systemd/system` and the parameter `ExecStart` is generated automatically based on the specified Nebula Graph installation path, so you can use `systemctl` commands directly. + After installing the Nebula Graph, the `.service` files required for systemd are located in the `etc/unit` path under the installation directory. The Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the path `/usr/lib/systemd/system` and the parameter `ExecStart` is generated automatically based on the specified Nebula Graph installation path, so you can use `systemctl` commands directly. - Otherwise, users need to move the `.service` files manually into the directory `/usr/lib/systemd/system`, and modify the file path of the parameter `ExecStart` in the `.service` files. + Otherwise, users need to move the `.service` files manually into the directory `/usr/lib/systemd/system`, and modify the file path of the parameter `ExecStart` in the `.service` files. ### Syntax @@ -88,7 +88,7 @@ Users can also run the following command: $ systemctl start nebula ``` -If users want to automatically start the Nebula Graph when the machine starts, run the following command: +If users want to automatically start Nebula Graph when the machine starts, run the following command: ```bash $ systemctl enable nebula From 93f8c5638cba549a9cf5d6501829203b37680eba Mon Sep 17 00:00:00 2001 From: randomJoe211 <69501902+randomJoe211@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:37:03 +0800 Subject: [PATCH 09/13] Update docs-2.0/reuse/source_manage-service.md --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index e995b248240..a36cbaef68f 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -1,4 +1,4 @@ -Nebula Graph supports managing services with script or systemd. This topic will describe the two methods in detail. +Nebula Graph supports managing services with scripts or systemd. This topic will describe the two methods in detail. !!! enterpriseonly From bc06491e4e14be9cb93341aebba3466d08869ed5 Mon Sep 17 00:00:00 2001 From: randomJoe211 <69501902+randomJoe211@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:37:07 +0800 Subject: [PATCH 10/13] Update docs-2.0/reuse/source_manage-service.md --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index a36cbaef68f..71647fc6e6a 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -2,7 +2,7 @@ Nebula Graph supports managing services with scripts or systemd. This topic will !!! enterpriseonly - Systemd only available for the Nebula Graph Enterprise Edition. + Managing Nebula Graph with systemd is only available in the Nebula Graph Enterprise Edition. !!! note From 3171b6135ae01a339a08cfe4b418842ee94c4c50 Mon Sep 17 00:00:00 2001 From: randomJoe211 <69501902+randomJoe211@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:37:12 +0800 Subject: [PATCH 11/13] Update docs-2.0/reuse/source_manage-service.md --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index 71647fc6e6a..43566b68115 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -14,7 +14,7 @@ You can use the `nebula.service` script to start, stop, restart, terminate, and !!! note - `nebula.service` is stored in the `/usr/local/nebula/scripts` directory by default, which is also the default installation path of Nebula Graph. If you have customized the path, use the actual path in your environment. + `nebula.service` is stored in the `/usr/local/nebula/scripts` directory by default. If you have customized the path, use the actual path in your environment. ### Syntax From ef6df7b4a6c290ed07f7a6ccc3cf45fc8e772361 Mon Sep 17 00:00:00 2001 From: randomJoe211 <69501902+randomJoe211@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:37:16 +0800 Subject: [PATCH 12/13] Update docs-2.0/reuse/source_manage-service.md --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index 43566b68115..c1342f0173c 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -45,7 +45,7 @@ For easy maintenance, Nebula Graph supports managing services with systemd. You !!! note - After installing the Nebula Graph, the `.service` files required for systemd are located in the `etc/unit` path under the installation directory. The Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the path `/usr/lib/systemd/system` and the parameter `ExecStart` is generated automatically based on the specified Nebula Graph installation path, so you can use `systemctl` commands directly. + After installing Nebula Graph, the `.service` files required by systemd are located in the `etc/unit` path in the installation directory. Nebula Graph installed with the RPM/DEB package automatically places the `.service` files into the path `/usr/lib/systemd/system` and the parameter `ExecStart` is generated based on the specified Nebula Graph installation path, so you can use `systemctl` commands directly. Otherwise, users need to move the `.service` files manually into the directory `/usr/lib/systemd/system`, and modify the file path of the parameter `ExecStart` in the `.service` files. From aaf31d70092cf40207c3b6cec2243c36dfa5bf68 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:55:57 +0800 Subject: [PATCH 13/13] Update source_manage-service.md --- docs-2.0/reuse/source_manage-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/reuse/source_manage-service.md b/docs-2.0/reuse/source_manage-service.md index c1342f0173c..0bbe4fe052f 100644 --- a/docs-2.0/reuse/source_manage-service.md +++ b/docs-2.0/reuse/source_manage-service.md @@ -4,7 +4,7 @@ Nebula Graph supports managing services with scripts or systemd. This topic will Managing Nebula Graph with systemd is only available in the Nebula Graph Enterprise Edition. -!!! note +!!! danger The two methods are incompatible. It is recommended to use only one method in a cluster.