【问题标题】:Change Nomad bind port更改 Nomad 绑定端口
【发布时间】:2020-04-12 10:34:05
【问题描述】:

在 HashiCorp Nomad 中,是否可以为服务器和客户端指定绑定端口(例如,从 464{6,7,8}600{6,7.8}

addresses 节不允许端口指定,-bind 开关也不允许。 advertise 节不会更改 Nomad 绑定的端口。

-bind 开关只允许指定 IP:

> nomad agent -server -data-dir=/tmp/nomad -bind=0.0.0.0
==> No configuration files loaded
==> Starting Nomad agent...
==> Nomad agent configuration:

       Advertise Addrs: HTTP: <HOSTIP>:4646; RPC: <HOSTIP>:4647; Serf: <HOSTIP>:4648
            Bind Addrs: HTTP: 0.0.0.0:4646; RPC: 0.0.0.0:4647; Serf: 0.0.0.0:4648

尝试指定端口错误输出:

> nomad agent -server -data-dir=/tmp/nomad -bind=0.0.0.0:6000 
==> Failed to parse HTTP advertise address (, 0.0.0.0:6000, 4646, false): Error resolving bind address "0.0.0.0:6000": lookup 0.0.0.0:6000: no such host

【问题讨论】:

  • 我可以指出 Nomad 问题通常存在于 SO 上吗?来源:stackexchange.com/search?q=nomad
  • 我上面的评论是指对我的问题和我的回答投反对票的用户,他还指出 Nomad 问题不属于 SO。

标签: port specifications nomad


【解决方案1】:

使用ports 节为代理选择端口,无论是服务器模式还是客户端模式。

【讨论】:

    【解决方案2】:

    你应该在 hashcorp 网站上查看如何使用 server.hcl client.hcl 和 nomad.hcl 文件启动 nomad

    echo 'server {
        enabled = true
        bootstrap_expect = 1
        
        }' > /etc/nomad.d/server.hcl
      
    echo 'region     = "global"
        datacenter = "dc1"
        data_dir  = "/opt/nomad"
        bind_addr = "1.2.3.4" # the default
    
        advertise {
        # Defaults to the first private IP address.
        http = "1.2.3.4"
        rpc  = "1.2.3.4" #put your adresse here
        serf = "1.2.3.4:5648" # non-default ports may be specified
                  }
        ' > /etc/nomad.d/nomad.hcl
    
      
    

    然后运行:

    nomad agent -config /etc/nomad.d
    

    【讨论】:

      猜你喜欢
      • 2014-08-31
      • 2020-12-15
      • 1970-01-01
      • 1970-01-01
      • 2019-09-29
      • 2023-02-17
      • 2017-06-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多