MinIO 服务器配置(区域)

MinIO 中可以使用区域来表示当前服务器的位置。

KEY:
region  label the location of the server 
        标记服务器的位置

ARGS:
name     (string)    name of the location of the server e.g. "us-west-rack2" 
                     服务器位置的名称,例如 “us-west-rack2”
comment  (sentence)  optionally add a comment to this setting 
                     可选地为此设置添加注释

通过修改 .minio.sys/config/config.json 文件来实现,如下:

{
    \\...
    "region": {
        "_": [{
                "key": "name",
                "value": "zh-east-1"
            }
        ]
    },
    \\...
}

使用下面命令启动 MinIO,输出日志如下:

D:\server\minio>minio server ./data
...
RootUser: minioadmin
RootPass: minioadmin
Region:   zh-east-1

当然,也可以使用环境变量来设置区域名称。

KEY:
region  label the location of the server
        标记服务器的位置

ARGS:
MINIO_REGION_NAME     (string)    name of the location of the server e.g. "us-west-rack2" 
                                  服务器位置的名称,例如 “us-west-rack2”
MINIO_REGION_COMMENT  (sentence)  optionally add a comment to this setting 
                                  可选地为此设置添加注释

实例:定义当前服务器的区域名称为 “zh-west-1”

D:\server\minio>set MINIO_REGION_NAME=zh-west-1
D:\server\minio>echo %MINIO_REGION_NAME%
zh-west-1
D:\server\minio>minio server ./data
...
RootUser: minioadmin
RootPass: minioadmin
Region:   zh-west-1

注意:在定义的别名中不要包含特殊符号,否则将会抛出如下错误:

Error: Invalid region configuration: region '"zh-west-1"' is invalid, expected simple characters such as [us-east-1, myregion...] (*fmt.wrapError)
       7: cmd\config-current.go:403:cmd.lookupConfigs()
       6: cmd\config-current.go:707:cmd.loadConfig()
       5: cmd\config.go:236:cmd.initConfig()
       4: cmd\config.go:196:cmd.(*ConfigSys).Init()
       3: cmd\server-main.go:387:cmd.initAllSubsystems()
       2: cmd\server-main.go:323:cmd.initServer()
       1: cmd\server-main.go:535:cmd.serverMain()

上面错误中,“"” 引号不能作为区域名称,因此抛错了!!

说说我的看法
全部评论(

没有用。用的最新版本



.minio.sys下也没有config.json 


回复:
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号