Linux 环境下 elasticsearch+kibana+x-pack 的搭建
写在前面:本文档的版本可以根据自己的需求自行选择
1、es的下载和安装:
下载:
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.2.zip
zip包解压:
unzip elasticsearch-5.0.2.zip
启动es:
cd elasticsearch-5.0.2
./bin/elasticsearch
注:若想用后台守护进程模式运行,添加-d参数、若想让本网端内的所有机器都可以访问,请修改elasticsearch.yml文件,将localhost换成0.0.0.0
2、es启动成功与否的测试:
curl 'htttp://localhost:9200/?pretty'
若能看到以下信息,说明es已经启动,并且正常运行:
{ "name": "vP19PMO", "cluster_name": "elasticsearch", "cluster_uuid": "IMKMfkMsSrKODIYg5gxgeQ", "version": { "number": "5.0.2", "build_hash": "f6b4951", "build_date": "2016-11-24T10:07:18.101Z", "build_snapshot": false, "lucene_version": "6.2.1" }, "tagline": "You Know, for Search" }
3、kibana的下载和安装:
下载:
wget https://artifacts.elastic.co/downloads/kibana/kibana-5.1.1-linux-x86_64.tar.gz
解压:
tar -xzf kibana-5.1.1-linux-x86_64.tar.gz
注:若想全网段访问,需要修改配置文件localhost为0.0.0.0
4、X-Pack插件安装
es安装x-pack
bin/elasticsearch-plugin install x-pack
如果你在Elasticsearch已禁用自动索引的创建,在elasticsearch.yml配置action.auto_create_index允许X-pack创造以下指标:
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
kibana安装x-pack
bin/kibana-plugin install x-pack
5、启动运行
es启动:
bin/elasticsearch
kibana启动:
bin/kibana
6、登录测试:
http://lcalhost:5601/ 初始用户名:elastic和changeme