ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Elasticsearch 7.3.0版本学习笔记-下载与安装

2021-08-01 13:00:22  阅读:270  来源: 互联网

标签:shell kibana centos7 7.3 Elasticsearch 笔记 elasticsearch root


Elasticsearch 7.3.0版本学习笔记

Elasticsearch 是一个基于JSON的分布式搜索和分析引擎。

Elasticsearch 官网地址:https://www.elastic.co/cn/elastic-stack/

## 下载与安装

Elasticsearch Linux版 下载地址:https://www.elastic.co/cn/downloads/past-releases/,本文下载7.3.0版本

解压

```shell
[root@centos7 ~]# tar -zvxf elasticsearch-7.3.0-linux-x86_64.tar.gz
```

移动到/usr/local目录下

```shell
[root@centos7 ~]# mv elasticsearch-7.3.0 /usr/local
```

更改名字

```shell
[root@centos7 local]# mv elasticsearch-7.3.0/ elasticsearch
```

进入到elasticsearch 目录

```shell
[root@centos7 ~]# cd /usr/local/elasticsearch-7.3.0/
```

## 配置

```shell
# 修改network.host的配置为0.0.0.0,让外网可以访问
[ajtuser@centos7 elasticsearch]$ vim ./config/elasticsearch.yml 

network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
#http.port: 9200
```

## 启动(用非root账号启动)

```shell
# 启动报错
[ajtuser@centos7 elasticsearch]$ ./bin/elasticsearch
ERROR: [3] bootstrap checks failed
[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

```

```shell

[root@centos7 ~]# vim /etc/security/limits.conf 
在/etc/security/limits.conf文件中新增如下配置
*  soft  nofile  65536
*  hard  nofile  65536
*  soft  nproc   4096
*  hard  nproc   4096

[root@centos7 ~]# vim /etc/sysctl.conf
在/etc/sysctl.conf文件中新增如下配置
vm.max_map_count=262144

# 使配置生效
[root@centos7 ~]# sysctl -p

用户切换,使以上配置生效

浏览器输入http://192.168.100.206:9200

{
  "name" : "node-1",
  "cluster_name" : "my-application",
  "cluster_uuid" : "hl1I3JV9Sc6Xovzjebd4Bw",
  "version" : {
    "number" : "7.3.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "de777fa",
    "build_date" : "2019-07-24T18:30:11.767338Z",
    "build_snapshot" : false,
    "lucene_version" : "8.1.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

## kibana 

>  为了方便学习elasticsearch,最好安装一下kibana,kibana版本最好与elasticsearch保持一致
>
> 下载地址:https://www.elastic.co/cn/downloads/kibana

解压

```shell
[ajtuser@centos7 ~]$ tar -zvxf kibana-7.3.0-linux-x86_64.tar.gz
```

移动到/usr/local目录下,并重命名

```shell
[ajtuser@centos7 ~]$ mv kibana-7.3.0-linux-x86_64 /usr/local/
[ajtuser@centos7 local]$ mv kibana-7.3.0-linux-x86_64/ kibana
```

修改kibana的配置

```shell
[ajtuser@centos7 kibana]$ vim config/kibana.yml 
# 设置如下内容
# 指定服务运行的端口,默认是5601
server.port: 5601
# 允许外网访问,默认是只允许localhost访问
server.host: 0.0.0.0
# 指定连接elasticsearch的hosts 默认是http://localhost:9200
elasticsearch.hosts: ["http://localhost:9200"]
```

启动elasticsearch成功后,再启动kibana

```shell
[ajtuser@centos7 kibana]$ ./bin/kibana
```

访问

http://192.168.100.206:5601 

> 说明:kibana的启动也不能是root账号,若启动成功不能访问,检查防火墙是否关闭
>
> centos7 暂停防火墙命令,但是服务重启后防火墙会启动
>
> systemctl stop firewalld.service
>
> centos7 永久关闭防火墙
>
> systemctl disable firewalld.servic

标签:shell,kibana,centos7,7.3,Elasticsearch,笔记,elasticsearch,root
来源: https://blog.csdn.net/ll535299/article/details/119296893

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有