elasticsearch、kibana、head、logstash 在windows环境下安装

一.elasticsearch 安装

  官网下载 选择历史版本5.5.0 安装即可,运行.bat文件

  

二.kibana 

  同es,运行.bat文件 5.5.0.x86版本,没找到64位的

三.ik 分词器

  1.下载 https://github.com/medcl/elasticsearch-analysis-ik   (下载源码,有pom文件那个)

  2.解压并进入elasticsearch-analysis-pinyin-master目录,mvn打包(没有安装maven的自行安装),运行命令:mvn package

  3.打包成功以后, 会生成一个target文件夹, 在elasticsearch-analysis-ik-master/target/releases目录下, 找到elasticsearch-analysis-ik-5.1.1.zip, 这就是我们需要的安装文件; 解压elasticsearch-analysis-ik-5.1.1.zip, 并将内容拷贝到elasticsearch安装目录的plugins/ik目录下(在plugins目录下新建ik文件夹)

  4.远程加载自定义新词

    方式1:远程加载

     a.启动tomcat,webapp 目录下ROOT目录测试,新建caolihua.txt (用notepad++另存为UTF-8编码,无BOM格式,不然windows加载,控制台打印是乱码;同时修改F:\elasticsearch-5.5.0\config\jvm.options  的-Dfile.encoding=GBK,不然控制台日志中文乱码)

     b. 配置F:\elasticsearch-5.5.0\plugins\ik\config\IKAnalyzer.cfg.xml,<entry key="remote_ext_dict">http://localhost:8080/caolihua.txt</entry>  

     #es实时监听 词库,可以看到控制打印新增的词;

     

     #自己配置一个服务,可以使得用户端重新自定义业务词库

四、head插件

  

es5以上版本安装head需要安装node和grunt(之前的直接用plugin命令即可安装)

(一)从地址:https://nodejs.org/en/download/ 下载相应系统的msi,双击安装。

(二)安装完成用cmd进入安装目录执行 node -v可查看版本号

(三)执行 npm install -g grunt-cli 安装grunt ,安装完成后执行grunt -version查看是否安装成功,会显示安装的版本号

(四)开始安装head
① 进入安装目录下的config目录,修改elasticsearch.yml文件.在文件的末尾加入以下代码

http.cors.enabled: true 
http.cors.allow-origin: "*"
node.master: true
node.data: true

然后去掉network.host: 192.168.0.1的注释并改为network.host: 0.0.0.0,去掉cluster.name;node.name;http.port的注释(也就是去掉#)

②双击elasticsearch.bat重启es
③在https://github.com/mobz/elasticsearch-head中下载head插件,选择下载zip

④解压到指定文件夹下,G:\elasticsearch-5.5.0\elasticsearch-head-master  进入该文件夹,修改G:\elasticsearch-5.5.0\elasticsearch-head-master\Gruntfile.js 在对应的位置加上hostname:'*'

⑤在G:\elasticsearch-5.5.0\elasticsearch-head-master  下执行npm install 安装完成后执行grunt server 或者npm run start 运行head插件,如果不成功重新安装grunt。成功如下

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

成功。

五、Logstash:

https://doc.yonyoucloud.com/doc/logstash-best-practice-cn/output/elasticsearch.html  民间logstash教程

#logstash.bat -f test.conf  

输入的数据 ,会被采集到ES中

input{
    stdin{}
}
output{
    elasticsearch{
        hosts => "127.0.0.1"
     }
   stdout{codec => rubydebug}
}

猜你喜欢

转载自blog.csdn.net/qq_25911515/article/details/83626826