linux 安装 Elasticsearch记录

2018-06-20  本文已影响0人  黄二狗V

1 jdk安装

安装JDK1.8版本以上,因为他是依赖JDK的,Elasticsearch也是Java开发的。

2 Elasticsearch安装

2.1 下载安装包
2.2 配置修改
groupadd elsearch
useradd elsearch -g elsearch
//更改elasticsearch-6.3.0文件夹所属的用户组的权限
chown -R elsearch:elsearch elasticsearch-6.3.0
mkdir /esdata
chown -R elsearch:elsearch /esdata/
//切换用户
su elsearch
//创建data 和 logs文件夹
cd /esdata
mkdir data logs
vi elasticsearch.yml

# ---------------------------------- Cluster -----------------------------------
cluster.name: name
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name:name01
#
# 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: /esdata/data
#
# Path to log files:
#
path.logs: /esdata/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: false
#
# 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


//输入下面的命令
curl 'http://127.0.0.1:9200'
//出现如下信息
{
  "name" : "JSJ-ES01",
  "cluster_name" : "JSJ-ES",
  "cluster_uuid" : "D0ck9KgzTBegP2Bfo222Lw",
  "version" : {
    "number" : "6.3.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "424e937",
    "build_date" : "2018-06-11T23:38:03.357887Z",
    "build_snapshot" : false,
    "lucene_version" : "7.3.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
2.3 常见问题
1、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

切换到root用户修改配置/etc/sysctl.conf,增加一行配置: vm.max_map_count=655360,执行命令 sysctl -p 这样就可以了,然后重新启动ES服务

上一篇 下一篇

猜你喜欢

热点阅读