ELK--关于安装(win10篇)

下载地址

https://www.elastic.co/cn/downloads/
http://www.nssm.cc/release/nssm-2.24.zip
https://github.com/mobz/elasticsearch-head 

目标

  • 以nssm为媒介,采用服务的形式启动,以便在window环境下守护进程
  • 使用默认端口访问
  • elasticsearch: http://127.0.0.1:9200/
  • logstash: http://127.0.0.1:9600/
  • kibana: http://127.0.0.1:5601

步骤

  • 以管理员身份启动cmd
1. elasticsearch安装
  • 进入elasticsearch的bin目录下执行
  • elasticsearch.bat(如果双击执行,有错误闪退会看不到错误信息)
  • 使用nssm.exe install elasticsearch注册为windows服务,
    路径选择elasticsearch.bat(nssm.exe放到bin目录下)
  • 访问http://localhost:9200/
```
{
    name: "QQQQQQQQ",
    cluster_name: "elasticsearch",
    cluster_uuid: "7dJr1M92SyWu8qbPDnjV_A",
    version: {
        number: "7.0.1",
        build_flavor: "default",
        build_type: "zip",
        build_hash: "e4efcb5",
        build_date: "2019-04-29T12:56:03.145736Z",
        build_snapshot: false,
        lucene_version: "8.0.0",
        minimum_wire_compatibility_version: "6.7.0",
        minimum_index_compatibility_version: "6.0.0-beta1"
    },
    tagline: "You Know, for Search"
}
```
  • 错误情况
      错误提示:
      uncaught exception in thread [main] 
      org.elasticsearch.bootstrap.StartupException: 
      ElasticsearchException[X-Pack is not supported and Machine 
      Learning is not available for [windows-x86]; you can use the 
      other X-Pack features (unsupported) by setting xpack.ml.enabled: 
      false in elasticsearch.yml]
      解决办法:
      用这条命令执行:elasticsearch -E xpack.ml.enabled=false
      或者在elasticsearch.yml里修改xpack.ml.enabled: false
      ```
      
    
2. logstash安装
  • 进入logstah的bin目录下
  • 新建logstah.conf
    input {
        tcp {
            port => 4560
            codec => json_lines
        }
    }
    
    output {
        elasticsearch {
            hosts => ["127.0.0.1:9200"]
            index => "logstash"
        }
        stdout {
            codec => json_lines
        }
    }
    
  • 使用logstash.bat -f logstash.conf命令启动服务
  • 新建run.bat,写入logstash.bat -f logstash.conf,
    使用nssm.exe install logstash注册为windows服务,
    路径选择run.bat,dependencies写入elasticsearch(nssm.exe放到bin目录下)
3. kibana安装
- 进入kibana的bin目录下
- `kibana.bat`启动服务
- 使用`nssm.exe install kibana`注册为windows服务,
  路径选择`kibana.bat`,
  dependencies写入`elasticsearch logstash`
  (nssm.exe放到bin目录下)
5. elasticsearch-head安装
- 进入elasticsearch-head目录下
    ```
    需要安装node环境 
    npm install
    npm run start
    ```
- 可能存在跨域问题
    ```
    在/config/elasticsearch.yml文件里添加
    http.cors.enabled: true
    http.cors.allow-origin: "*"
    ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值