2016-12-13 4 views
0

2 개의 데이터 센터로 분할 된 고 가용성 graylog2 클러스터를 구성해야합니다. 첫 번째 데이터 센터가 완전히 다운 된 경우 두 번째 데이터 센터는 계속 작동해야하며 그 반대의 경우도 마찬가지입니다. (전면 오프로드에있는로드 밸런서)2 개의 데이터 센터가있는 고 가용성 Graylog (mongodb, elasticsearch) 로깅 시스템

예를 들어 각 데이터 센터에는 1 개의 탄성 검색, 1 개의 graylog 및 2 개의 mongodb 인스턴스가있을 수 있습니다. 결국 2 elasticsearch, 2 graylog 및 4 mongodb 인스턴스가 있습니다.

나는 mongodb 문서에서 읽었을 때 나는 그것에 대해 홀수의 유권자가 필요하다. 그래서 유권자가 3 명이라고 가정하십시오. (첫 번째 데이터 센터 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 : 설정은 2 MongoDB를의

감사합니다 ..

탄성 검색 1가 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를 1, 2 (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 2 :

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 

어떻게 그 이제까지 일 것이다, 두 ES 노드 중 하나가 다운 된 경우?

그리고 당신의 Graylog 구성

당신이 쓴 :

elasticsearch_shards = 2 
elasticsearch_replicas = 1 

어떻게 그 이제까지 일 것이다, 두 ES 노드 중 하나가 다운 된 경우?

간단한 대답 : 두 개의 서로 다른 데이터 센터 (WAN을 통해)에서 자율적 인 부품으로 고 가용성 클러스터를 만드는 것은 쉽지 않습니다.

다른 아키텍처를 사용하는 것이 좋습니다. 지. RabbitMQ 또는 Apache Kafka를 사용하여 로그 메시지를 버퍼링하고 Graylog (1 데이터 센터에서 실행)가 거기에서 메시지를 가져 오게합니다.

+0

답변 해 주셔서 감사합니다. 같은 시간에 위의 탄성 검색 설정을 업데이트했습니다. 이제 탄성 검색이 예상대로 작동합니다. 그러나 분할 뇌 가능성이 있단 말인가? 그러나 여전히 mongo db 문제. 귀하의 요지를 이해하지만 데이터 센터 1이 제대로 작동하지 않을 때 시스템을 완전히 작동시키지 못합니까? – Fethi

+0

elasticsearch의 샤드와 복제 설정을 변경하지 않았지만 첫 번째 머신에서 기본 샤드처럼 보이고 보조 머신은 복제본을 유지합니다. (그리고 내가 on-off 상황에서 변경된다는 것을 알고 있습니다.) 이상적인 값은 무엇입니까? 제안 해? 감사합니다. – Fethi

+0

"완전 작동 시스템"을 정의하십시오. 하나의 데이터 센터가 다운 된 경우 주어진 설정으로 "작업 시스템"을 사용할 수 없습니다. – joschi