栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Contos8安装elasticseach7.17.0

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Contos8安装elasticseach7.17.0

Contos8安装elasticseach7.17.0
文章目录

Contos8安装elasticseach7.17.0

@[TOC](文章目录)下载官网(https://www.elastic.co/cn/downloads/past-releases#elasticsearch)选择下载你需要的版本,这里我选择的是7.17.0的版本。编辑配置文件启动elasticsearch其他问题集群模式 下载 官网(https://www.elastic.co/cn/downloads/past-releases#elasticsearch)选择下载你需要的版本,这里我选择的是7.17.0的版本。


注意:如果需要安装kibana管理es,则kibana版本需要与es的对应
下载好后,上传到你需要部署的服务器(可以参考scp指令上传文件).
上传后,使用下面指令解压得到解压包

		tar -zxvf java.tar.gz
		# tar -zxvf java.tar.gz -C /data/es  #可以指定解压路径

编辑配置文件

在配置文件config/elasticsearch.yam文件中添加以下内容

cluster.name: my-application
node.name: node-1 #节点名称
cluster.initial_master_nodes: ["node-1"] #指定主节点
path.data: /data/es/elasticsearch/elasticsearch-7.17.0/data
path.logs: /data/es/elasticsearch/elasticsearch-7.17.0/logs
network.host: 0.0.0.0
http.port: 9200

踩坑记录: 1、network.host配置为127.0.0.1启动后,本地curl 127.0.0.1:9200可以获取到es数据信息,但是在端口开放的前提下外网无法访问到9200的端口; 2、没有配置cluster.initial_master_nodes: ["node-1"],运行时报错:bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch;

启动elasticsearch

在Contos系统上,不允许使用root用户运行elastic search,所以需要创建一个用户用来运行elasticsearch程序。

	sudo useradd elastic #创建用户
	chown -R elastic /data/es/elasticsearch-7.17.1/ #用户授权
	su elastic  # 切换elastic 用户

踩坑记录:创建用户后不授权直接运行时会报错
进入elasticsearch目录下,运行bin/elasticsearc脚本即可运行成功。

./bin/elasticsearch -d #-d 为守护进程模式运行

启动后,本机终端输入curl localhost:9200可以看到

外网访问ip:9200可以看到

其他问题

启动时遇到the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ERROR: Elasticsearch did not exit normally - check the logs at /data/es/elasticsearch/elasticsearch-7.17.0/logs/my-application.log报错,在/etc/sysctl.conf文件中添加 vm.max_map_count=262144,添加后使用指令/sbin/sysctl -p使配置生效。

集群模式

【后续学习。。。】

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/778494.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号