美文网首页
logstash 多实例运行

logstash 多实例运行

作者: lily_佳忆 | 来源:发表于2018-12-07 13:34 被阅读71次

    执行logstash同步脚本时出现如下报错:

    Logstash could not be started because there is already another instance using the configured data directory. If you wish to run multiple instances, you must change the "path.data" setting

    将原先的命令:

    bin/logstash -f config/mailflow.conf

    改为:

    bin/logstash -f config/mailflow.conf --path.data=/logstash/mailflow

    其中,--path.data是指存放数据的路径

    同步最近1小时数据脚本:

    input {
    elasticsearch {
    hosts => "ESIP:9200" #配置 elasticsearch的地址及index
    index => "mailflow*"
    query => '{ "query": {"range":{"@timestamp": {"gte": "now-1h"}}}}'
    size => 10000 #配置遍历数据
    scroll => "5m" # 配置遍历时间间隔
    docinfo => true
    }
    }

    filter {
    mutate{
    convert => { "time-taken" => "integer" }
    }
    }

    output {
    elasticsearch {
    hosts => "esip:9200"
    index => "%{[@metadata][_index]}"
    document_type => "%{[@metadata][_type]}"
    document_id => "%{[@metadata][_id]}"
    }}

    相关文章

      网友评论

          本文标题:logstash 多实例运行

          本文链接:https://www.haomeiwen.com/subject/lfdthqtx.html