./elasticsearch-plugin list
报错
future versions of Elasticsearch will require Java 11; your Java version from [/opt/module/jdk1.8.0_171/jre] does not meet this requirement
jdk版本过低,需要jdk11
原因:只配置了elasticsearch文件的jdk,没有配置elasticsearch-plugin
在elasticsearch-plugin文件中加入对应的jdk11配置
#!/bin/bash
#配置自己的jdk11
export JAVA_HOME=/opt/module/jdk-11.0.6
export PATH=$JAVA_HOME/bin:$PATH
#添加jdk判断
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA="/opt/module/jdk-11.0.6/bin/java"
else
JAVA=`which java`
fi
ES_MAIN_CLASS=org.elasticsearch.plugins.PluginCli \
ES_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/plugin-cli \
"`dirname "$0"`"/elasticsearch-cli \
"$@"
bin/elasticsearch -E node.name=node0 -E cluster.name=geektime -E path.data=node0_data -d
bin/elasticsearch -E node.name=node1 -E cluster.name=geektime -E path.data=node1_data -d
bin/elasticsearch -E node.name=node2 -E cluster.name=geektime -E path.data=node2_data -d
bin/elasticsearch -E node.name=node3 -E cluster.name=geektime -E path.data=node3_data -d
Logstash官网:https://www.elastic.co/cn/downloads/logstash
Logstash版本号要和Elasticsearch对应
放到 /opt/sofrware/下
解压
pt@pthost software]$ tar -zxvf logstash-7.6.2.tar.gz -C /opt/module/
进入logstash下的bin目录,创建logstash.conf文件添加配置
#代表控制台标准输入
input {
file {
#指定所要的数据文件路径
path => "/opt/module/logstash-7.6.2/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{
convert => {
"year" => "integer"
}
strip => ["title"]
remove_field => ["path","host","@timestamp","message","content"]
}
}
#输出到9200端口
output{
elasticsearch{
hosts => "http:/localhost:9200"
index => "movies"
document_id => "%{id}"
}
stdout{}
}
sudo ./logstash -f logstash.conf
[ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main,
经过检查,发现是配置文件logstash.conf里面的stdout后面缺少{}
元数据,用于标注文档的相关信息
Index -索引是文档的容器,是一类文档的结合
Index体现了逻辑空间的概念:每个索引都有自己的Mapping定义,用于定义包含的文档的字段名和字段类型
Shard体现了物理空间的概念:索引中的数据分散在Shard上
索引的 Mapping与Settings
Mapping定义文档字段的类型Setting定义不同的数据分布
每个节点启动后,默认就是一个Master eligible 节点
可以设置 node.master: false 禁止
Master- -eligible节 点可以参加选主流程,成为Master节点
当第一个节点启动时候,它会将自己选举成Master节点
每个节点上都保存了集群的状态,只有Master 节点才能修改集群的状态信息
集群状态 (Cluster State), 维护了一个集群中,必要的信息
任意节点都能修改信息会导致数据的不一致性