Skip to content

Commit

Permalink
Add nebula engine docs (#771)
Browse files Browse the repository at this point in the history
* Add nebula.md

* Add nebula.md
  • Loading branch information
ChengJie1053 authored Nov 28, 2023
1 parent b34d0ad commit a72f142
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 0 deletions.
108 changes: 108 additions & 0 deletions docs/engine-usage/nebula.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: Nebula Engine
sidebar_position: 17
---

This article mainly introduces the installation, use and configuration of the `Nebula` engine plugin in `Linkis`.


## 1. Pre-work

### 1.1 Engine installation

If you want to use `Nebula` engine on your `Linkis` service, you need to install `Nebula` service and make sure the service is available.

### 1.2 Service Verification

```shell
# Execute the task
./usr/local/bin/nebula-console -u root -p password --address=graphd --port=9669

CREATE SPACE IF NOT EXISTS my_space_1 (vid_type=FIXED_STRING(30));SHOW SPACES;

# Get the following output to indicate that the service is available
+--------------+
| Name |
+--------------+
| "my_space_1" |
+--------------+
```

## 2. Engine plugin deployment

### 2.1 Engine plugin preparation[non-default engine](./overview.md)

Compile the engine plug-in separately (requires `maven` environment)

```
# compile
cd ${linkis_code_dir}/linkis-engineconn-plugins/nebula/
mvn clean install
# The compiled engine plug-in package is located in the following directory
${linkis_code_dir}/linkis-engineconn-plugins/nebula/target/out/
```
[EngineConnPlugin Engine Plugin Installation](../deployment/install-engineconn.md)

### 2.2 Upload and load engine plugins

Upload the engine package in 2.1 to the engine directory of the server
```bash
${LINKIS_HOME}/lib/linkis-engineplugins
```
The directory structure after uploading is as follows
```
linkis-engineconn-plugins/
├── nebula
│   ├── dist
│   │   └── 3.0.0
│   │   ├── conf
│   │   └── lib
│   └── plugin
│   └── 3.0.0
```

### 2.3 Engine refresh

#### 2.3.1 Restart and refresh
Refresh the engine by restarting the `linkis-cg-linkismanager` service
```bash
cd ${LINKIS_HOME}/sbin
sh linkis-daemon.sh restart cg-linkismanager
```

### 2.3.2 Check whether the engine is refreshed successfully
You can check whether the `last_update_time` of the `linkis_engine_conn_plugin_bml_resources` table in the database is the time to trigger the refresh.

```sql
#login to `linkis` database
select * from linkis_cg_engine_conn_plugin_bml_resources;
```

## 3 Engine usage

### 3.1 Submit tasks through `Linkis-cli`

```shell
sh ./bin/linkis-cli -engineType nebula-3.0.0 -codeType nebula \
-code 'CREATE SPACE IF NOT EXISTS my_space_1 (vid_type=FIXED_STRING(30));SHOW SPACES;' \
-runtimeMap linkis.nebula.port=9669 -runtimeMap linkis.nebula.host=wds07
```

More `Linkis-Cli` command parameter reference: [Linkis-Cli usage](../user-guide/linkiscli-manual.md)

## 4. Engine configuration instructions

### 4.1 Default Configuration Description


| Configuration | Default | Required | Description |
| -------------------------------------- |-----------|-------------|-------------------------------------------------------|
| linkis.nebula.host | 127.0.0.1 | no | host |
| linkis.nebula.port | 9669 | no | port |
| linkis.nebula.username | root | no | username |
| linkis.nebula.password | nebula | no | password |
| linkis.nebula.max.conn.size | 100 | no | max conn size |
| linkis.nebula.reconnect.enabled | false | no | whether to retry after the connection is disconnected |
| linkis.engineconn.concurrent.limit | 100 | no | Maximum concurrent number of engines |
| linkis.nebula.default.limit | 5000 | no | Limit the number of result sets |

Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Nebula
sidebar_position: 17
---

本文主要介绍在 `Linkis` 中,`Nebula` 引擎插件的安装、使用和配置。


## 1. 前置工作

### 1.1 引擎安装

如果您希望在您的 `Linkis` 服务上使用 `Nebula` 引擎,您需要安装 `Nebula` 服务并保证服务可用。

### 1.2 服务验证

```shell
# 执行任务
./usr/local/bin/nebula-console -u root -p password --address=graphd --port=9669

CREATE SPACE IF NOT EXISTS my_space_1 (vid_type=FIXED_STRING(30));SHOW SPACES;

# 得到如下输出代表服务可用
+--------------+
| Name |
+--------------+
| "my_space_1" |
+--------------+
```

## 2. 引擎插件部署

### 2.1 引擎插件准备[非默认引擎](./overview.md)

单独编译引擎插件(需要有 `maven` 环境)

```
# 编译
cd ${linkis_code_dir}/linkis-engineconn-plugins/nebula/
mvn clean install
# 编译出来的引擎插件包,位于如下目录中
${linkis_code_dir}/linkis-engineconn-plugins/nebula/target/out/
```
[EngineConnPlugin 引擎插件安装](../deployment/install-engineconn.md)

### 2.2 引擎插件的上传和加载

将 2.1 中的引擎包上传到服务器的引擎目录下
```bash
${LINKIS_HOME}/lib/linkis-engineplugins
```
上传后目录结构如下所示
```
linkis-engineconn-plugins/
├── nebula
│   ├── dist
│   │   └── 3.0.0
│   │   ├── conf
│   │   └── lib
│   └── plugin
│   └── 3.0.0
```

### 2.3 引擎刷新

#### 2.3.1 重启刷新
通过重启 `linkis-cg-linkismanager` 服务刷新引擎
```bash
cd ${LINKIS_HOME}/sbin
sh linkis-daemon.sh restart cg-linkismanager
```

### 2.3.2 检查引擎是否刷新成功
可以查看数据库中的 `linkis_engine_conn_plugin_bml_resources` 这张表的`last_update_time` 是否为触发刷新的时间。

```sql
#登陆到 `linkis` 的数据库
select * from linkis_cg_engine_conn_plugin_bml_resources;
```

## 3 引擎的使用

### 3.1 通过 `Linkis-cli` 提交任务

```shell
sh ./bin/linkis-cli -engineType nebula-3.0.0 -codeType nebula \
-code 'CREATE SPACE IF NOT EXISTS my_space_1 (vid_type=FIXED_STRING(30));SHOW SPACES;' \
-runtimeMap linkis.nebula.port=9669 -runtimeMap linkis.nebula.host=wds07
```

更多 `Linkis-Cli` 命令参数参考: [Linkis-Cli 使用](../user-guide/linkiscli-manual.md)

## 4. 引擎配置说明

### 4.1 默认配置说明

| 配置 | 默认值 | 是否必须 | 说明 |
| -------------------------------------- |-----------|-------------|--------|
| linkis.nebula.host | 127.0.0.1 || host |
| linkis.nebula.port | 9669 || 端口 |
| linkis.nebula.username | root || 用户名 |
| linkis.nebula.password | nebula || 密码 |
| linkis.nebula.max.conn.size | 100 || 最大连接数 |
| linkis.nebula.reconnect.enabled | false || 连接断开后是否重试 |
| linkis.engineconn.concurrent.limit | 100 || 引擎最大并发数 |
| linkis.nebula.default.limit | 5000 || 结果集条数限制 |



0 comments on commit a72f142

Please sign in to comment.