elasticsearch5.2.2 ik logstash5.2.2 搭建
来源:互联网 发布:js将base64转换成文件 编辑:程序博客网 时间:2024/05/17 14:29
elasticsearch5.2.2 安装 ik
https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.2.2/elasticsearch-analysis-ik-5.2.2.zip
1、直接到https://github.com/medcl/elasticsearch-analysis-ik/releases下载对应版本zip包
解压到elasticsearch的plugin目录下
unzip elasticsearch-analysis-ik-5.5.1.zip
2、使用elasticsearch-plugin命令安装
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.2.2/elasticsearch-analysis-ik-5.2.2.zip
重新启动elasticsearch
systemctl restart elasticsearch.service
logstash 配置 jdbc 到 es
logstash-5.2.2 jdbc install
1 下载 logstash-5.2.2
2 在bin install jdbc 插件
里面 新建 jdbc.conf jdbc.sql 文件
配置如下
jdbc.sql 文件
select * from domains where domains.id > :sql_last_value
stdin {
}
jdbc {
# mysql jdbc connection string to our backup databse 后面的test对应mysql中的test数据库
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/test"
# the user we wish to excute our statement as
jdbc_user => "root"
jdbc_password => ""
# the path to our downloaded jdbc driver
jdbc_driver_library => "D:\soft\es\logstash-5.2.2\bin\jdbc_test\mysql-connector-java-5.1.40-bin.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
record_last_run=>true
use_column_value => true
tracking_column => "id"
#以下对应着要执行的sql的绝对路径。
statement_filepath => "D:\soft\es\logstash-5.2.2\bin\jdbc_test\jdbc2.sql"
#以下对应着要要保存的自定义字段的值。
last_run_metadata_path=>"D:\soft\es\logstash-5.2.2\bin\jdbc_test\jdbc4"
#定时字段 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新(测试结果,不同的话请留言指出)
schedule => "* * * * *"
#设定ES索引类型
type => "ad_type"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
}
output {
elasticsearch {
#ESIP地址与端口
hosts => "127.0.0.1:9400"
#ES索引名称(自己定义的)
index => "ad"
#自增ID编号 对应的 es _id 唯一主键
document_id => "%{id}"
}
stdout {
#以JSON格式输出
codec => json_lines
}
5 执行 ./logstash.bat -f ./jdbc_test/jdbc.conf
./logstash.bat -f ./jdbc_test/jdbc2.conf
elasticsearch curl 命令
curl -XGET 'localhost:9400/_cat/health?v'
curl -XGET 'localhost:9400/_cat/indices?v'
curl -XGET http://127.0.0.1:9400/ad/ad_type/1?_source
https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.2.2/elasticsearch-analysis-ik-5.2.2.zip
1、直接到https://github.com/medcl/elasticsearch-analysis-ik/releases下载对应版本zip包
解压到elasticsearch的plugin目录下
unzip elasticsearch-analysis-ik-5.5.1.zip
2、使用elasticsearch-plugin命令安装
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.2.2/elasticsearch-analysis-ik-5.2.2.zip
重新启动elasticsearch
systemctl restart elasticsearch.service
logstash 配置 jdbc 到 es
logstash-5.2.2 jdbc install
1 下载 logstash-5.2.2
2 在bin install jdbc 插件
logstash-plugin install logstash-input-jdbc
里面 新建 jdbc.conf jdbc.sql 文件
配置如下
jdbc.sql 文件
select * from domains where domains.id > :sql_last_value
jdbc.conf 文件
stdin {
}
jdbc {
# mysql jdbc connection string to our backup databse 后面的test对应mysql中的test数据库
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/test"
# the user we wish to excute our statement as
jdbc_user => "root"
jdbc_password => ""
# the path to our downloaded jdbc driver
jdbc_driver_library => "D:\soft\es\logstash-5.2.2\bin\jdbc_test\mysql-connector-java-5.1.40-bin.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
record_last_run=>true
use_column_value => true
tracking_column => "id"
#以下对应着要执行的sql的绝对路径。
statement_filepath => "D:\soft\es\logstash-5.2.2\bin\jdbc_test\jdbc2.sql"
#以下对应着要要保存的自定义字段的值。
last_run_metadata_path=>"D:\soft\es\logstash-5.2.2\bin\jdbc_test\jdbc4"
#定时字段 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新(测试结果,不同的话请留言指出)
schedule => "* * * * *"
#设定ES索引类型
type => "ad_type"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
}
output {
elasticsearch {
#ESIP地址与端口
hosts => "127.0.0.1:9400"
#ES索引名称(自己定义的)
index => "ad"
#自增ID编号 对应的 es _id 唯一主键
document_id => "%{id}"
}
stdout {
#以JSON格式输出
codec => json_lines
}
}
5 执行 ./logstash.bat -f ./jdbc_test/jdbc.conf
./logstash.bat -f ./jdbc_test/jdbc2.conf
elasticsearch curl 命令
curl -XGET 'localhost:9400/_cat/health?v'
curl -XGET 'localhost:9400/_cat/indices?v'
curl -XGET http://127.0.0.1:9400/ad/ad_type/1?_source
阅读全文
0 0
- elasticsearch5.2.2 ik logstash5.2.2 搭建
- elasticsearch5.3.0+kibana5.3.0+logstash5.3.0搜索windows环境搭建
- Elasticsearch5.2.2集群搭建
- ELK(ElasticSearch5.1, Logstash5.1, Kibana5.1)搭建实时日志分析平台
- ElasticSearch5.4.3 环境搭建 2017 (6-IK中文分词插件)
- elasticsearch5.x集群搭建,ik分词器,head插件
- ElasticSearch5中文分词(IK)
- elasticsearch5 插件ik安装
- elasticsearch5.0 logstash5.0 Kibana5.0下载
- centos7下Elasticsearch5.2.2和head 插件环境搭建
- 安装Elasticsearch5.2.2和head 插件环境搭建
- centos6安装elasticsearch5.2.2
- ElasticSearch5.2.2 安装
- Elasticsearch5.2.2 安装教程
- Centos6.5下 logstash5.2.2 插件安装(实践成功)
- ElasticSearch5.0——IK词库加载
- elasticsearch5 ik+拼音分词_java代码
- Elasticsearch5.4.0 IK分词插件安装详解
- 【玩转云存储】对象存储OSS使用方法入门
- swift 带参,无参,函数加返回值。闭包
- win10 64SQLServer2008安装时报is not a valid login or you do not have permission的解决方法
- 深入理解Java:注解(Annotation)自定义注解入门
- leetcode 34 search for a range
- elasticsearch5.2.2 ik logstash5.2.2 搭建
- POJ
- MyBatis Generator操作说明
- BIRT集成WEB项目。
- 用JS获取地址栏的参数的方法
- PHP方法参数类型声明
- 递归遍历文件夹下所有文件
- 机器学习第3章第1节 : Anaconda3的安装和汉化
- C++多态简介