技术与更多 2019-06-26
ELK = ElasticSearch + Logstash + Kibana
在ELK栈里依赖关系
所以我们以下按照依赖顺序安装相应的服务: ElasticSearch -> Logstash -> Kibana
X:\ELK X:\Elasticsearch X:\Kibana X:\Logstash 本教程的X以下是用D盘代替
# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.2.zip # 自行下载 wget是linux命令 解压到D:\ElasticSearch\elasticsearch-6.2.2
cd D:\ElasticSearch\elasticsearch-6.2.2\bin elasticsearch-service.bat install # 提示:The service 'elasticsearch-service-x64' has been installed.表示安装成功 # install:安装服务|remove:删除服务|start:启动|stop:暂停|manager:打开服务管理器 elasticsearch-service.bat install|remove|start|stop|manager
http://localhost:9200
head插件是一个es集群的web前端工具,我们可以es查询,查看es集群状态等
# es 6.2.2版本es自带 需要独立安装 安装nodejs 下载https://github.com/coreybutler/nvm-windows 安装 nvm install v8.9.4 # npm加速 全局安装cnpm 指定来源淘宝镜像 npm install -g cnpm --registry=https://registry.npm.taobao.org git clone git://github.com/mobz/elasticsearch-head.git cd elasticsearch-head cnpm install npm run start open http://localhost:9100/ #其他版本es可以按以下命令安装 elasticsearch-plugin.bat install mobz/elasticsearch-head # 修改elasticksearch配置 (config/elasticsearch.yml) 添加一下配置 http.cors.enabled: true http.cors.allow-origin: "*" elasticsearch-service.bat stop elasticsearch-service.bat start open http://localhost:9100/
# wget https://artifacts.elastic.co/downloads/logstash/logstash-6.2.2.zip 解压到D:\Logstash\logstash-6.2.2
# logstash -e '配置文件内容' # logstash -f 配置文件
# conf/test.conf input { file { path => "D:/elk/Elasticsearch/elasticsearch-6.2.2/logs/*.*" start_position => "beginning" } } output { elasticsearch { hosts => ["localhost:9200"] } }
logstash -f conf/test.conf
# wget https://artifacts.elastic.co/downloads/kibana/kibana-6.2.2-windows-x86_64.zip 解压到D:\Logstash\kibana-6.2.2
cd bin kibanna.bat open http://localhost:5601
elasticsearch 已经是注册成服务, 我们还需要把logstash和kibana注册成服务
# https://nssm.cc/download wget https://nssm.cc/release/nssm-2.24.zip vim start.bat logstash -f conf/test.conf
另外一部分,则需要先做聚类、分类处理,将聚合出的分类结果存入ES集群的聚类索引中。数据处理层的聚合结果存入ES中的指定索引,同时将每个聚合主题相关的数据存入每个document下面的某个field下。