使用 puppet 安装 Graylog2

使用 puppet 安装 Graylog2

我已设法从头开始安装 Graylog2,方法是下载所有 DEB 文件并进行配置。现在我尝试在环境中借助 puppet 安装 Graylog2,但目前还没有成功。

我在用elasticsearch/elasticsearchgraylog/graylog从锻造厂。

这是我目前的配置:

#site.pp
node 'mynode' {
        class {'apt':
                proxy_host        =>  'proxynode',
                proxy_port        =>  '3142',
        }
        class {'toolbox':}
        class {'java':}
        class {'elasticsearch':
                ensure => 'present',
                #enabled => ensure running + enabled true
                status => 'enabled',

                ###only works with the repository
                #version => '1.3.2',
                package_url => 'puppet:///files/deb/elasticsearch-0.90.13.deb',
        }
        elasticsearch::instance {'graylog2':}
        class {'mongodb':}
        class {'graylog2::repo':
                version => '0.21',
        } ->
        class {'graylog2::server':
                service_enable => 'true',
                rest_listen_uri => "http://${::ipaddress}:12900",
                rest_transport_uri => "http://${::ipaddress}:12900",
                #verysecurepw
                password_secret         => 'cdebc192e0ae1f5df753018a8d284b9eacf2042d55fb712f7a89260c3fc3668d',
                root_password_sha2      => 'cdebc192e0ae1f5df753018a8d284b9eacf2042d55fb712f7a89260c3fc3668d',
        } ->
        class {'graylog2::web':
                application_secret      => 'cdebc192e0ae1f5df753018a8d284b9eacf2042d55fb712f7a89260c3fc3668d',
                graylog2_server_uris            => ["http://${::ipaddress}:12900"],
        }

}

deb 包已成功下载并安装。当我使用自定义 elasticsearch 实例时,它会自动启动,如果我不这样做,实例就不会启动。

但是如果我尝试启动graylog-server,它会显示以下内容:

ERROR: Could not successfully connect to ElasticSearch. Check that your cluster state is not RED and that ElasticSearch is running properly.

检查 Elasticsearch 服务:

curl -XGET 'http://192.168.0.1:9200/_cluster/health?pretty=true'
{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 2,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0
}

看起来不错

查看网页 192.168.0.1:9000 时出现错误,提示 graylog-web 服务无法连接到服务器。

也许我缺少graylog和Elasticsearch之间的连接,但我似乎找不到它。

Graylog 错误日志:

2014-09-09T12:02:54.383+02:00 ERROR [ServiceManager] Service IndexerSetupService [FAILED] has failed in the STARTING state.
java.lang.IllegalStateException
        at org.graylog2.UI.exitHardWithWall(UI.java:40)
        at org.graylog2.indexer.Indexer.start(Indexer.java:205)
        at org.graylog2.initializers.IndexerSetupService.startUp(IndexerSetupService.java:66)
        at com.google.common.util.concurrent.AbstractIdleService$2$1.run(AbstractIdleService.java:54)
        at com.google.common.util.concurrent.Callables$3.run(Callables.java:95)
        at java.lang.Thread.run(Thread.java:745)
2014-09-09T12:02:54.394+02:00 ERROR [InputSetupService] Not starting any inputs because lifecycle is: Uninitialized?[LB:DEAD]
2014-09-09T12:02:54.404+02:00 INFO  [PeriodicalsService] Shutting down periodical [org.graylog2.periodical.DeflectorManagerThread].
2014-09-09T12:02:54.404+02:00 INFO  [PeriodicalsService] Shutdown of periodical [org.graylog2.periodical.DeflectorManagerThread] complete, took <0ms>.

---剪辑---

答案1

您需要使用 elastic search 版本 elasticsearch-0.90.10 他们说它与变更日志中的 elasticsearch-1.3.2 兼容,但我使用较新的 elasticsearch 时遇到了与您相同的错误

相关内容