-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e471235
commit 02d11a9
Showing
5 changed files
with
177 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
### Log rotation | ||
|
||
We use the sidecar container to clean NebulaGraph logs and run logs archiving tasks every hour. | ||
|
||
```yaml | ||
apiVersion: apps.nebula-graph.io/v1alpha1 | ||
kind: NebulaCluster | ||
metadata: | ||
name: nebula | ||
spec: | ||
graphd: | ||
config: | ||
# Whether logging files' name contain timestamp. | ||
"timestamp_in_logfile_name": "false" | ||
metad: | ||
config: | ||
"timestamp_in_logfile_name": "false" | ||
storaged: | ||
config: | ||
"timestamp_in_logfile_name": "false" | ||
logRotate: | ||
# Log files are rotated count times before being removed | ||
rotate: 5 | ||
# Log files are rotated only if they grow bigger than size bytes | ||
size: "100M" | ||
``` | ||
|
||
### Write log to stdout | ||
|
||
If you do not need to mount additional log disks in order to save costs on the cloud, | ||
and collect them through services such as fluent-bit and send them to the log center, you can refer to the configuration below. | ||
|
||
```yaml | ||
apiVersion: apps.nebula-graph.io/v1alpha1 | ||
kind: NebulaCluster | ||
metadata: | ||
name: nebula | ||
spec: | ||
graphd: | ||
config: | ||
# Whether to redirect stdout and stderr to separate output files | ||
redirect_stdout: "false" | ||
# The numbers of severity level INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively. | ||
stderrthreshold: "0" | ||
env: | ||
- name: GLOG_logtostderr # Logs are written to standard error instead of to files | ||
value: "1" | ||
image: vesoft/nebula-graphd | ||
replicas: 1 | ||
resources: | ||
requests: | ||
cpu: 500m | ||
memory: 500Mi | ||
service: | ||
externalTrafficPolicy: Local | ||
type: NodePort | ||
version: v3.4.0 | ||
imagePullPolicy: Always | ||
metad: | ||
config: | ||
redirect_stdout: "false" | ||
stderrthreshold: "0" | ||
dataVolumeClaim: | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
storageClassName: ebs-sc | ||
env: | ||
- name: GLOG_logtostderr | ||
value: "1" | ||
image: vesoft/nebula-metad | ||
replicas: 1 | ||
resources: | ||
requests: | ||
cpu: 500m | ||
memory: 500Mi | ||
version: v3.4.0 | ||
reference: | ||
name: statefulsets.apps | ||
version: v1 | ||
schedulerName: default-scheduler | ||
storaged: | ||
config: | ||
redirect_stdout: "false" | ||
stderrthreshold: "0" | ||
dataVolumeClaims: | ||
- resources: | ||
requests: | ||
storage: 1Gi | ||
storageClassName: ebs-sc | ||
enableAutoBalance: true | ||
enableForceUpdate: false | ||
env: | ||
- name: GLOG_logtostderr | ||
value: "1" | ||
image: vesoft/nebula-storaged | ||
replicas: 1 | ||
resources: | ||
requests: | ||
cpu: 500m | ||
memory: 500Mi | ||
version: v3.4.0 | ||
unsatisfiableAction: ScheduleAnyway | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## Scale storage nodes and balance | ||
|
||
Scaling out Storage is divided into two stages. | ||
|
||
* In the first stage, you need to wait for the status of all newly created Pods to be Ready. | ||
|
||
* In the second stage, the BALANCE DATA and BALANCE LEADER command is executed. | ||
|
||
We provide a parameter `enableAutoBalance` in CRD to control whether to automatically balance data and leader. | ||
Through both stages, the scaling process of the controller replicas is decoupled from the balancing data process and user executing it at low traffic. | ||
Such an implementation can effectively reduce the impact of data migration on online services, which is in line with the NebulaGraph principle: Balancing data is not fully automated and when to balance data is decided by users. | ||
|
||
## Storage leaders transfer | ||
|
||
When NebulaGraph starts to provide services, there will be multiple partition leaders on each storage node, | ||
in the rolling update scenario, in order to minimize the impact on client reads and writes, | ||
so it is necessary to transfer the leader to other nodes until the number of leaders on a storage node is 0, this process is relatively long. | ||
|
||
To make rolling updates more convenient for DBA, we provide the parameter `enableForceUpdate` for storage service, | ||
which can directly roll update storage when it is determined that there is no external access traffic, | ||
without waiting for the partition leader to be transferred before it can operate. |