2013-04-09 10 views
14

Nhận các thông báo cảnh báo dưới đây liên tục. Không chắc nên làm gì. Đã thấy một số bài đăng có liên quan yêu cầu tăng số lượng mô tả tệp.Quá nhiều cảnh báo tệp mở từ elasticsearch

Làm cách nào để thực hiện tương tự?

Thậm chí nếu tôi tăng ngay bây giờ, tôi có gặp vấn đề tương tự khi thêm các chỉ mục mới hay không. (hiện đang làm việc với khoảng 400 chỉ mục, 6 mảnh và 1 bản sao). Số lượng chỉ số có xu hướng tăng thêm.

[03:58:24,165][WARN ][cluster.action.shard  ] [node1] received shard failed for [index9][2], node[node_hash3], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[index9][2] failed recovery]; nested: EngineCreationFailureException[[index9][2] failed to open reader on writer]; nested: FileNotFoundException[/data/elasticsearch/whatever/nodes/0/indices/index9/2/index/segments_1 (Too many open files)]; ]] 
[03:58:24,166][WARN ][cluster.action.shard  ] [node1] received shard failed for [index15][0], node[node_hash2], [P], s[INITIALIZING], reason [Failed to create shard, message [IndexShardCreationException[[index15][0] failed to create shard]; nested: IOException[directory '/data/elasticsearch/whatever/nodes/0/indices/index15/0/index' exists and is a directory, but cannot be listed: list() returned null]; ]] 
[03:58:24,195][WARN ][cluster.action.shard  ] [node1] received shard failed for [index16][3], node[node_hash3], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[index16][3] failed recovery]; nested: EngineCreationFailureException[[index16][3] failed to open reader on writer]; nested: FileNotFoundException[/data/elasticsearch/whatever/nodes/0/indices/index16/3/index/segments_1 (Too many open files)]; ]] 
[03:58:24,196][WARN ][cluster.action.shard  ] [node1] received shard failed for [index17][0], node[node_hash3], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[index17][0] failed recovery]; nested: EngineCreationFailureException[[index17][0] failed to open reader on writer]; nested: FileNotFoundException[/data/elasticsearch/whatever/nodes/0/indices/index17/0/index/segments_1 (Too many open files)]; ]] 
[03:58:24,198][WARN ][cluster.action.shard  ] [node1] received shard failed for [index21][4], node[node_hash3], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[index21][4] failed recovery]; nested: EngineCreationFailureException[[index21][4] failed to create engine]; nested: LockReleaseFailedException[Cannot forcefully unlock a NativeFSLock which is held by another indexer component: /data/elasticsearch/whatever/nodes/0/indices/index21/4/index/write.lock]; ]] 

Output của các nút api

curl -XGET 'http://localhost:9200/_nodes?os=true&process=true&pretty=true' 

