欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

.net core 与ELK(1)安装Elasticsearch

程序员文章站 2022-06-28 20:27:49
1.安装java jdk 2.去官网下载https://www.elastic.co/cn/downloads/elasticsearch wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.1.ta ......

1.安装java jdk

[elsearch@localhost bin]$ java -version
openjdk version "1.8.0_181"
openjdk runtime environment (build 1.8.0_181-b13)
openjdk 64-bit server vm (build 25.181-b13, mixed mode)

2.去官网下载

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.1.tar.gz

3.解压

tar -zvxf elasticsearch-6.7.1.tar.gz -c /usr/local

4.设置创建用户

[root@localhost ~]# groupadd elsearch
[root@localhost ~]# useradd elsearch -g elsearch -p elasticsearch
[root@localhost ~]# passwd elsearch  # 设置密码

5.更改解压的文件的owner

[root@localhost ~]# cd /usr/local/
[root@localhost /usr/local]# chown -r elsearch:elsearch elasticsearch-6.7.1/

6.尝试启动bin目录下的elasticsearch

[elsearch@localhost bin]$ ./elasticsearch

7.报错解决

错误:max virtual mefnory areas vm.max_ map_count [ 65530 ] 15 too low, increase toa t least [ 262144 ]

.net core 与ELK(1)安装Elasticsearch

在配置文件最后一行加上:
vm.max_map_count=655360

错误:max file descriptors [ 4096 ] for elasticsearch process 15 too low, increase to at least [ 65536 ]

etc目录下

.net core 与ELK(1)安装Elasticsearch

用 vi ./limits.conf 进入limits.conf进行编辑,修改如下:

elsearch soft nofile 65536
elsearch hard nofile 65536
elsearch soft nproc 4096
elsearch hard nproc 4096

报错:跟access相关的

用ll查下相关文件的owner,然后改为用户elsearch

8.编辑elasticsearch.yml配置文件,使本地主机可以访问els所在虚拟机

[elsearch@localhost config]$ vi elasticsearch.yml

.net core 与ELK(1)安装Elasticsearch

9.test

./elasticsearch -d   #启动

本地浏览器访问

.net core 与ELK(1)安装Elasticsearch