ElasticSearch 是分布式的全文检索系统,官方文档 地址: https://www.elastic.co/guide/index.html
笔者在centos 上部署ES 5.0 的集群,总结了一些经验教训。
1、部署单机的ES环境
详细的部署过程,在官方文档中已经很详细的说明。简要描述如下:
== 安装 GPG-KEY
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
== 创建 /etc/yum.repos.d/elasticsearch.repo 文件,内容如下:
[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
sudo yum install elasticsearch
== 修改配置文件
vi /etc/elasticsearch/elasticsearch.yml
== 配置自启动
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch
== 运行和停止
systemctl start elasticsearch
systemctl stop elasticsearch
== ES 安装完成后,默认的文件位置
type | description | location |
home | Home of elasticsearch installation | /usr/share/elasticsearch |
bin | Binary scripts including elasticsearch to start a node | /usr/share/elasticsearch/bin |
conf | Configuration files elasticsearch.yml and logging.yml | /etc/elasticsearch |
conf | Environment variables including heap size,file descriptors | /etc/sysconfig/elasticsearch |
data | The location of the data files | /var/lib/elasticsearch/ |
logs | Log files location | /var/log/elasticsearch |
plugins | Plugin files location | /usr/share/elasticsearch/plugins |
2、安装kibana
== 创建 /etc/yum.repos.d/kibana.repo ,内容如下
[kibana-5.x]
name=Kibana repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
== 安装
sudo yum install kibana
== 配置自启动
sudo systemctl daemon-reload
sudo systemctl enable kibana
== 启动和停止
sudo systemctl start kibana
sudo systemctl stop kibana
kibana的文件位置:
配置文件 在 /etc/kibana/kibana.yml
安装目录 /usr/share/kibana
3、安装x-pack
分别在elasticesearch的安装目录(/usr/share/elasticsearch)及kibana的安装目录(/usr/share/kibana)执行
bin/elasticsearch-plugininstall x-pack
bin/kibana-plugin install x-pack
4、检查是否工作正常
== 检查服务端口:elasticsearch 的9200,kibana的5601是否正常
sudo netstat -nltp
==使用浏览器访问:elasticsearch
http://192.168.0.21:9200
== 使用浏览器访问:kibana
http://192.168.0.21:5601