{ 
    "ok" : true, 
    "cluster_name" : "whatever", 
    "nodes" : { 
    "node_hash1" : { 
     "name" : "node1", 
     "transport_address" : "transportip1", 
     "hostname" : "myhostip1", 
     "version" : "0.20.4", 
     "http_address" : "httpip1", 
     "attributes" : { 
     "data" : "false", 
     "master" : "true" 
     }, 
     "os" : { 
     "refresh_interval" : 1000, 
     "available_processors" : 8, 
     "cpu" : { 
      "vendor" : "Intel", 
      "model" : "Xeon", 
      "mhz" : 2133, 
      "total_cores" : 8, 
      "total_sockets" : 8, 
      "cores_per_socket" : 16, 
      "cache_size" : "4kb", 
      "cache_size_in_bytes" : 4096 
     }, 
     "mem" : { 
      "total" : "7gb", 
      "total_in_bytes" : 7516336128 
     }, 
     "swap" : { 
      "total" : "30gb", 
      "total_in_bytes" : 32218378240 
     } 
     }, 
     "process" : { 
     "refresh_interval" : 1000, 
     "id" : 26188, 
     "max_file_descriptors" : 16384 
     } 
    }, 
    "node_hash2" : { 
     "name" : "node2", 
     "transport_address" : "transportip2", 
     "hostname" : "myhostip2", 
     "version" : "0.20.4", 
     "attributes" : { 
     "master" : "false" 
     }, 
     "os" : { 
     "refresh_interval" : 1000, 
     "available_processors" : 4, 
     "cpu" : { 
      "vendor" : "Intel", 
      "model" : "Xeon", 
      "mhz" : 2400, 
      "total_cores" : 4, 
      "total_sockets" : 4, 
      "cores_per_socket" : 32, 
      "cache_size" : "20kb", 
      "cache_size_in_bytes" : 20480 
     }, 
     "mem" : { 
      "total" : "34.1gb", 
      "total_in_bytes" : 36700303360 
     }, 
     "swap" : { 
      "total" : "0b", 
      "total_in_bytes" : 0 
     } 
     }, 
     "process" : { 
     "refresh_interval" : 1000, 
     "id" : 24883, 
     "max_file_descriptors" : 16384 
     } 
    }, 
    "node_hash3" : { 
     "name" : "node3", 
     "transport_address" : "transportip3", 
     "hostname" : "myhostip3", 
     "version" : "0.20.4", 
     "attributes" : { 
     "master" : "false" 
     }, 
     "os" : { 
     "refresh_interval" : 1000, 
     "available_processors" : 4, 
     "cpu" : { 
      "vendor" : "Intel", 
      "model" : "Xeon", 
      "mhz" : 2666, 
      "total_cores" : 4, 
      "total_sockets" : 4, 
      "cores_per_socket" : 16, 
      "cache_size" : "8kb", 
      "cache_size_in_bytes" : 8192 
     }, 
     "mem" : { 
      "total" : "34.1gb", 
      "total_in_bytes" : 36700303360 
     }, 
     "swap" : { 
      "total" : "0b", 
      "total_in_bytes" : 0 
     } 
     }, 
     "process" : { 
     "refresh_interval" : 1000, 
     "id" : 25328, 
     "max_file_descriptors" : 16384 
     } 
    } 
    } 
+0

@Vamshi Krishna: nếu bạn có thể trợ giúp ở đây http://stackoverflow.com/questions/28082825/elasticsearch-log-file-huge-size-performance-degradation – inquisitive

+0

Đây không phải là cảnh báo. Đó là một lỗi. Bạn không thể mở tệp. – EJP

Trả lời

12

Làm thế nào để tăng số lượng tối đa của tập tin đang mở cho phép phụ thuộc một chút về bản phân phối Linux của bạn. Dưới đây là một số hướng dẫn cho ubuntu và centos:

tài liệu

http://posidev.com/blog/2009/06/04/set-ulimit-parameters-on-ubuntu/ http://pro.benjaminste.in/post/318453669/increase-the-number-of-file-descriptors-on-centos-and

Các elasticsearch khuyến cáo thiết lập các giới hạn tập tin tối đa cho 32k hoặc 64k. Vì bạn đang ở độ tuổi 16k và đã đạt đến giới hạn, tôi có thể đặt nó cao hơn; một cái gì đó như 128k. Xem: http://www.elasticsearch.org/guide/reference/setup/installation/

Sau khi nâng tỉ số này số lượng tập tin mở và khởi động lại elasticsearch bạn sẽ muốn kiểm tra xem nó hoạt động bằng cách chạy lại lệnh curl bạn đề cập:

curl -XGET 'http://localhost:9200/_nodes?os=true&process=true&pretty=true' 

Khi bạn thêm các chỉ số (cùng với nhiều tài liệu hơn), bạn cũng sẽ thấy số lượng tập tin elasticsearch theo dõi sự gia tăng. Nếu bạn nhận thấy sự suy giảm hiệu năng với tất cả các chỉ báo và tài liệu, bạn có thể thử thêm một nút mới vào cụm của bạn: http://www.elasticsearch.org/guide/reference/setup/configuration/ - vì bạn đã có cấu hình được nhân bản, được sao chép, đây là một quá trình tương đối không đau.

+0

Xin chào @Dan Noble cảm ơn thông tin. Ulimit của tôi đã được thiết lập để 65535. Làm thế nào đến elasticsearch được lấy chỉ 16384? Tôi có cần phải thay đổi trong cài đặt trong tập tin cấu hình để có được bộ ulimit bởi hệ điều hành ...? –

+0

có chính xác. bạn có làm cho nó hoạt động không? –

+1

Rất tiếc ... xin lỗi tôi đã chấp nhận câu trả lời. Nhưng quên đề cập đến như vậy. Có, tôi đã phải thay đổi tương tự ở cấp hệ điều hành để có được giới hạn cập nhật. Nhận xét của bạn đã giúp ích rất nhiều. Cảm ơn @Dan –

0
  1. Dừng tìm kiếm đàn hồi. nếu bạn bắt đầu từ lệnh như (bin/elasticsearch) thì vui lòng cụ thể điều này để thiết lập heap trong khi bắt đầu. Ví dụ, tôi sử dụng hộp 16 GB để lệnh của tôi là

    a. bin/elasticsearch -Xmx8g -Xms8g

    b. Tới config (elasticsearch/config/elasticsearch.yml) và đảm bảo rằng

    bootstrap.mlockall: true

    c. Tăng ulimits -Hnulimits -Sn đến hơn hơn 200000

  2. Nếu bạn bắt đầu như một dịch vụ, sau đó làm như sau

    a. xuất ES_HEAP_SIZE = 10g b. Chuyển đến cấu hình (/etc/elasticsearch/elasticsearch.yml) và đảm bảo rằng

    bootstrap.mlockall: true c.Tăng ulimits -Hnulimits -Sn để hơn 200000

Hãy chắc chắn rằng kích thước bạn nhập không phải là hơn 50% của heap cho dù bạn bắt đầu nó như là một dịch vụ hoặc từ dòng lệnh