Elasticsearch头插件可通过公共IP获得

时间:2017-10-02 07:12:42

标签: elasticsearch azure-virtual-machine elasticsearch-head

我在Azure VM中运行的Ubuntu 16.04.3 LTS上使用Elasticsearch 5.6.2。

我已经克隆,构建并启动了elasticsearch-head,如此处所示 - https://github.com/mobz/elasticsearch-head#running-with-built-in-server

之后,HEAD似乎只在http://localhost:9100/上运行,但我需要它在http://public_ip:9100/上也可用。

我该怎么办?

1 个答案:

答案 0 :(得分:1)

在GruntFile中替换此代码:

    connect: {
        server: {
            options: {
                port: 9100,
                base: '.',
                keepalive: true
            }
        }
    }

使用:

    connect: {
        server: {
            options: {
                hostname:'<your_host_name>',
                port: 9100,
                base: '.',
                keepalive: true
            }
        }
    }

然后重新运行你的头部插件。对于大多数云平台,主机名是实例的专用IP。