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