全文检索工具 elasticsearch5.6.4教程之Centos7.4系统环境详细安装

Elasticsearch官网: https://www.elastic.co/products/elasticsearch

elasticsearch-5.6.4下载链接: https://www.elastic.co/downloads/past-releases/elasticsearch-5-6-4

注意:CentOS6版本部分命令需要调整!

elasticsearch服务端口9200,elasticsearch可视化平台–kibana端口5601!

一、下载与安装elasticsearch

  拷贝elasticsearch-5.6.4.rpm/usr/local/software(自定义目录)目录下

[root@localhost software]# rpm -ivh elasticsearch-5.6.4.rpm  
二、注册并启动服务

(1)注册服务

[root@localhost software]# cd /etc/init.d/  
[root@localhost init.d]# ll
total 48
-rwxr-x---. 1 root root  5113 Nov  1  2017 elasticsearch
-rw-r--r--. 1 root root 17500 May  3  2017 functions
-rwxr-xr-x. 1 root root  4334 May  3  2017 netconsole
-rwxr-xr-x. 1 root root  7293 May  3  2017 network
-rw-r--r--. 1 root root  1160 Aug  5  2017 README
[root@localhost init.d]# systemctl list-unit-files|grep elasticsearch //查看服务
elasticsearch.service                         disabled
[root@localhost init.d]# systemctl enable elasticsearch.service  //修改服务
Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
//重启系统时elasticsearch也同时启动
[root@localhost init.d]# systemctl list-unit-files|grep elasticsearch    //查看服务
elasticsearch.service                         enabled 

☛【点击跳转链接】注意:首先修改elasticsearch初始、最大内存!!!!!

(2)启动服务

[root@localhost ~]# echo $JAVA_HOME   //依赖java环境
/usr/local/software/jdk1.8.0_152
 ----------------------------------------------------------------------------------------
[root@localhost ~]#vim /etc/sysconfig/elasticsearch     //【1】进入编辑模式进行属性的修改
 

在这里插入图片描述

[root@localhost local]# service elasticsearch start  //【2】启动elasticsearch服务(方式一)
Starting elasticsearch (via systemctl):                    [  OK  ]
[root@localhost local]## ps -ef|grep elastic  //查看进程

启动成功!!!

在这里插入图片描述

三、修改核心配置文件

vim /etc/elasticsearch/elasticsearch.yml
修改yml配置的注意事项:每行必须顶格,不能有空格“:”后面必须有一个空格!!!

cluster.name:my-es //默认集群环境--同一集群名称必须相同
node.name: node-1//开启节点--单个节点名称  
network.host: 192.168.43.111 //我的centos7.0的默认ip--端口号保持默认9200

#bootstrap.memory_lock: true 
bootstrap.memory_lock: false  //(修改)自检程序需要关闭
bootstrap.system_call_filter: false //自发现配置:新节点向集群报到的主机名
discovery.zen.ping.unicast.hosts: ["localhost.localdomain"]

查看hosts

[root@localhost ~]# hostname  //我自己的主机名
localhost.localdomain
四、修改Linux配置

  elasticsearch默认单机访问模式,只能自己访问自己,所以我们需要修改部分配置,支持更多的并发!

  系统允许 Elasticsearch 打开的最大文件数需要修改成65536

vi /etc/security/limits.conf

添加内容:

\* soft nofile 65536
\* hard nofile 131072
\* soft nproc 2048
\* hard nproc 65536

  不修改,可能会报错max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] elasticsearch!

五、reboot命令重启Linux
六、运行测试

[root@localhost ~]# curl http://192.168.43.111:9200

在这里插入图片描述

Windows浏览器测试

在这里插入图片描述

七、启动未成功,查看日志

vim /var/log/elasticsearch/my-es.log


 ☝上述分享来源个人总结,如果分享对您有帮忙,希望您积极转载;如果您有不同的见解,希望您积极留言,让我们一起探讨,您的鼓励将是我前进道路上一份助力,非常感谢!我会不定时更新相关技术动态,同时我也会不断完善自己,提升技术,希望与君同成长同进步!

☞本人博客:https://coding0110lin.blog.csdn.net/  欢迎转载,一起技术交流吧!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值