Mac elasticsearch、logstash、kibana 的简单安装

转载自:https://princeli.com/mac安装elasticsearch、logstash、kibana/

elasticsearch安装
1.安装

brew install elasticsearch
安装目录:/usr/local/Cellar/elasticsearch/{elasticsearch-version}/

日志目录:/usr/local/var/log/elasticsearch/

插件目录:/usr/local/var/elasticsearch/plugins/

配置目录:/usr/local/etc/elasticsearch/

2.启动

brew services start elasticsearch
首次启动,默认的端口号是9200,用户名是elastic,密码changeme

kibana
1.安装

brew install kibana
安装目录:/usr/local/Cellar/kibana/{kibana-version}/

配置目录:/usr/local/etc/kibana/

2.修改配置文件

vi /usr/local/etc/kibana/kibana.yml

erver.name: kibana
server.port: 5601
server.host: “localhost”
elasticsearch.hosts: “http://localhost:9200”
elasticsearch.username: “elastic”
elasticsearch.password: “changeme”
i18n.locale: “zh-CN”
3.启动

brew services start kibana
首次启动,默认端口号是5601,打开浏览器访问http://localhost:5601访问kibana管理页面,会弹框要求输入用户名密码,输入elastic和123456即可。

logstash
1.安装

brew install logstash
安装目录:/usr/local/Cellar/logstash/{logstash-version}/

2.安装插件

cd /usr/local/Cellar/logstash/{logstash-version}/
./logstash-plugin install logstash-input-jdbc
3.编辑配置文件

vi jdbc.conf

input {
jdbc {
jdbc_driver_library => “mysql连接jar包”
jdbc_driver_class => “com.mysql.jdbc.Driver”
jdbc_connection_string => “jdbc:mysql://数据库地址及数据库?useUnicode=true&characterEncoding=utf8&useSSL=false”
jdbc_user => “数据库账号”
jdbc_password => “数据库密码”
schedule => “* * * * "
jdbc_paging_enabled => true
statement => “select * from tb_item”
}
jdbc {
jdbc_driver_library => “mysql连接jar包”
jdbc_driver_class => “com.mysql.jdbc.Driver”
jdbc_connection_string => “jdbc:mysql://数据库地址及数据库?useUnicode=true&characterEncoding=utf8&useSSL=false”
jdbc_user => “数据库账号”
jdbc_password => “数据库密码”
schedule => "
* * * *”
jdbc_paging_enabled => true
#执行语句
statement => “select * from tb_item where updated > :sql_last_value”
#使用数据库表的列
use_column_value => true
tracking_column => “updated”
tracking_column_type => “timestamp”
#这是存放上一次执行之后id的值
last_run_metadata_path => “lastUpdated.txt”
}
}

output {
#输入es地址
elasticsearch {
hosts => [“172.26.43.37:9200”]
# 索引名字,必须小写
index => “tb_item”
# 数据唯一索引
document_id => “%{id}”
}
stdout { codec => json_lines }
}
4.执行脚本

./logstash -f jdbc.conf
filebeat
安装

brew install filebeat
安装目录:/usr/local/Cellar/filebeat/{filebeat-version}/

配置目录:/usr/local/etc/filebeat/

缓存目录:/usr/local/var/lib/filebeat/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值