es安装需要jdk环境,所以安装es之前,需要先按章jdk。之前我已经安装了jdk8,我直接安装es了。

下载地址 : Download Elasticsearch | Elastic

把下载好的压缩包上传到Linux服务器。tar -zxvf 命令进行解压。

还有一点。es不能在root用户下启动,会报错,所以最好新建立一个elastic search用户。

Linux新建用户 

linux命令   useradd

passwd 用户名   设置密码

创建 data和logs文件夹

linux es升级 linux环境安装es_kibana

可以用 mkdir /data  或者  mkdir -p es/data

之后进行配置文件修改   在config文件夹下的elasticsearch.yml   

linux es升级 linux环境安装es_linux es升级_02

linux es升级 linux环境安装es_Elastic_03

linux es升级 linux环境安装es_elasticsearch_04

进入bin目录下  ./elasticsearch  启动   后台启动   ./elasticsearch  -d

执行curl 'http://自己配置的IP地址:9200/' 命令

linux es升级 linux环境安装es_bootstrap_05

或者浏览器打开,如果Linux里可以访问,浏览器访问不了,是你的Linux端口没有打开

参考   Linux 部署jdk 和 tomcat_在linux上部署jdk tomcat_Peter_S的博客-CSDN博客

我在部署tomcat时候遇到这个问题,那里面写了解决方案

linux es升级 linux环境安装es_elasticsearch_06

我在启动elastic search的碰到下面几个问题,单独说下。

1,

linux es升级 linux环境安装es_kibana_07

Caused by: org.elasticsearch.ElasticsearchException: X-Pack is not supported and Machine Learning is not available for [linux-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml

参考连接  解决:ElasticsearchException[X-Pack is not supported and Machine Learning is not available for

在config文件夹下elasticsearch.yml新增一行       xpack.ml.enabled: false

2,

linux es升级 linux环境安装es_kibana_08

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

参考连接  ERROR: bootstrap checks failed max file descriptors [4096] for elasticsearch process likely too low,

切换到root用户

输入Linux 命令  vi /etc/security/limits.conf

添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

linux es升级 linux环境安装es_linux es升级_09

[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

参考连接  max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

切换到root用户  执行Linux命令   sysctl -w vm.max_map_count=262144

[3]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

参考连接  system call filters failed to install; check the logs and fix your configuration or disable system c

在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: 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

修改配置文件里面的如下语句,取消注释,删掉, “node-2”
cluster.initial_master_nodes: [“node-1”, “node-2”]

----------------------------------------------------------------------------------------------------------------------------------------------

kibana  下载地址   Download Kibana Free | Get Started Now | Elastic

安装参考地址   Kibana安装(Linux)及简单使用说明

下载好之后上传到服务器,同样  tar -zxvf 命令进行解压。

config/kibana.yml  j进行配置

linux es升级 linux环境安装es_Elastic_10

启动  ./kibana

./kibana &启动 需要exit退出,之后就Linux后台运行了,

我进行启动的时候发现权限不足

linux es升级 linux环境安装es_linux es升级_11

参考连接  elasticsearch+Kibana在linux下的详细安装步骤_linux 安装两个中间件elasticsearch 6.8.10版本和kibana 6.8.10版

网上查了,权限不足,安装es的时候省了一步。。。。

chown -R elasticsearch:elasticsearch /home/elasticsearch/

chown -R 用户名:密码  文件夹

浏览器 输入  http://ip:5601/

linux es升级 linux环境安装es_linux es升级_12