Mac 安装Elasticsearch 5.0

来源:互联网 发布:c4d for mac 编辑:程序博客网 时间:2024/06/06 00:39

Install Elasticsearch 5.0

  1. Download .zip/.tar.gz 下载地址
  2. tar -xzf elasticsearch-5.0.0.tar.gz
  3. 修改配置文件(xx/config/elasticsearch.yml):
    • path.data:/data/elasticsearch/data #数据目录
    • path.logs:/data/elasticsearch/logs #日志目录
    • network.host:x.x.x.x
    • http.cors.enabled:true #这个参数设置head插件连接es集群
    • http.cors.allow-origin:”*” #同上(如果不设置最后这两个参数head插件连接不到es集群)
  4. 启动es,nohup bin/elasticsearch > logs/xxx.log 2>&1 &

Install elasticsearch-head(es5.0不支持site plugin,所以需要单独安装head插件)

  1. elasticsearch-head
  2. enable cors by adding http.cors.enabled: true in elasticsearch configuration. Don’t forget to also set
    http.cors.allow-origin because no origin allowed by default. http.cors.allow-origin: “*” is valid value, however it’s considered as a security risk as your cluster is open to cross origin from anywhere. Check Elasticsearch documentation on this parameter
  3. git clone git://github.com/mobz/elasticsearch-head.git
  4. cd elasticsearch-head
  5. npm install
  6. grunt server(如果没有grunt,执行npm install -g grunt-cli安装)
  7. open http://localhost:9100/
0 0
原创粉丝点击