-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
docs(config): update Snowflake serverid config.sample explanation
#58577
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -46,16 +46,29 @@ | |||
| 'instanceid' => '', | ||||
|
|
||||
| /** | ||||
| * This is a unique identifier for your server. | ||||
| * It is useful when your Nextcloud instance is using different PHP servers. | ||||
| * Once it's set it shouldn't be changed. | ||||
| * This parameter is used to differentiate between different PHP server instances | ||||
| * that share the same ``config.php``. Its core use is in the "Snowflake" ID generation | ||||
| * system, which ensures that unique IDs created in distributed environments cannot collide. | ||||
| * | ||||
| * Value must be an integer, comprised between 0 and 1023. | ||||
| * The ``serverid`` is an integer (0–1023) that must be unique for each PHP server. | ||||
| * | ||||
| * When config.php is shared between different servers, this value should be overriden with "NC_serverid=<int>" on each server. | ||||
| * Note that it must be overriden for CLI and for your webserver. | ||||
| * This parameter is especially important if you deploy Nextcloud across multiple servers | ||||
| * using a shared ``config.php`` file. | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For the same reason as above |
||||
| * | ||||
| * Example for CLI: NC_serverid=42 occ config:list system | ||||
| * Once it is set, it should not be changed, to avoid data inconsistencies. | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually it can be changed, but the important point to never have two identical server IDs in your cluster. One drawback of changing it: you can't find the server which created an ID from the ID itself (unless you keep history). I don't know if it will help for debugging at some point… |
||||
| * | ||||
| * In shared configurations, override ``serverid`` by setting the environment variable | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can also be a different |
||||
| * ``NC_serverid=<int>`` for each server (applies to both web servers and CLI commands). | ||||
| * | ||||
| * Example for CLI:: | ||||
| * | ||||
| * NC_serverid=42 occ config:list system | ||||
| * | ||||
| * For simple, standalone deployments, the default fallback (based on the hostname) | ||||
| * is generally safe as long as your server's hostname does not change and you do not | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
See above, if hostname change, server ID also change and it's not an issue, except to find server responsible for the ID |
||||
| * clone or migrate the installation. However, if you plan to clone, migrate, | ||||
| * or scale your installation at any time, it is recommended to explicitly set ``serverid`` | ||||
| * to a unique, fixed integer between 0 and 1023. | ||||
| */ | ||||
| 'serverid' => -1, | ||||
|
|
||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The important point is they share the same database. For some reasons, it can be different configuration files