mirror of
https://github.com/minio/minio.git
synced 2025-01-23 04:33:15 -05:00
support reading systemctl config automatically on baremetal setups (#15066)
this allows for customers to use `mc admin service restart` directly even when performing RPM, DEB upgrades. Upon such 'restart' after upgrade MinIO will re-read the /etc/default/minio for any newer environment variables. As long as `MINIO_CONFIG_ENV_FILE=/etc/default/minio` is set, this is honored.
This commit is contained in:
parent
214ea14f29
commit
af1944f28d
10
README.md
10
README.md
@ -236,16 +236,16 @@ Upgrades require zero downtime in MinIO, all upgrades are non-disruptive, all tr
|
|||||||
mc admin update <minio alias, e.g., myminio>
|
mc admin update <minio alias, e.g., myminio>
|
||||||
```
|
```
|
||||||
|
|
||||||
- For deployments without external internet access (e.g. airgapped environments), download the binary from <https://dl.min.io> and replace the existing MinIO binary let's say for example `/opt/bin/minio`, apply executable permissions `chmod +x /opt/bin/minio` and do `mc admin service restart alias/`.
|
- For deployments without external internet access (e.g. airgapped environments), download the binary from <https://dl.min.io> and replace the existing MinIO binary let's say for example `/opt/bin/minio`, apply executable permissions `chmod +x /opt/bin/minio` and proceed to perform `mc admin service restart alias/`.
|
||||||
|
|
||||||
- For installations using Systemd MinIO service, upgrade via RPM/DEB packages **parallelly** on all servers or replace the binary lets say `/opt/bin/minio` on all nodes, apply executable permissions `chmod +x /opt/bin/minio`. Proceed to perform `systemctl restart minio` across all nodes in **parallel**.
|
- For installations using Systemd MinIO service, upgrade via RPM/DEB packages **parallelly** on all servers or replace the binary lets say `/opt/bin/minio` on all nodes, apply executable permissions `chmod +x /opt/bin/minio` and process to perform `mc admin service restart alias/`.
|
||||||
|
|
||||||
### Upgrade Checklist
|
### Upgrade Checklist
|
||||||
|
|
||||||
- Test all upgrades in a lower environment (DEV, QA, UAT) before applying to production. Performing blind upgrades in production environments carries significant risk.
|
- Test all upgrades in a lower environment (DEV, QA, UAT) before applying to production. Performing blind upgrades in production environments carries significant risk.
|
||||||
- Read the release notes for the targeted MinIO release *before* performing any installation, there is no forced requirement to upgrade to latest releases every week. If it has a bug fix you are looking for then yes, else avoid actively upgrading a running production system.
|
- Read the release notes for MinIO *before* performing any upgrade, there is no forced requirement to upgrade to latest releases upon every releases. Some releases may not be relevant to your setup, avoid upgrading production environments unnecessarily.
|
||||||
- If you plan to use `mc admin update`, MinIO process must have write access to the parent directory to provide in-place upgrades.
|
- If you plan to use `mc admin update`, MinIO process must have write access to the parent directory where the binary is present on the host system.
|
||||||
- `mc admin update` is not supported in kubernetes/container environments, container environments provide their own mechanisms for container updates.
|
- `mc admin update` is not supported and should be avoided in kubernetes/container environments, please upgrade containers by upgrading relevant container images.
|
||||||
- **We do not recommend upgrading one MinIO server at a time, the product is designed to support parallel upgrades please follow our recommended guidelines.**
|
- **We do not recommend upgrading one MinIO server at a time, the product is designed to support parallel upgrades please follow our recommended guidelines.**
|
||||||
|
|
||||||
## Explore Further
|
## Explore Further
|
||||||
|
@ -526,9 +526,6 @@ func parsEnvEntry(envEntry string) (envKV, error) {
|
|||||||
func minioEnvironFromFile(envConfigFile string) ([]envKV, error) {
|
func minioEnvironFromFile(envConfigFile string) ([]envKV, error) {
|
||||||
f, err := os.Open(envConfigFile)
|
f, err := os.Open(envConfigFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) { // ignore if file doesn't exist.
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
@ -624,7 +621,7 @@ func loadEnvVarsFromFiles() {
|
|||||||
|
|
||||||
if env.IsSet(config.EnvConfigEnvFile) {
|
if env.IsSet(config.EnvConfigEnvFile) {
|
||||||
ekvs, err := minioEnvironFromFile(env.Get(config.EnvConfigEnvFile, ""))
|
ekvs, err := minioEnvironFromFile(env.Get(config.EnvConfigEnvFile, ""))
|
||||||
if err != nil {
|
if err != nil && !os.IsNotExist(err) {
|
||||||
logger.Fatal(err, "Unable to read the config environment file")
|
logger.Fatal(err, "Unable to read the config environment file")
|
||||||
}
|
}
|
||||||
for _, ekv := range ekvs {
|
for _, ekv := range ekvs {
|
||||||
|
@ -138,6 +138,13 @@ func serverCmdArgs(ctx *cli.Context) []string {
|
|||||||
logger.FatalIf(err, "Unable to validate passed arguments in %s:%s",
|
logger.FatalIf(err, "Unable to validate passed arguments in %s:%s",
|
||||||
config.EnvArgs, os.Getenv(config.EnvArgs))
|
config.EnvArgs, os.Getenv(config.EnvArgs))
|
||||||
}
|
}
|
||||||
|
if v == "" {
|
||||||
|
v, _, _, err = env.LookupEnv(config.EnvVolumes)
|
||||||
|
if err != nil {
|
||||||
|
logger.FatalIf(err, "Unable to validate passed arguments in %s:%s",
|
||||||
|
config.EnvVolumes, os.Getenv(config.EnvVolumes))
|
||||||
|
}
|
||||||
|
}
|
||||||
if v == "" {
|
if v == "" {
|
||||||
// Fall back to older environment value MINIO_ENDPOINTS
|
// Fall back to older environment value MINIO_ENDPOINTS
|
||||||
v, _, _, err = env.LookupEnv(config.EnvEndpoints)
|
v, _, _, err = env.LookupEnv(config.EnvEndpoints)
|
||||||
@ -422,12 +429,12 @@ func serverMain(ctx *cli.Context) {
|
|||||||
erasureSelfTest()
|
erasureSelfTest()
|
||||||
compressSelfTest()
|
compressSelfTest()
|
||||||
|
|
||||||
// Handle all server command args.
|
|
||||||
serverHandleCmdArgs(ctx)
|
|
||||||
|
|
||||||
// Handle all server environment vars.
|
// Handle all server environment vars.
|
||||||
serverHandleEnvVars()
|
serverHandleEnvVars()
|
||||||
|
|
||||||
|
// Handle all server command args.
|
||||||
|
serverHandleCmdArgs(ctx)
|
||||||
|
|
||||||
// Set node name, only set for distributed setup.
|
// Set node name, only set for distributed setup.
|
||||||
globalConsoleSys.SetNodeName(globalLocalNodeName)
|
globalConsoleSys.SetNodeName(globalLocalNodeName)
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ const (
|
|||||||
EnvPublicIPs = "MINIO_PUBLIC_IPS"
|
EnvPublicIPs = "MINIO_PUBLIC_IPS"
|
||||||
EnvFSOSync = "MINIO_FS_OSYNC"
|
EnvFSOSync = "MINIO_FS_OSYNC"
|
||||||
EnvArgs = "MINIO_ARGS"
|
EnvArgs = "MINIO_ARGS"
|
||||||
|
EnvVolumes = "MINIO_VOLUMES"
|
||||||
EnvDNSWebhook = "MINIO_DNS_WEBHOOK_ENDPOINT"
|
EnvDNSWebhook = "MINIO_DNS_WEBHOOK_ENDPOINT"
|
||||||
|
|
||||||
EnvSiteName = "MINIO_SITE_NAME"
|
EnvSiteName = "MINIO_SITE_NAME"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user