docs: Updated bot sharding guide in advanced creds guide, Added comments to coord.yml, Updated manual migration guide with correct indentation

This commit is contained in:
Kwoth
2021-09-12 00:09:55 +02:00
parent 712cb9300f
commit 1d5a702b46
3 changed files with 39 additions and 28 deletions

View File

@@ -170,13 +170,13 @@ restartCommand:
Nadeko saves all settings and data in the database file `NadekoBot.db`, located in: Nadeko saves all settings and data in the database file `NadekoBot.db`, located in:
- Windows (Updater): `system/data` (can be easily accessed through the `Data` button on the updater) - Windows (Updater): `system/data` (can be easily accessed through the `Data` button on the updater)
- Windows (Source), Linux and OSX: `NadekoBot/src/NadekoBot/bin/Release/netcoreapp2.1/data/NadekoBot.db` - Windows (Source), Linux and OSX: `nadekobot/output/data/NadekoBot.db`
In order to open it you will need [SQLite Browser](http://sqlitebrowser.org/). In order to open it you will need [SQLite Browser](http://sqlitebrowser.org/).
*NOTE: You don't have to worry if you don't have the `NadekoBot.db` file, it gets automatically created once you successfully run the bot for the first time.* *NOTE: You don't have to worry if you don't have the `NadekoBot.db` file, it gets automatically created once you successfully run the bot for the first time.*
**To make changes:** **To make changes to the database on windows:**
- Shut your bot down. - Shut your bot down.
- Copy the `NadekoBot.db` file to someplace safe. (Back up) - Copy the `NadekoBot.db` file to someplace safe. (Back up)
@@ -195,20 +195,24 @@ In order to open it you will need [SQLite Browser](http://sqlitebrowser.org/).
## Sharding your bot ## Sharding your bot
- **ShardRunCommand** To run a sharded bot, you will want to run `src/NadekoBot.Coordinator` project.
- Command with which to run shards 1+ Shards communicate with the coordinator using gRPC
- Required if you're sharding your bot on windows using .exe, or in a custom way. To configure your Coordinator, you will need to edit the `src/NadekoBot.Coordinator/coord.yml` file
- This internally defaults to `dotnet`
- For example, if you want to shard your NadekoBot which you installed using windows installer, you would want to set it to something like this: `C:\Program Files\NadekoBot\system\NadekoBot.exe` ```yml
- **ShardRunArguments** # total number of shards
- Arguments to the shard run command TotalShards: 3
- Required if you're sharding your bot on windows using .exe, or in a custom way. # How often do shards ping their state back to the coordinator
- This internally defaults to `run -c Release --no-build -- {0} {1} {2}` which will be enough to run linux and other 'from source' setups RecheckIntervalMs: 5000
- {0} will be replaced by the `shard ID` of the shard being ran, {1} by the shard 0's process id, and {2} by the port shard communication is happening on # Command to run the shard
- If shard0 (main window) is closed, all other shards will close too ShardStartCommand: dotnet
- For example, if you want to shard your NadekoBot which you installed using windows installer, you would want to set it to `{0} {1} {2}` # Arguments to run the shard
- **ShardRunPort** # {0} = shard id
- Bot uses a random UDP port in [5000, 6000] range for communication between shards # {1} = total number of shards
ShardStartArgs: ../../output/NadekoBot.dll -- {0} {1}
# How long does it take for the shard to be forcefully restarted once it stops reporting its state
UnresponsiveSec: 30
```
[Google Console]: https://console.developers.google.com [Google Console]: https://console.developers.google.com
[DiscordApp]: https://discordapp.com/developers/applications/me [DiscordApp]: https://discordapp.com/developers/applications/me

View File

@@ -1,5 +1,12 @@
# total number of shards
TotalShards: 3 TotalShards: 3
# How often do shards ping their state back to the coordinator
RecheckIntervalMs: 5000 RecheckIntervalMs: 5000
# Command to run the shard
ShardStartCommand: dotnet ShardStartCommand: dotnet
# Arguments to run the shard
# {0} = shard id
# {1} = total number of shards
ShardStartArgs: run -p "..\NadekoBot\NadekoBot.csproj" --no-build -- {0} {1} ShardStartArgs: run -p "..\NadekoBot\NadekoBot.csproj" --no-build -- {0} {1}
# How long does it take for the shard to be forcefully restarted once it stops reporting its state
UnresponsiveSec: 30 UnresponsiveSec: 30