2016-12-13 6 views
0

2つのデータセンターに分割された高可用性graylog2クラスターを構成する必要があります。最初のデータセンタが完全に停止している場合、2番目のデータセンタは動作を継続しなければならず、その逆もあります。2つのデータセンターを持つ高可用性Graylog(mongodb、elasticsearch)ロギングシステム

たとえば、各データセンターは、1つのelasticsearch、1つのgraylog、2つのmongodbインスタンスを持つことができます。最後に私は2つのelasticsearch、2つのgraylogと4つのmongodbインスタンスを持っています。

私はmongodbのドキュメントから読んだので、奇数の投票者が必要です。だから、有権者は3人だけであると仮定します。 (最初のデータセンター2と2番目のデータセンター1)

一部の構成では、弾性検索は期待通りに機能します。しかし、だから、任意のデータセンターのcircumtance下で2つのデータセンターで高い利用できる設定を行うことが可能です

をMongoDBの:(ない完全にダウン

最後に、私は私のconfigsを共有したいされ 注:?。私の現在

cluster.name: graylog 
    node.name: graylog-1 
    network.host: 0.0.0.0 
    http.port: 9200 
    discovery.zen.ping.multicast.enabled: false 
    discovery.zen.ping.unicast.hosts: ["10.0.0.2"] 
    discovery.zen.minimum_master_nodes: 1 
    index.number_of_replicas: 2 

ELAST:configがちょうど2のMongoDBの

おかげ..

弾性検索第一を持っていますIC検索第2回:

cluster.name: graylog 
    node.name: graylog-2 
    network.host: 0.0.0.0 
    http.port: 9200 
    discovery.zen.ping.multicast.enabled: false 
    discovery.zen.ping.unicast.hosts: ["10.0.0.1"] 
    discovery.zen.minimum_master_nodes: 1 

のMongoDB第一及び第二(rs.conf()):

{ 
     "_id" : "rs0", 
     "version" : 4, 
     "protocolVersion" : NumberLong(1), 
     "members" : [ 
       { 
         "_id" : 0, 
         "host" : "10.0.0.1:27017", 
         "arbiterOnly" : false, 
         "buildIndexes" : true, 
         "hidden" : false, 
         "priority" : 1, 
         "tags" : { 

         }, 
         "slaveDelay" : NumberLong(0), 
         "votes" : 1 
       }, 
       { 
         "_id" : 1, 
         "host" : "10.0.0.2:27017", 
         "arbiterOnly" : false, 
         "buildIndexes" : true, 
         "hidden" : false, 
         "priority" : 1, 
         "tags" : { 

         }, 
         "slaveDelay" : NumberLong(0), 
         "votes" : 1 
       } 
     ], 
     "settings" : { 
       "chainingAllowed" : true, 
       "heartbeatIntervalMillis" : 2000, 
       "heartbeatTimeoutSecs" : 10, 
       "electionTimeoutMillis" : 10000, 
       "getLastErrorModes" : { 

       }, 
       "getLastErrorDefaults" : { 
         "w" : 1, 
         "wtimeout" : 0 
       }, 
       "replicaSetId" : ObjectId("****") 
     } 
    } 

graylog 1日:

is_master = true 
    node_id_file = /etc/graylog/server/node-id 
    password_secret = *** 
    root_password_sha2 = *** 
    plugin_dir = /usr/share/graylog-server/plugin 
    rest_listen_uri = http://10.0.0.1:9000/api/ 
    web_listen_uri = http://10.0.0.1:9000/ 
    rotation_strategy = count 
    elasticsearch_max_docs_per_index = 20000000 
    rotation_strategy = count 
    elasticsearch_max_docs_per_index = 20000000 
    elasticsearch_max_number_of_indices = 20 
    retention_strategy = delete 
    elasticsearch_max_number_of_indices = 20 
    retention_strategy = delete 
    elasticsearch_shards = 2 
    elasticsearch_replicas = 1 
    elasticsearch_index_prefix = graylog 
    allow_leading_wildcard_searches = false 
    allow_highlighting = false 
    elasticsearch_discovery_zen_ping_unicast_hosts = 10.0.0.1:9300, 10.0.0.2:9300 
    elasticsearch_network_host = 0.0.0.0 
    elasticsearch_analyzer = standard 
    output_batch_size = 500 
    output_flush_interval = 1 
    output_fault_count_threshold = 5 
    output_fault_penalty_seconds = 30 
    processbuffer_processors = 5 
    outputbuffer_processors = 3 
    processor_wait_strategy = blocking 
    ring_size = 65536 
    inputbuffer_ring_size = 65536 
    inputbuffer_processors = 2 
    inputbuffer_wait_strategy = blocking 
    message_journal_enabled = true 
    message_journal_dir = /var/lib/graylog-server/journal 
    lb_recognition_period_seconds = 3 
    mongodb_uri = mongodb://10.0.0.1,10.0.0.2/graylog 
    mongodb_max_connections = 1000 
    mongodb_threads_allowed_to_block_multiplier = 5 
    content_packs_dir = /usr/share/graylog-server/contentpacks 
    content_packs_auto_load = grok-patterns.json 
    proxied_requests_thread_pool_size = 32 

graylog第二:

is_master = false 
    node_id_file = /etc/graylog/server/node-id 
    password_secret = *** 
    root_password_sha2 = *** 
    plugin_dir = /usr/share/graylog-server/plugin 
    rest_listen_uri = http://10.0.0.2:9000/api/ 
    web_listen_uri = http://10.0.0.2:9000/ 
    rotation_strategy = count 
    elasticsearch_max_docs_per_index = 20000000 
    rotation_strategy = count 
    elasticsearch_max_docs_per_index = 20000000 
    elasticsearch_max_number_of_indices = 20 
    retention_strategy = delete 
    elasticsearch_max_number_of_indices = 20 
    retention_strategy = delete 
    elasticsearch_shards = 2 
    elasticsearch_replicas = 1 
    elasticsearch_index_prefix = graylog 
    allow_leading_wildcard_searches = false 
    allow_highlighting = false 
    elasticsearch_discovery_zen_ping_unicast_hosts = 10.0.0.1:9300, 10.0.0.2:9300 
    elasticsearch_transport_tcp_port = 9350 
    elasticsearch_network_host = 0.0.0.0 
    elasticsearch_analyzer = standard 
    output_batch_size = 500 
    output_flush_interval = 1 
    output_fault_count_threshold = 5 
    output_fault_penalty_seconds = 30 
    processbuffer_processors = 5 
    outputbuffer_processors = 3 
    processor_wait_strategy = blocking 
    ring_size = 65536 
    inputbuffer_ring_size = 65536 
    inputbuffer_processors = 2 
    inputbuffer_wait_strategy = blocking 
    message_journal_enabled = true 
    message_journal_dir = /var/lib/graylog-server/journal 
    lb_recognition_period_seconds = 3 
    mongodb_uri = mongodb://10.0.0.1,10.0.0.2/graylog 
    mongodb_max_connections = 1000 
    mongodb_threads_allowed_to_block_multiplier = 5 
    content_packs_dir = /usr/share/graylog-server/contentpacks 
    content_packs_auto_load = grok-patterns.json 
    proxied_requests_thread_pool_size = 32 

答えて

0

あなたの設定ファイルには多くの誤解があります。例えば

は、あなたのElasticsearch設定であなたが書いた:

discovery.zen.minimum_master_nodes: 2 

を2 ESノードのいずれかがダウンした場合には、これまで、どのように動作しますか?

そして、あなたのGraylog設定であなたが書いた:

elasticsearch_shards = 2 
elasticsearch_replicas = 1 

を2 ESノードのいずれかがダウンした場合には、これまで、どのように動作しますか?

簡単な答え:2つの異なるデータセンター(WAN経由)に自律型部品を備えた高可用性クラスタを作成することは容易ではありません。

別のアーキテクチャに頼っておくことをお勧めします。 g。 RabbitMQまたはApache Kafkaを使用してログメッセージをバッファし、Graylog(1データセンターで実行)がそこからメッセージをプルするようにします。

+0

答えをありがとう。同じ時間に私は上記の弾性検索設定を更新しました。今弾力的な検索が期待通りに機能します。しかしスプリット・ブレインの可能性はあるのでしょうか?それでもmongo dbの問題。私はあなたのことを理解していますが、データセンター1がダウンしているときには、完全に稼働しているシステムを提供していませんか? – Fethi

+0

私はelasticsearchのシャードとレプリカの設定を変更しませんでしたが、最初のマシンではプライマリシャードになり、セカンダリではレプリカのみが保持されます(オンとオフの状況で変更されることがわかります)。提案する?おかげで – Fethi

+0

"完全に動作するシステム"を定義してください。 1つのデータセンターがダウンしている場合、特定のセットアップでは、とにかく「現用システム」はありません。 – joschi

関連する問題