我要评分
获取效率
正确性
完整性
易理解

Using a Script for Service Management

After NebulaGraph is installed, you can use the nebula.service script file to manage all its services (Storage, Graph, and Meta).

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:

1
2
3
4
/usr/local/nebula/scripts/nebula.service
[-v] [-c <config_file_path>]
<start | stop | restart | kill | status>
<metad | graphd | storaged | all>

Parameter

Description

-v

Displays detailed debugging information.

-c

Specifies the configuration file path. The default path is /usr/local/nebula/etc/. For a simple test, you only need to change the file name extension from .conf.default to .conf.

start

Starts the target services.

stop

Stops the target services.

restart

Restarts the target services.

kill

Terminates the target services.

status

Checks the service status.

metad

Manages the Meta service.

graphd

Manages the Graph service.

storaged

Manages the Storage service.

all

Manages all services. This option is mutually exclusive with -c. If both options are used, the script directly discards the configuration path specified by -c and uses the default path.

Starting Services

  • Run the following command to start all components:
    1
    /usr/local/nebula/scripts/nebula.service start all
    
    The following information indicates that components are started successfully.
    1
    2
    3
    4
    5
    6
    [INFO] Starting nebula-metad...
    [INFO] Done
    [INFO] Starting nebula-graphd...
    [INFO] Done
    [INFO] Starting nebula-storaged...
    [INFO] Done
    
  • Run the following commands to start components one by one:
    1
    2
    3
    /usr/local/nebula/scripts/nebula.service -c /usr/local/nebula/etc/nebula-metad.conf start metad
    /usr/local/nebula/scripts/nebula.service -c /usr/local/nebula/etc/nebula-graphd.conf start graphd
    /usr/local/nebula/scripts/nebula.service -c /usr/local/nebula/etc/nebula-storaged.conf start storaged
    
  • If you install components in a container by compiling the source code, run the following commands to start the components:
    1
    2
    3
    4
    5
    /usr/local/nebula/bin/nebula-metad --flagfile=/usr/local/nebula/etc/nebula-metad.conf --daemonize=false --containerized=true --meta_server_addrs=127.0.0.1:8559 --local_ip=127.0.0.1 --ws_ip=127.0.0.1 --port=8559 --ws_http_port=18559 --data_path=/data/meta --log_dir=/logs --v=0 --minloglevel=0
    
    /usr/local/nebula/bin/nebula-storaged --flagfile=/usr/local/nebula/etc/nebula-storaged.conf --daemonize=false --containerized=true --meta_server_addrs=127.0.0.1:8559 --local_ip=127.0.0.1 --ws_ip=127.0.0.1 --port=8779 --ws_http_port=18779 --data_path=/data/storage --log_dir=/logs --v=0 --minloglevel=0 --max_batch_size=2048
    
    /usr/local/nebula/bin/nebula-graphd --flagfile=/usr/local/nebula/etc/nebula-graphd.conf --daemonize=false --containerized=true --meta_server_addrs=127.0.0.1:8559 --port=8669 --local_ip=127.0.0.1 --ws_ip=127.0.0.1 --ws_http_port=18669 --log_dir=/logs --v=0 --minloglevel=0 --max_sessions_per_ip_per_user=2048
    

Stopping Services

Run the following command to stop all services:

1
/usr/local/nebula/scripts/nebula.service stop all

The command output is as follows:

1
2
3
4
5
6
[INFO] Stopping nebula-metad...
[INFO] Done
[INFO] Stopping nebula-graphd...
[INFO] Done
[INFO] Stopping nebula-storaged...
[INFO] Done

Checking Service Status

Run the following command to check service status:

1
/usr/local/nebula/scripts/nebula.service status all

The services are running normally if the following information is returned. However, you need to run the ADD HOSTS command to add storaged to the cluster.

1
2
3
4
5
[INFO] nebula-metad(33fd35e): Running as 29020, Listening on 9559
[INFO] nebula-graphd(33fd35e): Running as 29095, Listening on 9669
[WARN] nebula-storaged after v3.0.0 will not start service until it is added to cluster.
[WARN] See Manage Storage hosts:ADD HOSTS in https://docs.nebula-graph.io/
[INFO] nebula-storaged(33fd35e): Running as 29147, Listening on 9779