es7.6搭建

es官方文档: https://www.elastic.co/guide/index.html

  官方描述:Elasticsearch is the distributed search and analytics engine at the heart of the Elastic Stack. Logstash and Beats facilitate collecting, aggregating, and enriching your data and storing it in Elasticsearch. Kibana enables you to interactively explore, visualize, and share insights into your data and manage and monitor the stack. Elasticsearch is where the indexing, search, and analysis magic happen.(百度翻译:Elasticsearch是位于Elastic堆栈核心的分布式搜索和分析引擎。Logstash和Beats有助于收集、聚合和丰富数据,并将其存储在Elasticsearch中。Kibana使您能够以交互方式探索、可视化和共享对数据的见解,并管理和监视堆栈。Elasticsearch是索引、搜索和分析的神奇之处。)

  总之,elasticsearch 是处理数据的引擎。

 安装环境:Linux

 修改linux配置

 1 echo "fs.file-max=65536" >> /etc/sysctl.conf
 2 echo "vm.max_map_count=262144" >> /etc/sysctl.conf
 3 
 4 cat <<EOF >>/etc/security/limits.conf
 5 * soft nofile 65536
 6 * hard nofile 65536
 7 * soft nproc 65536
 8 * hard nproc 65536
 9 * soft memlock unlimited
10 * hard memlock unlimited
11 EOF

 

官网下载安装包:

#下载并解压
1
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz 2 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz.sha512 3 shasum -a 512 -c elasticsearch-7.6.2-linux-x86_64.tar.gz.sha512 4 tar -xzf elasticsearch-7.6.2-linux-x86_64.tar.gz 5 cd elasticsearch-7.6.2/

 

创建启动用户(es不能使用root用户启动):

1 #创建启动用户并修改权限
2 useradd es
3 
4 #创建数据存放目录
5 mkdir elasticsearch-7.6.2/data
6 
7 #修改es目录权限
8 chown -R es:es elasticsearch-7.6.2

单节点启动es:

1 # es家目录的bin下启动 
2 cd elasticsearch-7.6.2/bin/ 
3 bash elasticsearch

如下图表示启动成功。

 

 

 

 访问:

  ctrl+c 可以终止启动的es进程

  

1 # 后台启动es程序并将进程pid写入es家目录下pid文件
2 bash elasticsearch -d -p pid
3 # 等待启动成功后curl验证,返回信息如下图
4 curl 127.0.0.1:9200   
5 
6 # es家目录下执行终止进程
7 pkill -F pid

               

 

 

搭建集群:

修改配置文件:

egrep -v '^$|^#' jvm.options

 

 

分别启动三台节点

查看集群状态:

http://192.168.124.20:9200/_cluster/health?pretty

http://192.168.124.20:9200/_cat/nodes

http://192.168.124.20:9200/_nodes(节点详细信息)

 head插件安装:https://www.cnblogs.com/zhangxiaokui/p/15687593.html

 

 

 

参考:https://www.cnblogs.com/michael-xiang/p/13715692.html

posted @ 2021-12-14 10:39  zk01  阅读(93)  评论(0编辑  收藏  举报