ElasticSearch单节点模式的搭建

发布时间:2020-06-25 09:23:07 作者:asdud
来源:网络 阅读:2483

环境CentOS7
安装了JDK1.8
这里用的elasticsearch6.2.2为例,你也可以用5.6.1或者更高的版本

1.最好以非root用户解压ElasticSearch,如果用root用户,要不然以后还要将文件的权限以及组转移给非foot用户
1)解压elasticsearch-5.2.2.tar.gz到/opt/module目录下
[root@hdp21 ~]# su asy
[asy@hdp21 root]$ tar -zxvf elasticsearch-5.2.2.tar.gz -C /opt/module
2)在/opt/module/elasticsearch-5.2.2路径下创建data和logs文件夹
mkdir data
mkdir logs

如果你用root账号,请先添加一个非root账号,因为elaticsearch不能用root账号运行
user add asy
chown -R asy:asy /opt/module/elasticsearch-5.2.2/

3)root账号修改配置文件/opt/module/elasticsearch-5.2.2/config/elasticsearch.yml
[root@hdp21 config]# pwd
/opt/module/elasticsearch-5.2.2/config
[root@hdp21 config]# vi elasticsearch.yml
修改以下参数

---------------------------------- Cluster -------------------------------------

cluster.name: Asy

------------------------------------ Node --------------------------------------(三个不能一样)

node.name: node-1

----------------------------------- Paths ---------------------------------------

path.data: /opt/module/elasticsearch-5.2.2/data
path.logs: /opt/module/elasticsearch-5.2.2/logs

----------------------------------- Memory -----------------------------------

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

---------------------------------- Network ------------------------------------

network.host: hdp21
http.port: 9200

--------------------------------- Discovery ------------------------------------

discovery.zen.ping.unicast.hosts: ["hdp21"]

path.data
path.logs data和logs的路径

network.host ip地址或者host域名地址
http.port端口号

5)配置linux系统环境(参考:
(1)编辑limits.conf 添加类似如下内容
[root@hdp21 config]# vi /etc/security/limits.conf
添加如下内容:

退回到上一级目录
并执行命令:
[root@hdp21 config]# cd ..
[root@hdp21 elasticsearch-5.2.2]# pwd
/opt/module/elasticsearch-5.2.2

[root@hdp21 elasticsearch-5.2.2]# sysctl -p
然后,重新启动elasticsearch,即可启动成功。
6)启动elasticsearch
[asy@hdp21 elasticsearch-5.2.2]$ bin/elasticsearch
后台启动方式
[asy@hdp21 elasticsearch-5.2.2]$ bin/elasticsearch-d
7)测试elasticsearch
[root@hdp21 ~]# curl http://hdp21:9200
{
"name" : "node1",
"cluster_name" : "Asy",
"cluster_uuid" : "8T7xJ-NLTbmYHOPKa3a4tA",
"version" : {
"number" : "5.2.2",
"build_hash" : "f9d9b74",
"build_date" : "2017-02-24T17:26:45.835Z",
"build_snapshot" : false,
"lucene_version" : "6.4.1"
},
"tagline" : "You Know, for Search"
}

执行bin/elasticsearch的时候
如果有 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] 的报错

这个对应v/etc/security/limits.conf

Google浏览器调试Elastic Search
打开更多工具,扩展程序并且打开开发者模式
将elasticsearch-head.crx拖入浏览器窗口成功完成插件的安装
输入http://192.168.234.21:9200/
其中192.168.234.21为linux主机的IP地址,9200为端口号
ElasticSearch单节点模式的搭建

推荐阅读:
  1. 如何搭建和配置elasticsearch?
  2. ElasticSearch集群搭建

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

elasticsearch es search

上一篇:CHECKPOINT 发布R80.3版新特性

下一篇:纯HTML5 Canvas实现的饼图

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》