2022-08-12 14:52:15 +00:00
|
|
|
# NOTES
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
The following instructions are for Ubuntu 20.04
|
2022-08-12 14:52:15 +00:00
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
## Setup
|
2022-08-12 14:52:15 +00:00
|
|
|
|
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
rustup upgrade
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install -y cmake g++ libprotobuf-dev protobuf-compiler
|
|
|
|
cargo install cargo-deb
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
## Building
|
2022-08-12 14:52:15 +00:00
|
|
|
|
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
cargo deb
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
## Testing
|
2022-08-12 14:52:15 +00:00
|
|
|
|
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
sudo dpkg -i target/debian/surreal_1.0.0~beta.5_amd64.deb
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
## Installing
|
2022-08-12 14:52:15 +00:00
|
|
|
|
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://deb.surrealdb.com | sh
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
## Running
|
2022-08-12 14:52:15 +00:00
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
#### Start the service
|
2022-08-12 14:52:15 +00:00
|
|
|
```shell
|
|
|
|
$ sudo service surreal start
|
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
#### Stop the service
|
2022-08-12 14:52:15 +00:00
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
$ sudo service surreal stop
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
#### Enable the service
|
2022-08-12 14:52:15 +00:00
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
$ sudo service surreal enable
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
#### Stop the service
|
2022-08-12 14:52:15 +00:00
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
$ sudo service surreal disable
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
#### Get the service status
|
2022-08-12 14:52:15 +00:00
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
$ sudo service surreal status
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
Below is an example response
|
2022-08-12 14:52:15 +00:00
|
|
|
|
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
● surreal.service - SurrealDB Service
|
|
|
|
Loaded: loaded (/lib/systemd/system/surreal.service; enabled; vendor preset: enabled)
|
|
|
|
Active: active (running) since Thu 2022-08-11 23:34:35 UTC; 5min ago
|
|
|
|
Main PID: 23177 (surreal)
|
|
|
|
Tasks: 5 (limit: 4605)
|
|
|
|
Memory: 3.2M
|
|
|
|
CGroup: /system.slice/surreal.service
|
|
|
|
└─23177 /usr/share/surreal/surreal start --log trace --user root --pass root
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 20:16:08 +00:00
|
|
|
#### View service logs
|
2022-08-12 14:52:15 +00:00
|
|
|
|
|
|
|
```shell
|
2022-08-12 20:16:08 +00:00
|
|
|
sudo journalctl -f -u surreal
|
2022-08-12 14:52:15 +00:00
|
|
|
```
|