配置

这一篇应该是mesos文档里面最难翻译的一篇,如何准确的去理解每一个配置选项正确的含义,需要对mesos有完整的理解,并且深入的实践.因为并不是每一个参数,都那么常用,甚至很多都很少被使用.这是一个长期的过程,此文档翻译暂停(最后做),请参考原文:http://mesos.apache.org/documentation/latest/configuration/

mesos配置

Mesos master和agent可以从命令行或环境变量接收一系列配置选项.通过运行`mesos-master --help`或者`mesos-agent --help`可以查看可用配置选项.每个选项都可以通过2个途径进行设置:

  • 执行命令的时候,使用`--option_name=value`,即直接指定选项值.或者指定一个包含选项的文件(--option_name=file://path/to/file).文件路径可以是绝对路径,也可以时相对当前目录的路径.
  • 通过设置环境变量`MESOS_OPTION_NAME`,这些option都是以MESOS_为前缀

配置选项取值,先搜索环境变量,然后才是命令行.

重要的配置选项

如果你有特殊的编译需求,当你配置mesos时候,请参考`./configure --help`.这个文档只列出了最新版本的配置选项.如果你想查看你手上mesos版本命令的配置选项,请运行`命令 --help`,比如:` mesos-master --help`

master 和 agent 配置选项

参数说明
--advertise_ip=VALUEMesos master/agent对公发布的ip地址,这个ip地址不与master和agent绑定.这个ip地址用于访问该master/agent
--advertise_port=VALUEmaster/agent对公发布的ip地址端口,这个ip地址端口不与master和agent绑定.这个ip地址端口用于访问该master/agent
--[no-]authenticate_httpIf true, only authenticated requests for HTTP endpoints supporting authentication are allowed. If false, unauthenticated requests to HTTP endpoints are also allowed. (default: false)
--[no-]authenticate_http_frameworks If true, only authenticated HTTP based frameworks are allowed to register. If false, HTTP frameworks are not authenticated. For more about HTTP frameworks see the Scheduler HTTP API documentation. (default: false)
--firewall_rules=VALUEThe value could be a JSON-formatted string of rules or a file path containing the JSON-formatted rules used in the endpoints firewall. Path must be of the form file:///path/to/file or /path/to/file.
See the Firewall message in flags.proto for the expected format.
Example:

{
"disabled_endpoints" : {

"paths" : [
  "/files/browse",
  "/metrics/snapshot"
]

}
}
|
|--[no-]help| 输出帮助信息. (默认值: false)|
|--http_authenticators=VALUE| HTTP authenticator implementation to use when handling requests to authenticated endpoints. Use the default basic, or load an alternate HTTP authenticator module using --modules.
Currently there is no support for multiple HTTP authenticators. (default: basic)|
|--http_framework_authenticators=VALUE|HTTP authenticator implementation to use when authenticating HTTP frameworks. Use the basic authenticator or load an alternate HTTP authenticator module using --modules. This must be used in conjunction with --authenticate_http_frameworks.
Currently there is no support for multiple HTTP authenticators.|
|--ip=VALUE|监听的ip地址. 不能与--ip_discovery_command一起使用 . (master 默认: 5050; agent 默认: 5051)|
|--ip_discovery_command=VALUE|Optional IP discovery binary: if set, it is expected to emit the IP address which the master/agent will try to bind to. Cannot be used in conjunction with --ip.|
|--port=VALUE|Port to listen on.|
|--[no-]version|Show version and exit. (default: false)|
|--hooks=VALUE|A comma-separated list of hook modules to be installed inside master/agent.|
|--hostname=VALUE|The hostname the agent node should report, or that the master should advertise in ZooKeeper. If left unset, the hostname is resolved from the IP address that the master/agent binds to; unless the user explicitly prevents that, using --no-hostname_lookup, in which case the IP itself is used.|
|--[no-]hostname_lookup|Whether we should execute a lookup to find out the server"s hostname, if not explicitly set (via, e.g., --hostname). True by default; if set to false it will cause Mesos to use the IP address, unless the hostname is explicitly set. (default: true)|
|--modules=VALUE |List of modules to be loaded and be available to the internal subsystems.
Use --modules=filepath to specify the list of modules via a file containing a JSON-formatted string. filepath can be of the form file:///path/to/file or /path/to/file.
Use --modules="{...}" to specify the list of modules inline.
Example:

{
"libraries": [
{
  "file": "/path/to/libfoo.so",
  "modules": [
    {
      "name": "org_apache_mesos_bar",
      "parameters": [
        {
          "key": "X",
          "value": "Y"
        }
      ]
    },
    {
      "name": "org_apache_mesos_baz"
    }
  ]
},
{
  "name": "qux",
  "modules": [
    {
      "name": "org_apache_mesos_norf"
    }
  ]
}

]
}

|
文章导航