1.下载安装包

下载地址:https://www.elastic.co/downloads/elasticsearch

我这里下载的是 elasticsearch-6.4.0.tar.gz
保存至/opt目录下

cd /opt

tar -zxvf elasticsearch-6.4.0.tar.gz

2.创建用户elsearch,用户组elsearch

groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch

3.修改文件权限

cd /opt/
chown -R elsearch:elsearch elasticsearch-6.4.0

4.修改配置文件
cd /opt/elasticsearch-6.4.0/config/
vim elasticsearch.yml
修改以下配置:

#集群名称,建议修改成自己的,防止误用默认集群
cluster.name: elasticsearch

#配置外网可以访问
network.host: 0.0.0.0
#单节点需要修改配置
cluster.initial_master_nodes: ["node-1"]

追加配置文件:

echo "bootstrap.memory_lock: false" >>  /opt/elasticsearch-6.4.0/config/elasticsearch.yml
echo "bootstrap.system_call_filter: false" >> /opt/elasticsearch-6.4.0/config/elasticsearch.yml

echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 131072" >> /etc/security/limits.conf
echo "* soft nproc 4096" >> /etc/security/limits.conf
echo "* hard nproc 4096" >> /etc/security/limits.conf

echo "vm.max_map_count=655360" >> /etc/sysctl.conf

保存后执行
sysctl -p

5.配置jvm内存大小

cd /opt/elasticsearch-6.4.0/config/
修改文件jvm.options
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms8g
-Xmx8g

echo "export ES_HEAP_SIZE=8g" >> /opt/elasticsearch-6.4.0/bin/elasticsearch

切换目录:cd /opt/elasticsearch-6.4.0/bin/

执行配置生效:

source "`dirname "$0"`"/elasticsearch-env

5.启动服务

su elsearch

cd /opt/elasticsearch-6.4.0/bin/

sh ./elasticsearch -d

6 访问验证:

curl http://192.168.0.102/9200

最新文章

  1. 使用 python 管理 mysql 开发工具箱 - 1
  2. 【Win 10应用开发】实现全屏播放的方法
  3. 设计模式 之 装饰者(Decorator)模式
  4. python 多线程和多核
  5. Browser设置搜索引擎
  6. SQL数据类型解释
  7. IEnumerable接口的实现
  8. LeetCode Triangle 三角形(最短路)
  9. 关于.net类型转换判断问题
  10. poj1562 DFS入门
  11. 表达式树解析"框架"
  12. Hibernate从零开始的反向工程
  13. git使用详解
  14. 【一天一道LeetCode】#23. Merge k Sorted Lists
  15. figure 的使用
  16. VIP之CVI CVO
  17. hive 动态分区与混合分区
  18. cookie的安全性问题
  19. 使用Git上传代码到远程仓库
  20. Bootstrap-Plugin:模态框(Modal)插件

热门文章

  1. CSS 各种形状
  2. 【洛谷 P3193】 [HNOI2008]GT考试(KMP,dp,矩阵乘法)
  3. java容易混淆的概念
  4. React Native 开发豆瓣评分(六)添加字体图标
  5. golang实现路由中间件middleware
  6. stm32 USART_IT_IDLE中断 一帧数据
  7. The server quit without updating PID file
  8. SQL SERVER-修改实例的排序规则
  9. SQL Server 字段提取拼音首字母
  10. c# 常见文件操作