在启动logstash过程中出现了无法启动的情况,事情经过是这样的,首先我在第一次启动的过程中是正常的可以正常运行,就像下方代码显示:在输入hello word 后,logstash可以正常输出。
[root@hadoop bin]# logstash -e ""
Thread.exclusive is deprecated, use Thread::Mutex
Sending Logstash logs to /home/fy/logstash-7.3.1/logs which is now configured via log4j2.properties
[2019-09-05T10:10:41,658][INFO ][logstash.setting.writabledirectory] Creating directory {:setting=>"path.queue", :path=>"/home/fy/logstash-7.3.1/data/queue"}
[2019-09-05T10:10:41,717][INFO ][logstash.setting.writabledirectory] Creating directory {:setting=>"path.dead_letter_queue", :path=>"/home/fy/logstash-7.3.1/data/dead_letter_queue"}
[2019-09-05T10:10:42,979][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-09-05T10:10:43,013][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.3.1"}
[2019-09-05T10:10:43,095][INFO ][logstash.agent ] No persistent UUID file found. Generating new UUID {:uuid=>"000c94c3-b243-40fd-84e1-42673919b0fa", :path=>"/home/fy/logstash-7.3.1/data/uuid"}
[2019-09-05T10:10:46,771][INFO ][org.reflections.Reflections] Reflections took 157 ms to scan 1 urls, producing 19 keys and 39 values
[2019-09-05T10:10:51,622][WARN ][org.logstash.instrument.metrics.gauge.LazyDelegatingGauge] A gauge metric of an unknown type (org.jruby.RubyArray) has been create for key: cluster_uuids. This may result in invalid serialization. It is recommended to log an issue to the responsible developer/development team.
[2019-09-05T10:10:51,630][INFO ][logstash.javapipeline ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>2, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>250, :thread=>"#<0x4feaae87 run>"}
[2019-09-05T10:10:51,835][INFO ][logstash.javapipeline ] Pipeline started {"pipeline.id"=>"main"}
The stdin plugin is now waiting for input:
[2019-09-05T10:10:52,072][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2019-09-05T10:10:53,157][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
hello world!
/home/fy/logstash-7.3.1/vendor/bundle/jruby/2.5.0/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
{
"@version" => "1",
"message" => "hello world!",
"@timestamp" => 2019-09-05T02:12:03.103Z,
"host" => "hadoop",
"type" => "stdin"
}
^Z
[1]+ 已停止 logstash -e ""
0x4feaae87>
然后重点来了,想做其他操作,但是这个命令行一直挂着怎么办,果断ctrl+c大法,成功停止
忙完其他操作后又想继续尝试,然后继续运行命令,结果出问题了。
[root@hadoop bin]# logstash -e ""
Thread.exclusive is deprecated, use Thread::Mutex
Sending Logstash logs to /home/fy/logstash-7.3.1/logs which is now configured via log4j2.properties
[2019-09-05T11:26:03,915][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-09-05T11:26:03,942][FATAL][logstash.runner ] 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.
[2019-09-05T11:26:03,959][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
[root@hadoop bin]#
服务开始报错,习惯性的将错误信息复制粘贴搜索引擎,结果查询无果后自己开始看令人头大的报错信息,其中看到“ 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.”时记得在logstash根目录下有data这个目录,随后为了保险起见,我将data文件夹换了一个名字dataa,然后回到bin目录下尝试启动了一下,em,成功启动了。
这里要提醒一下,保险起见,不要乱删文件夹,没有数据还好,要是有数据的话哭都来不及~