直接执行:
brew tap elastic/tap
brew install elastic/tap/elasticsearch-full
brew install elastic/tap/logstash-full
brew install elastic/tap/kibana-full
后台启动
brew services start elastic/tap/elasticsearch-full
brew services start elastic/tap/kibana-full
brew services start elastic/tap/logstash-full
命令行启动
elasticsearch
kibana
logstash
关闭
brew services stop elastic/tap/elasticsearch-full
brew services stop elastic/tap/kibana-full
brew services stop elastic/tap/logstash-full
elasticsearch相关配置文件所在目录
Data: /opt/homebrew/var/lib/elasticsearch/elasticsearch_lixiyong/
Logs: /opt/homebrew/var/log/elasticsearch/elasticsearch_lixiyong.log
Plugins: /opt/homebrew/var/elasticsearch/plugins/
Config: /opt/homebrew/etc/elasticsearch/
Config: /opt/homebrew/etc/kibana/
Config: /opt/homebrew/etc/logstash/
用自定义配置文件启动logstash 关闭logstash
brew services stop elastic/tap/logstash-full
然后在任意位置创建test.conf
vim test.conf
内容如下:
input {
tcp {
port => 5044
codec => json_lines
}
}
output{
elasticsearch {
hosts => ["localhost:9200"]
}
}
启动
logstash -f test.conf
[1] 24185
Using bundled JDK: /opt/homebrew/Cellar/logstash-full/7.14.0/libexec/jdk.app/Contents/Home
? ELK OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
/opt/homebrew/Cellar/logstash-full/7.14.0/libexec/vendor/bundle/jruby/2.5.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated
Sending Logstash logs to /opt/homebrew/Cellar/logstash-full/7.14.0/libexec/logs which is now configured via log4j2.properties
[2021-08-20T19:29:24,323][INFO ][logstash.runner ] Log4j configuration path used is: /opt/homebrew/Cellar/logstash-full/7.14.0/libexec/config/log4j2.properties
[2021-08-20T19:29:24,333][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.14.0", "jruby.version"=>"jruby 9.2.19.0 (2.5.8) 2021-06-15 55810c552b OpenJDK 64-Bit Server VM 11.0.11+9 on 11.0.11+9 +indy +jit [darwin-x86_64]"}
[2021-08-20T19:29:24,431][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
这个配置对应logback-spring.xml
<!-- 为logstash输出的JSON格式的Appender -->
<appender name="logstash"
class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>127.0.0.1:5044</destination>
<!-- 日志输出编码 -->
<encoder
class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<timestamp>
操作日志:
Last login: Fri Aug 20 07:53:31 on ttys000
? ~ brew tap elastic/tap
==> Tapping elastic/tap
Cloning into '/opt/homebrew/Library/Taps/elastic/homebrew-tap'...
remote: Enumerating objects: 1035, done.
remote: Counting objects: 100% (276/276), done.
remote: Compressing objects: 100% (175/175), done.
remote: Tot
al 1035 (delta 199), reused 148 (delta 100), pack-reused 759
Receiving objects: 100% (1035/1035), 250.53 KiB | 317.00 KiB/s, done.
Resolving deltas: 100% (785/785), done.
Tapped 17 formulae (37 files, 353.2KB).
? ~ brew install elastic/tap/elasticsearch-full
==> Installing elasticsearch-full from elastic/tap
==> Downloading https://artifacts.elastic.co/downloads/elasticsearch/elasticsear
Warning: Tried to install empty array to /opt/homebrew/etc/elasticsearch/jvm.options.d
==> codesign -f -s - /opt/homebrew/Cellar/elasticsearch-full/7.14.0/libexec/modu
==> find /opt/homebrew/Cellar/elasticsearch-full/7.14.0/libexec/jdk.app/Contents
==> Caveats
Data: /opt/homebrew/var/lib/elasticsearch/elasticsearch_lixiyong/
Logs: /opt/homebrew/var/log/elasticsearch/elasticsearch_lixiyong.log
Plugins: /opt/homebrew/var/elasticsearch/plugins/
Config: /opt/homebrew/etc/elasticsearch/
To have launchd start elastic/tap/elasticsearch-full now and restart at login:
brew services start elastic/tap/elasticsearch-full
Or, if you don't want/need a background service you can just run:
elasticsearch
==> Summary
🍺 /opt/homebrew/Cellar/elasticsearch-full/7.14.0: 962 files, 522.4MB, built in 8 seconds
? ~ brew install elastic/tap/logstash-full
==> Installing logstash-full from elastic/tap
==> Downloading https://artifacts.elastic.co/downloads/logstash/logstash-7.14.0-
######################################################################## 100.0%
==> find /opt/homebrew/Cellar/logstash-full/7.14.0/libexec/jdk.app/Contents/Home
==> Caveats
Please read the getting started guide located at:
https://www.elastic.co/guide/en/logstash/current/getting-started-with-logstash.html
To have launchd start elastic/tap/logstash-full now and restart at login:
brew services start elastic/tap/logstash-full
Or, if you don't want/need a background service you can just run:
logstash
==> Summary
🍺 /opt/homebrew/Cellar/logstash-full/7.14.0: 13,664 files, 586.0MB, built in 15 seconds
? ~ brew install elastic/tap/kibana-full
==> Installing kibana-full from elastic/tap
==> Downloading https://artifacts.elastic.co/downloads/kibana/kibana-7.14.0-darw
==> Caveats
Config: /opt/homebrew/etc/kibana/
If you wish to preserve your plugins upon upgrade, make a copy of
/opt/homebrew/opt/kibana-full/plugins before upgrading, and copy it into the
new keg location after upgrading.
To have launchd start elastic/tap/kibana-full now and restart at login:
brew services start elastic/tap/kibana-full
Or, if you don't want/need a background service you can just run:
kibana
==> Summary
🍺 /opt/homebrew/Cellar/kibana-full/7.14.0: 51,328 files, 775.4MB, built in 36 seconds
? ~
|