前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Elasticsearch-6.7.0系列(一)9200端口 .tar.gz版本centos7环境--下载安装运行 转

Elasticsearch-6.7.0系列(一)9200端口 .tar.gz版本centos7环境--下载安装运行 转

作者头像
双面人
发布2019-08-31 13:51:34
7580
发布2019-08-31 13:51:34
举报
文章被收录于专栏:热爱IT热爱IT

https://www.elastic.co/guide/index.html(推荐) ES官方英文原版文档,一般会更新到最新版本

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

https://www.cnblogs.com/zhuwenjoyce/p/10632628.html 安装jdk1.8

下载 Elasticsearch6.7.0

cd /home/soft

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz 建议离线下载elasticsearch

tar -zxvf elasticsearch-6.7.0.tar.gz 解压

./bin/elasticsearch 尝试启动ES

备注: network.host: 0.0.0.0 如需远程连接ES,需修改elasticsearch.yml,把其中的network.host改成0.0.0.0

不能以root用户启动 can not run elasticsearch as root

useradd elastic 新建linux用户elastic

chown -R elastic:elastic elasticsearch-6.7.0 赋予elastic用户和组读写es目录权限

su elastic 从root用户切换到elastic用户

普通用户获取文件夹读写权限:

代码语言:javascript
复制
chmod 777 elasticsearch-6.7.0             赋予elastic用户目录所有权权限       

或者加sudo命令:sudo chmod -R 777 elasticsearch-6.7.0

获得sudo命令使用权的方法  https://www.cnblogs.com/zox2011/archive/2013/05/28/3103824.html

cd elasticsearch-6.7.0/ 进入ES目录

./bin/elasticsearch 前台启动es,ctrl + c 终止。

./bin/elasticsearch -d 后台启动es,停止方法如下截图:

es启动和停止服务命令:

代码语言:javascript
复制
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

验证启动成功: http://localhost:9200/?pretty

有用的URL

URL

http://192.168.10.110:9200/

基本信息

http://192.168.10.110:9200/_all/_search?pretty

搜索引擎数据

http://192.168.10.110:9200/_xpack/security/_authenticate?pretty

权限信息

http://192.168.10.110:9200/_license

许可证信息

http://192.168.10.110:9200/_xpack

xpack信息

http://192.168.10.110:9200/_cluster/state?pretty

集群信息

ES常见启动错误

ES安装目录/logs/elasticsearch.log可以查看启动日志。除了不能以root用户启动ES意外,还有3个常见启动错误:

代码语言:javascript
复制
ERROR: [3] 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]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

[1][2]两个错误解决方法:

vim /etc/security/limits.conf

增加以下配置:

代码语言:javascript
复制
*                soft    nofile          65536
*                hard    nofile          65536
*                soft    nproc           4096
*                hard    nproc           4096

[3]解决方法:

vim /etc/sysctl.conf

vm.max_map_count=262144 增加这行配置

sysctl -p 重新生效配置文件sysctl.conf

cd ES安装目录

./bin/elasticsearch -d 后台启动,注意不要使用root用户启动。

浏览器打开验证:http://localhost:9200/_all/_search?pretty

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档