Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node log #116

Merged
merged 6 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,18 @@ nebula> GET CONFIGS heartbeat_interval_secs;
-----------------------------------------------------------------
```

## Update CONFIGS
## UPDATE CONFIGS

```ngql
UPDATE CONFIGS [graph|meta|storage :] var = value
```

> The updated CONFIGS will be stored into the `meta service` permanently.
> If the configuration's mode is `MUTABLE`, the change will take effects immediately. Otherwise, if the mode is `REBOOT`, the change will not work until server restart.
> Expression is supported in UPDATE CONFIGS.
For example
> If the configuration's mode is `MUTABLE`, the change will take effect immediately.
> Some RocksDB parameters take effect after restarting the services.
amber-moe marked this conversation as resolved.
Show resolved Hide resolved
> Expression is supported in the `UPDATE CONFIGS` command.

For example:

```ngql
nebula> UPDATE CONFIGS storage:heartbeat_interval_secs=1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ max_background_jobs -- Use multi-thread for compacting. The default
```

> The above parameters can either be dynamically modified by UPDATE CONFIGS syntax, or written in the local configuration file. Please refer to the RocksDB manual for specific functions and whether restarting is needed.
The parameters above can either be dynamically modified by the `UPDATE CONFIGS` syntax, or written in the local configuration file. Please refer to the RocksDB manual for specific functions and whether restarting is needed.

### `rocksdb_column_family_options`

Expand All @@ -106,9 +106,9 @@ disable_auto_compactions -- Compact automatically when writing data is sto
```

> The above parameters can either be dynamically modified by UPDATE CONFIGS syntax, or written in the local configuration file. Please refer to the RocksDB manual for specific functions and whether restarting is needed.
> The preceding parameters can either be dynamically modified by UPDATE CONFIGS syntax, or written in the local configuration file. Please refer to the RocksDB manual for specific functions and whether restarting is needed.
The above parameters can be set via the command line as follows:
The preceding parameters can be set via the command line as follows:

```ngql
nebula> UPDATE CONFIGS storage:rocksdb_column_family_options = \
Expand All @@ -120,7 +120,7 @@ nebula> UPDATE CONFIGS storage:rocksdb_db_options = \
nebula> UPDATE CONFIGS storage:max_edge_returned_per_vertex = 10; -- The parameter is explained below
```

Configurations done with the configuration file
We recommend the following configuration:

```text
rocksdb_db_options = {"stats_dump_period_sec":"200", "write_thread_max_yield_usec":"600"}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Logs

**Nebula Graph** uses [glog](https://github.com/google/glog) to print logs, uses [gflag](https://gflags.github.io/gflags/) to control the severity level of the log, and provides an HTTP interface to dynamically change the log level at runtime to facilitate tracking.

## Log Directory

The default log directory is `/usr/local/nebula/logs/`.

**Note:** If you deleted the log directory during runtime, the runtime log would not continue to be printed. However, this operation will not affect the services. Restart the services to recover the logs.

## Parameter Description

### Two most commonly used flags in glog

- minloglevel: The numbers of severity levels INFO(DEBUG), WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively. Usually specified as 0 in debug, 1 in production. If you set the minloglevel to 4, no logs are printed.
- v: The scale of v is 0-4. When the value is set to 0, you can further set the severity level of the debug log. The larger the value, the more detailed the log.

### Configuration Files

The default severity level for the metad, graphd, and storaged logs can be found in the configuration files (usually in `/usr/local/nebula/etc/`).

## Check and Change the Severity Levels Dynamically

Check all the flag values (log values included) of the current gflags with the following command. `curl` is only available when the `local_config` parameter is set to `true`.

```bash
> curl ${ws_ip}:${ws_port}/get_flags
```

In the command:

- `ws_ip` is the IP address of the HTTP service , which can be found in the configuration files above. The default value is 127.0.0.1.
amber-moe marked this conversation as resolved.
Show resolved Hide resolved
- `ws_port` is the port of the HTTP service, the default value for `metad` is 11000, `storaged` is 12000, and `graphd` is 13000.
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

For example, check the severity minloglevel of the `storaged` service:

```bash
> curl 127.0.0.1:12000/get_flags | grep minloglevel
```

You can also change the logs' severity level to **the most detailed** with the following command.
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

```bash
> curl "http://127.0.0.1:12000/set_flags?flag=v&value=4"
> curl "http://127.0.0.1:12000/set_flags?flag=minloglevel&value=0"
```

In the Nebula console, check the severity minloglevel of graphd and set it to **the most detailed** with the following commands.
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

```ngql
nebula> GET CONFIGS graph:minloglevel;
nebula> UPDATE CONFIGS graph:minloglevel=0;
```

To change the severity of the storage log, replace the `graph` in the preceding command with `storage`. Note that **Nebula Graph** only supports modifying the graph and storage log severity via console, meta log cannot be modified.
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

**Close** all logs print (FATAL only) with the following command.

```bash
> curl "http://127.0.0.1:12000/set_flags?flag=minloglevel&value=4"
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

This document will walk you through the concept of Compact.

1. Start or stop compact. This method calls the default RocksDB compact. You can use it to merge sst files in small scale during data writing to ensure the read speed in a short time. This kind of compact is usually performed in the day time.
- The default RocksDB compact style. You can use the `UPDATE CONFIG statement` as follows to start or stop it. It merges sst files in small scale during data writing to speed up the data reading in a short time. When enabled, this compaction is automatically performed during the daytime.

```ngql
nebula> UPDATE CONFIG storage:disable_auto_compactions=false/true;
```

2. Start compact with the `SUBMIT JOB COMPACT` command. This method calls the customized compact of **Nebula Graph**. You can use it to perform large scale background operations such as sst files merging in large scale or TTL. This kind of compact is usually performed after midnight.
- The customized compact style for **Nebula Graph**. You can run the `SUBMIT JOB COMPACT` command to start it. You can use it to perform large scale background operations such as sst files merging in large scale or TTL. This kind of compact is usually performed after midnight.

In addition, you can modify the number of threads in both methods by the following command. You can decrease the threads during daytime and increase it at night.

Expand Down
1 change: 1 addition & 0 deletions docs/manual-EN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ It is the optimal solution in the world capable of hosting graphs with dozens of
* [Storaged Configuration](3.build-develop-and-administration/3.configurations/5.storage-config.md)
* [Console Configuration](3.build-develop-and-administration/3.configurations/6.console-config.md)
* [Kernel Configuration](3.build-develop-and-administration/3.configurations/7.kernel-config.md)
* [Single Node Log](3.build-develop-and-administration/3.configurations/8.single-node-log.md)
* Account Management Statement
* [Alter User Syntax](3.build-develop-and-administration/4.account-management-statements/alter-user-syntax.md)
* [Authentication](3.build-develop-and-administration/4.account-management-statements/authentication.md)
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ nav:
- Storaged Configuration: manual-EN/3.build-develop-and-administration/3.configurations/5.storage-config.md
- Console Configuration: manual-EN/3.build-develop-and-administration/3.configurations/6.console-config.md
- Kernel Configuration: manual-EN/3.build-develop-and-administration/3.configurations/7.kernel-config.md
- Single Node Log: manual-EN/3.build-develop-and-administration/3.configurations/8.single-node-log.md
- Account Management Statement:
- Alter User Syntax: manual-EN/3.build-develop-and-administration/4.account-management-statements/alter-user-syntax.md
- Authentication: manual-EN/3.build-develop-and-administration/4.account-management-statements/authentication.md
Expand Down