2018-08-23

## 0x01、ElasticSearch安装与配置

##### 1、下载ElasticSearch

```

$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.zip

$ unzip elasticsearch-6.3.2.zip

```

##### 2、配置es:修改conf文件夹下的elasticsearch.yml

```

# 配置host使外网可访问,不然ip:port不能访问,只能通过localhost:port

network.host: 0.0.0.0

http.port: 9200

```

##### 3、报错踩坑

- es的安全机制不能使用root用户启动,需要切换到其他用户

- 配置了host后运行es报错

```

ERROR: [3] bootstrap checks failed

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

[2]: max number of threads [3780] for user [jiang] is too low, increase to at least [4096]

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

```

解决方案:

```

error [1][2]

$ sudo vi /etc/security/limits.conf

# 添加一下4条配置

*              soft    nofile          65536

*              hard    nofile          65536

*              soft    nproc          4096

*              hard    nproc          4096

error:[3]

$ vi /etc/sysctl.conf

# 添加一下配置

vm.max_map_count=262144

$ sysctl -p 生效

```

##### 4、启动es

```

$ ./bin/elasticsearch

$ curl localhost/ip:9200

```

## 0x02、Kibana安装

##### 1、下载kibana,kibana需要和es版本对应

```

$ https://artifacts.elastic.co/downloads/kibana/kibana-6.3.2-linux-x86_64.tar.gz

```

##### 2、解压kibana

```

# sha1sum 查看软件的hash和完整性

$ sha1sum kibana-6.3.2-linux-x86_64.tar.gz

$ tar -zxvf kibana-6.3.2-linux-x86_64.tar.gz

```

##### 3、配置kibana

```

# 连接es

elasticsearch.url: "http://192.168.1.240:9250"

```

##### 4、运行kibana

```

$ ./bin/kibana

# 浏览器访问  localhost:5601

```

##### 5、Kibana用户手册

[Kibana官网用户手册](https://www.elastic.co/guide/cn/kibana/current/index.html)

## 0x03、Elasticsearch head安装

1、下载elasticsearch head

```

去github下载zip

$ wget  https://github.com/mobz/elasticsearch-head/archive/master.zip

```

2、安装es head 依赖的nodejs 环境

[node.js教程](http://www.runoob.com/nodejs/nodejs-install-setup.html)

```

$ wget https://npm.taobao.org/mirrors/node/v10.8.0/node-v10.8.0-linux-x64.tar.xz

$ tar xf node-v10.8.0-linux-x64.tar.xz

```

3、配置nodejs环境变量

```

# 在/etc/profile添加以下两行

# config nodejs

NODE_HOME=/home/jiang/app/node-v10.8.0-linux-x64

PATH=$NODE_HOME/bin:$PATH

# 使配置文件生效

$ source /etc/profile

```

4、安装grunt

```

$ cd /elasticsearch-head-master

$ npm install -g grunt-cli

$ grunt -version

$ npm install

```

5、启动head

```

$ cd /elasticsearch-head-master

$ grunt server

浏览器访问: http://localhost:9100/

enjoy it...

```

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Boot高级 内容概要 一、Spring Boot与缓存 二、Spring Boot与消息 三、Sp...
    顺毛阅读 457评论 0 2
  • 地址 https://github.com/alsotang/node-lessons/tree/master/l...
    菜鸟亿个阅读 257评论 0 0
  • Node.js实现在线文件管理工具 需求文件列表展示文件上传下载 依赖模块fspathexpressbody-pa...
    HupuJRs001阅读 147评论 0 0
  • aardvark ['ɑ:d,vɑ:k] noun an animal from southern Africa ...
    与非yufei阅读 639评论 0 1
  • 1.发布命令行 fed build cship -p build/* cship -p build/*/* 2.R...
    cee希阅读 248评论 0 0

友情链接更多精彩内容