Elasticsearch Install

1. 安装 elasticsearch

  1. 安装elasticsearch的唯一条件是必须安装 java 运行环境
  2. 下载最新版本的 elasticsearch
  3. 安装marvel

    marvel 为 elasticsearch 的集群监控工具

    • 直接从互联网下载安装:

      bin/plugin -i elasticsearch/marvel/lastest
    • 上面一种方法可能会因为网络原因安装失败,可以指定文件安装:

      ➜  elasticsearch  bin/plugin -i elasticsearch/marvel/lastest -u file:///home/jeffor/space/package/marvel-latest.zip
      -> Installing elasticsearch/marvel/lastest...
      Trying file:/home/jeffor/space/package/marvel-latest.zip...
      Downloading ....................DONE
      Installed elasticsearch/marvel/lastest into /home/jeffor/space/apps/elasticsearch/plugins/marvel
    • 若不想 marvel 监控elasticsearch 集群,可以配置如下:

      echo 'marvel.agent.enabled: false' >> ./config/elasticsearch.yml

    marvel 在开发中使用是免费的,但是生产环境需要购买版权。可以使用其他的监控插件代替,如
    bigdesk, head

2. 启动和关闭

  1. 启动在前台:

    ./bin/elasticsearch

    对于启动在前台的服务 使用 ctl + c 即可关闭服务

  2. 启动在后台:

    ./bin/elasticsearch -d
  3. 使用marvel监控集群:

    在浏览器中打开 http://localhost:9200/_plugin/marvel

  4. 关闭 elasticsearch 服务:

    curl -XPOST "http://localhost:9200/_shutdown"

3. elasticsearch-servicewrapper 安装和使用

  • elasticsearch-servicewrapper 是 elasticsearch 服务的启动管理工具,能实现注册系统服务,快速启动关闭,非常方便。
  • 安装和使用:

    1. 下载elasticsearch-servicewrapper
    2. 将 elasticsearch-servicewrapper 中的 server 目录拷贝到 ES_HOME/bin/下
    3. 使用:

      ➜ elasticsearch ./bin/service/elasticsearch –help
      Unexpected command: –help

      Usage: ./bin/service/elasticsearch [ console | start | stop | restart | condrestart | status | install | remove | dump ]

      Commands:
      console Launch in the current console.
      start Start in the background as a daemon process.
      stop Stop if running as a daemon or in another console.
      restart Stop if running and then start.
      condrestart Restart only if already running.
      status Query the current status.
      install Install to start automatically when system boots.
      remove Uninstall.
      dump Request a Java thread dump if running.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值