You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MULTINODE.md
+78-17Lines changed: 78 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,17 @@ or outages.
18
18
19
19
If you want to run your DCSServerBot over multiple locations, you need to prepare your setup:
20
20
21
+
## Cluster Configuration
22
+
DCSServerBot lets you configure your cluster with several parameters.
23
+
```yaml
24
+
MyNode: # This is the name of your first node (will be different for you, usually the hostname is used).
25
+
cluster:
26
+
cloud_drive: true # Is your DCSServerBot installed on a cloud drive (Google Drive, OneDrive, etc.)? Default is true.
27
+
heartbeat: 60# Heartbeat between the nodes in a cluster. Default is 30, use larger values if your nodes are not in the same network.
28
+
preferred_master: true # This node will always be the master. If your database is installed on a node, make it your preferred master node.
29
+
no_master: true # This node will never become a master. You cannot specify preferred_master and no_master on the same node.
30
+
```
31
+
21
32
## Cloud-Drive Setup (default)
22
33
You need to make sure that every node in your cluster is aware of the full configuration. The best way to achieve this
23
34
is to have the bot or at least the bot's configuration installed on a cloud drive, like OneDrive or Google Drive.
@@ -32,22 +43,24 @@ autoupdate: true
32
43
33
44
b) nodes.yaml
34
45
```yaml
35
-
Node1: # this is the name of your first node. will be different for you
36
-
cloud_drive: true # this is the default, so no need to specify it in here, just for reference
37
-
heartbeat: 60# sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here (default = 30)
38
-
preferred_master: true # if your database is installed on Node1, make it your preferred master node
46
+
Node1: # this is the name of your first node (will be different for you, usually the hostname is used)
39
47
database:
40
48
url: postgres://dcsserverbot:[email protected]:5432/dcsserverbot?sslmode=prefer # if your database is installed on Node1
49
+
cluster:
50
+
cloud_drive: true # this is the default, so no need to specify it in here, just for reference
51
+
heartbeat: 60# sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here if your nodes are not on the same network (default = 30)
41
52
# ... anything else like extensions, instances, ... for Node1
42
-
Node2: # this is the name of your second node. will be different for you
43
-
heartbeat: 60# sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here (default = 30)
53
+
Node2: # this is the name of your second node (will be different for you, usually the hostname is used)
44
54
database:
45
55
url: postgres://dcsserverbot:[email protected]:5432/dcsserverbot?sslmode=prefer # replace xxx.xxx.xxx.xxx with the IP of Node1
56
+
cluster:
57
+
heartbeat: 60# sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here if your nodes are not on the same network (default = 30)
46
58
# ... anything else like extensions, instances, ... for Node2
47
-
Node3: # this is the name of your third node. will be different for you
48
-
heartbeat: 60# sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here (default = 30)
59
+
Node3: # this is the name of your third node (will be different for you, usually the hostname is used)
49
60
database:
50
61
url: postgres://dcsserverbot:[email protected]:5432/dcsserverbot?sslmode=prefer # replace xxx.xxx.xxx.xxx with the IP of Node1
62
+
cluster:
63
+
heartbeat: 60# sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here if your nodes are not on the same network (default = 30)
51
64
# ... anything else like extensions, instances, ... for Node3
52
65
```
53
66
@@ -61,17 +74,50 @@ autoupdate: true
61
74
62
75
b) nodes.yaml
63
76
```yaml
64
-
Node1: # this is the name of your first node. will be different for you
65
-
cloud_drive: false # tell the bot that you are NOT installed on a cloud drive
66
-
# ... same as before
67
-
Node2: # this is the name of your second node. will be different for you
68
-
cloud_drive: false # tell the bot that you are NOT installed on a cloud drive
69
-
# ... same as before
70
-
Node3: # this is the name of your third node. will be different for you
71
-
cloud_drive: false # tell the bot that you are NOT installed on a cloud drive
72
-
# ... same as before
77
+
Node1: # this is the name of your first node (will be different for you, usually the hostname is used)
78
+
cluster:
79
+
cloud_drive: false # tell the bot that it is NOT installed on a cloud drive
80
+
# ... same as above
81
+
Node2: # this is the name of your second node (will be different for you, usually the hostname is used)
82
+
cluster:
83
+
cloud_drive: false # tell the bot that it is NOT installed on a cloud drive
84
+
# ... same as above
85
+
Node3: # this is the name of your third node (will be different for you, usually the hostname is used)
86
+
cluster:
87
+
cloud_drive: false # tell the bot that it is NOT installed on a cloud drive
88
+
# ... same as above
73
89
```
74
90
91
+
## Master Handling
92
+
The DCSServerBot cluster consists of one master node and multiple agent nodes.
93
+
The master holds some services that are only allowed to run once in your cluster, like the Discord bot.
94
+
As this is usually linked to heavy database access, it is recommended to have the master node on the same server that
95
+
holds the database.
96
+
Installations which use a central database on a dedicated server or even a cloud database do not need to consider this.
97
+
98
+
If you want to bind your master to a specific node, you set this node as `preferred_master: true`.
99
+
In this case and unless this node does not run, it will be the master node.
100
+
101
+
In rare cases it might be that you do not want a node to become master at all.
102
+
This might be true if you run a node on a remotely hosted server like with Fox3 (or any other hoster), you can't
103
+
sync the configuration, or any other reason that might prevent you from having this node as master.
104
+
In this case you can configure `no_master: true` for this node.
105
+
106
+
```yaml
107
+
Node1: # this is the name of your first node (will be different for you, usually the hostname is used)
108
+
cluster:
109
+
preferred_master: true # Optional: if your database is installed on Node1, make it your preferred master node
110
+
# ... same as above
111
+
Node2: # this is the name of your second node (will be different for you, usually the hostname is used)
112
+
# ... same as above
113
+
Node3: # this is the name of your third node (will be different for you, usually the hostname is used)
114
+
cluster:
115
+
no_master: true # Optional: This node will never become a master
116
+
# ... same as above
117
+
```
118
+
> [!IMPORTANT]
119
+
> If no node is available to take over the master, your cluster will not work.
120
+
75
121
## PostgreSQL Setup
76
122
A standard PostgreSQL installation does not allow remote access to the database. To change it, follow [this guide](https://blog.devart.com/configure-postgresql-to-allow-remote-connection.html).
77
123
In addition, you would need to allow external access to your database by forwarding the database port (default: 5432)
@@ -129,6 +175,21 @@ that are named DCS.release_server on any of your nodes. This can be what you wan
129
175
I would always recommend creating the node-specific version (ex: "Multi-Node-Config"above) to avoid confusion. That's
130
176
what the bot will create during a default installation also.
131
177
178
+
## Running a node for another group
179
+
To run a node where you want to run servers for another group, you can use the `restrict_commands` setting in your
180
+
nodes.yaml. This will disable commands that can affect the integrity of your PC, like `/node shell`.
181
+
This is recommended for nodes that are run by you, but Admin accesses are happening without your control.
182
+
```yaml
183
+
Node1: # node where I have full control
184
+
# ...
185
+
Node2: # node where I do not have full control
186
+
restrict_commands: true
187
+
# ...
188
+
```
189
+
190
+
> [!NOTE]
191
+
> Unless you specify `restrict_owner: true` in nodes.yaml, the owner of the bot can still run restricted commands.
192
+
132
193
### Moving a Server from one Node / Instance to another
133
194
Each server is loosely coupled to an instance on a node. You can migrate a server to another instance though, by using
0 commit comments