作者:mobiledu2502907117 | 来源:互联网 | 2023-08-12 11:50
ElasticSearch系列-安装ElasticSearch安装elasticSearch下载选择MACOS下载,然后解压zip包Elasticsearch目
ElasticSearch系列 - 安装
ElasticSearch 安装
elasticSearch下载
选择MACOS 下载,然后解压zip包
Elasticsearch目录结构为:
目录 | 配置文件 | 描述 |
---|
bin | | 脚本文件,包括起点elasticsearch。安装插件,运行统计数据等 |
config | elasticsearch.yml | 集群配置文件,user,role based相关配置 |
JDK | | java运行环境 |
data | path.data | 数据文件 |
lib | | java类库 |
logs | path.log | 日志文件 |
modules | | 包含所有ES模块 |
plugins | | 包含所有已安装插件 |
启动Elasticsearch
输入localhost:9200
正常启动
查看安装插件
Kibanna安装
Kibanna下载地址
选择MAC 下载安装包,解压
运行Kibanna
PS:Kibanna必须在elasticsearch运行后才可以启动
输入localhost:5601
显示已经正常启动
Logstash 安装
logstash下载地址
下载ZIP,解压
加载数据进ElasticSearch,需要覆盖config文件夹中的logstash.conf文件
这个文件是配置数据转换格式的,定义input,输出ouput
input {file {path => "/Users/aaron/Documents/Infrastructure/logstash-7.3.1/bin/movies.csv"start_position => "beginning"sincedb_path => "/dev/null"}
}
filter {csv {separator => ","columns => ["id","content","genre"]}mutate {split => { "genre" => "|" }remove_field => ["path", "host","@timestamp","message"]}mutate {split => ["content", "("]add_field => { "title" => "%{[content][0]}"}add_field => { "year" => "%{[content][1]}"}}
# mutate {# gsub => [
#
# "year", "\\)", ""
# ]
# }mutate {convert => {"year" => "integer"}strip => ["title"]remove_field => ["path", "host","@timestamp","message","content"]}
}
output {elasticsearch {hosts => "http://localhost:9200"index => "movies"document_id => "%{id}"}stdout {}
}
然后执行logstash命令