ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文检索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是当前流行的企业级搜索引擎。设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便。
网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、小程序设计、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了新邵免费建站欢迎大家使用!
1)JDK8以上环境
2)CentOS7.3,IP地址:192.168.144.112
3)elasticsearch6.3.2
yum install java -y
java -version 查看java版本
首先在官网当中下载es的软件包,本文采用压缩包解压缩安装方式启动服务。
tar zxvf elasticsearch-6.3.2.tar.gz -C /opt/
groupadd ela 创建ela组
useradd -g ela ela 创建ela用户,并且加入ela组
passwd ela 为ela用户设定登录密码
visudo(或者vim /etc/sudoers)
chown -R ela.ela /opt/elasticsearch-6.3.2/
ls -l /opt/elasticsearch-6.3.2/
su ela
[ela@localhost ~]$ cd /opt/elasticsearch-6.3.2/config/
[ela@localhost config]$ sudo vim elasticsearch.yml
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: abner //打开设定es群集名称
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1 //es当前节点名称,用于区分不同节点
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /data/es-data //修改数据目录,此目录为自定义,需要在root用户下创建,且属主属组更改为ela
#
# Path to log files:
#
path.logs: /var/log/elasticsearch //日志目录位置,需自己创建,方式同上
//yum安装则系统自定义,在软件版本或者系统升级时会被删除,所以建议修改
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: true //elasticsearch官网建议生产环境需要设置bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0 //监听访问地址为任意网段
#
# Set a custom port for HTTP:
#
http.port: 9200 //服务监听端口
#
sudo mkdir -p /data/es-data
sudo mkdir -p /var/log/elasticsearch
sudo chown -R ela.ela /data/
sudo chown -R ela.ela /var/log/elasticsearch
[ela@localhost /]$ cd /opt/elasticsearch-6.3.2/bin/
[ela@localhost bin]$ ./elasticsearch 后面可以跟上-d后台执行
-当发现如上图无法分配内存错误等,可执行如下操作。(需要在root用户权限下)
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
ela soft memlock unlimited
ela hard memlock unlimited
vim /etc/sysctl.conf
vm.max_map_count = 655360 //添加
sysctl -p
[ela@localhost abc]$ cd /opt/elasticsearch-6.3.2/bin/
[ela@localhost bin]$ ./elasticsearch
netstat -ntap | grep 9200
tcp6 0 0 :::9200 :::* LISTEN 2095/java
名称栏目:CentOS7.3下安装部署elasticsearch6.3.2详解
文章来源:http://www.csdahua.cn/qtweb/news10/256260.html
网站建设、网络推广公司-快上网,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网