Skip to content

Commit

Permalink
Update 0.FAQ.md (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
foesa-yang authored Dec 28, 2022
1 parent c00f933 commit 60accb5
Showing 1 changed file with 106 additions and 0 deletions.
106 changes: 106 additions & 0 deletions docs-2.0/20.appendix/0.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,112 @@ dmp 文件是错误报告文件,详细记录了进程退出的信息,可以

如果用户不清楚 dmp 打印出来的相关信息,可以将打印出来的内容,带上操作系统版本、硬件配置、Core文件产生前后的错误日志和可能导致错误的操作贴在 [NebulaGraph 论坛](https://discuss.nebula-graph.com.cn/)上寻求帮助。

### 如何通过 systemctl 设置开机自动启动 NebulaGraph 服务?

1. 执行 `systemctl enable` 启动 metad、graphd 和 storaged 服务。

```
[root]# systemctl enable nebula-metad.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nebula-metad.service to /usr/lib/systemd/system/nebula-metad.service.
[root]# systemctl enable nebula-graphd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nebula-graphd.service to /usr/lib/systemd/system/nebula-graphd.service.
[root]# systemctl enable nebula-storaged.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nebula-storaged.service to /usr/lib/systemd/system/nebula-storaged.service.
```

2. 配置 metad、graphd 和 storaged 的 service 文件,设置服务自动拉起。

!!! caution

在配置service文件时需注意以下几点:
- PIDFile、ExecStart、ExecReload、ExecStop 参数的路径需要与服务器上的一致。
- RestartSec 为重启前等待的时长(秒),可根据实际情况修改。
- (可选)StartLimitInterval 为无限次重启,默认是 10 秒内如果重启超过 5 次则不再重启,设置为 0 表示不限次数重启。
- (可选)LimitNOFILE 为服务最大文件打开数,默认为1024,可根据实际情况修改。

配置 metad 服务的 service 文件:
```
$ vi /usr/lib/systemd/system/nebula-metad.service
[Unit]
Description=Nebula Graph Metad Service
After=network.target
[Service ]
Type=forking
Restart=always
RestartSec=15s
PIDFile=/usr/local/nebula/pids/nebula-metad.pid
ExecStart=/usr/local/nebula/scripts/nebula.service start metad
ExecReload=/usr/local/nebula/scripts/nebula.service restart metad
ExecStop=/usr/local/nebula/scripts/nebula.service stop metad
PrivateTmp=true
StartLimitInterval=0
LimitNOFILE=1024
[Install]
WantedBy=multi-user.target
```

配置 graphd 服务的 service 文件:
```
$ vi /usr/lib/systemd/system/nebula-graphd.service
[Unit]
Description=Nebula Graph Graphd Service
After=network.target
[Service]
Type=forking
Restart=always
RestartSec=15s
PIDFile=/usr/local/nebula/pids/nebula-graphd.pid
ExecStart=/usr/local/nebula/scripts/nebula.service start graphd
ExecReload=/usr/local/nebula/scripts/nebula.service restart graphd
ExecStop=/usr/local/nebula/scripts/nebula.service stop graphd
PrivateTmp=true
StartLimitInterval=0
LimitNOFILE=1024
[Install]
WantedBy=multi-user.target
```

配置 storaged 服务的 service 文件:
```
$ vi /usr/lib/systemd/system/nebula-storaged.service
[Unit]
Description=Nebula Graph Storaged Service
After=network.target
[Service]
Type=forking
Restart=always
RestartSec=15s
PIDFile=/usr/local/nebula/pids/nebula-storaged.pid
ExecStart=/usr/local/nebula/scripts/nebula.service start storaged
ExecReload=/usr/local/nebula/scripts/nebula.service restart storaged
ExecStop=/usr/local/nebula/scripts/nebula.service stop storaged
PrivateTmp=true
StartLimitInterval=0
LimitNOFILE=1024
[Install]
WantedBy=multi-user.target
```
3. reload 配置文件。

```
[root]# sudo systemctl daemon-reload
```

4. 重启服务。

```
$ systemctl restart nebula-metad.service
$ systemctl restart nebula-graphd.service
$ systemctl restart nebula-storaged.service
```

## 关于连接

### 防火墙中需要开放哪些端口?
Expand Down

0 comments on commit 60accb5

Please sign in to comment.