centos安装elasticsearch 7.9全教程

下elasticsearch,地址:
https://www.elastic.co/downloads/elasticsearch

下载完,后解压,到bin目录下运行./elasticsearch
因为我下载的是7.9.2版本的,但是系统安装的是jdk8,而这个版本的es要求的jdk版本最低是11,否则会提示如下错误,

future versions of Elasticsearch will require Java 11; your Java version from [/home/parallels/program/jdk1.8.0_261/jre] does not meet this requirement

只好重新安装jdk11
https://www.oracle.com/java/technologies/javase-jdk11-downloads.html

安装好了后,重新运行es

[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: 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

又有问题。一一解决
显示每个进程打开文件数太小,查看系统环境。

[parallels@10 bin]$ ulimit -Hn
4096
[parallels@10 bin]$ ulimit -Sn
1024

解决【1】修改文件 /etc/security/limits.conf 在文件末尾增加两行

*  soft nofile 65535
*  hard nofile 65537

解决【2】修改配置文件vim /etc/sysctl.conf ,在文件末尾增加一行

vm.max_map_count=655360

执行命令生效

[parallels@10 bin]$ sudo sysctl -p

修改配置文件后重新登录
解决【3】修改config/elasticsearch.yml配置文件
一并修改其他配置

cluster.initial_master_nodes: ["node-1"]
network.host: 10.211.55.14
http.port: 9200
path.logs: /path/to/logs
path.data: /path/to/data
node.name: node-1
cluster.name: my-elasticsearch

创建/path/to/logs|data目录,并复制权限

重新启动es
启动成功,访问成功

van@van Downloads$ curl http://10.211.55.14:9200/
{
  "name" : "node-1",
  "cluster_name" : "my-elasticsearch",
  "cluster_uuid" : "daqaM63CTmaPVtkgzYFF3A",
  "version" : {
    "number" : "7.9.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "d34da0ea4a966c4e49417f2da2f244e3e97b4e6e",
    "build_date" : "2020-09-23T00:45:33.626720Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

值得注意的是:es不允许以root身份启动,否则会提示错误

 org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
安装Centos7.9教程可以分为以下几个步骤: 1. 下载Centos7.9系统镜像。你可以在一些下载Linux镜像的网站中找到Centos7.9的版本,比如中提到的网站。下载完成后,你将得到一个ISO文件。 2. 创建一个虚拟机环境。你可以使用VMware等虚拟机软件来创建一个虚拟机环境。请按照中的步骤进行虚拟系统的配置。 3. 安装Centos7.9系统。将之前下载的ISO文件挂载到虚拟机上,然后启动虚拟机。在启动过程中,按照提示选择合适的安装选项和设置,最后完成安装。 综上所述,这就是Centos7.9安装教程的基本步骤。详细的安装过程可以参考[1]中提到的资源和中的网站下载Centos7.9镜像。希望对你有帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Centos7.9系统安装流程(含VMware安装过程)](https://blog.csdn.net/qq_44281591/article/details/115576730)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [【一】Centos7.9--安装教程](https://blog.csdn.net/weixin_46818279/article/details/112132139)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Centos安装MYSQL8.X的教程](https://download.csdn.net/download/weixin_38721252/12823587)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值