ElasticSearch在CentOS的安装
2024-10-09 11:23:06
ElasticSearch在CentOS的安装
一、tar包安装
单机安装
- 创建elastic用户,ElasticSearch不支持root用户运行
useradd elastic
- 上传文件到 /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 # 目录赋权
- 修改配置文件
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 # 生效配置
- 问题解决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
- 检验
ps -ef | grep elasticsearch # 查看进程状态
curl localhost:9200 # 查看elasticsearch状态
最新文章
- Maven Super POM
- Maven打包跳过测试
- A类型物料必须为装配拉式,供应子库为B仓
- hdu4741
- JavaScript从入门到忘记
- ITU-T Technical Paper: 测量QoS的基本网络模型
- ssh优缺点
- Flask 键盘事件
- [UE4]场景截图
- OpenCV SVM
- .Spark Streaming(上)--实时流计算Spark Streaming原理介
- OpenCV颜色转换和皮肤检测
- [Git] 技术的热门度曲线
- ubuntu 16.04安装ibus中文输入法
- 用Python实现多站点运维监控
- Silverlight &; Blend动画设计系列五:故事板(StoryBoards)和动画(Animations)
- hdu 1853(拆点判环+费用流)
- python函数getopt用法
- ubuntu设置开机启动命令行模式
- linux终端没有GUI时python使用matplotlib如何画图