ElasticSearch

  1. 下载 解压 移动到 /usr/local/目录下
  2. 修改jvm.options占用内存,设置自己机器的合适内存
-Xms512m
-Xmx512m

3 .修改配置文件 config/elasticsearch.yml,设置端口号,外网可以访问

network.host: 0.0.0.0
http.port: 9200
  1. 添加普通用户
groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch
cd /usr/local
chown -R elsearch:elsearch  elasticsearch-xxx
  1. 切换普通用户,后台启动
su elsearch 
cd elasticsearch-xxx/bin
./elasticsearch -d
  1. 测试
curl 'http://localhost:9200/?pretty'

max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

解决方案

1、vi /etc/sysctl.conf

设置fs.file-max=655350

保存之后sysctl -p使设置生效

2、vi /etc/security/limits.conf 新增
数字最少65536,我这里设置成655350
* soft nofile 655350

* hard nofile 655350

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

修改/etc/sysctl.conf配置文件,
cat /etc/sysctl.conf | grep vm.max_map_count
vm.max_map_count=262144
如果不存在则添加
echo "vm.max_map_count=262144" >>/etc/sysctl.conf

你可能感兴趣的:(ElasticSearch)