ElasticSearch在CentOS的安装

一、tar包安装

单机安装

  1. 创建elastic用户,ElasticSearch不支持root用户运行
useradd elastic
  1. 上传文件到 /softwares ,并解压tar包
cd /softwares/    # 切换到 /softwares 目录

tar -xvf elasticsearch-7.0.0-linux-x86_64.tar.gz    # 解压

chown -R elastic:elastic /softwares/elasticsearch-7.0.0    # 目录赋权
  1. 修改配置文件
vim config/elasticsearch.yml    # 修改配置文件

    cluster.name: elasticsearch    # 集群名称
node.name: node-1 # 节点名称
path.data: /softwares/elasticsearch-7.0.0/data # 数据存储位置
path.logs: /softwares/elasticsearch-7.0.0/logs # 日志存储位置
network.host: 0.0.0.0 # 设置ip地址,任意网络均可访问
http.port: 9200 # 默认端口
cluster.initial_master_nodes: ["node-1"] # 设置在集群中所有节点名称 # 在Elasticsearch中如果,network.host不是localhost或者127.0.0.1的话,就会认为是生产环境,会对环境的要求比较高,一般情况下需要修改 JVM启动参数 和 内存映射最大数量
vim config/jvm.options # 修改JVM启动参数
-Xms128m
-Xmx128m vim /etc/sysctl.conf
vm.max_map_count=655360 # 进程在VMAs(虚拟内存区域)创建内存映射最大数量
sysctl -p # 生效配置
  1. 问题解决ERROR: [2] bootstrap checks failed

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

    [2]: max number of threads [3766] for user [elastic] is too low, increase to at least [4096]

limits.conf文件限制着用户可以使用的最大文件数,最大线程,最大内存等资源使用量。

vim /etc/security/limits.conf    # 修改limits.conf文件以符合启动elasticsearch的要求

    elastic         soft    nofile          65536
elastic hard nofile 65536
elastic soft nproc 4096
elastic hard nproc 4096
  1. 检验
ps -ef | grep elasticsearch    # 查看进程状态

curl localhost:9200    # 查看elasticsearch状态

最新文章

  1. Maven Super POM
  2. Maven打包跳过测试
  3. A类型物料必须为装配拉式,供应子库为B仓
  4. hdu4741
  5. JavaScript从入门到忘记
  6. ITU-T Technical Paper: 测量QoS的基本网络模型
  7. ssh优缺点
  8. Flask 键盘事件
  9. [UE4]场景截图
  10. OpenCV SVM
  11. .Spark Streaming(上)--实时流计算Spark Streaming原理介
  12. OpenCV颜色转换和皮肤检测
  13. [Git] 技术的热门度曲线
  14. ubuntu 16.04安装ibus中文输入法
  15. 用Python实现多站点运维监控
  16. Silverlight & Blend动画设计系列五:故事板(StoryBoards)和动画(Animations)
  17. hdu 1853(拆点判环+费用流)
  18. python函数getopt用法
  19. ubuntu设置开机启动命令行模式
  20. linux终端没有GUI时python使用matplotlib如何画图

热门文章

  1. C++语法小记---继承中的构造和析构顺序
  2. Docker 入门教程(1)——安装
  3. Python3的一些基本输入输出
  4. Monster Audio 使用教程 (八) Vst3 使用侧链功能
  5. 在同一form表单中如何提交两个不同的action
  6. logging日志基础示例
  7. PHP curl_strerror函数
  8. PHP mt_rand() 函数
  9. PDO::quote
  10. luogu P2525 Uim的情人节礼物 其之壱