系统: Mac OS X
Elasticsearch 版本: 5.6.4 Analysis-ik 5.6.4
# 更新 brew
$ brew update
# 修改formula
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
$ git checkout 5874ac8c8fab69f8a714d643581e489bcb176d92 elasticsearch@5.6.rb
# 安装
$ brew install elasticsearch@5.6
# 查看
$ brew info elasticsearch@5.6
# 锁定版本, 防止被误升级
$ brew pin elasticsearch@5.6
# 安装ik
$ cd /usr/local/Cellar/elasticsearch@5.6/5.6.4
$ bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.4/elasticsearch-analysis-ik-5.6.4.zip
配置
# /usr/local/etc/elasticsearch/elasticsearch.yml
cluster.name: 集群名字
node.name: 节点名
path.data: 数据存储目录
path.logs: 日志存储目录
action.auto_create_index: false
内存
# /usr/local/etc/elasticsearch/jvm.options
# 指定使用内存
-Xms128m
-Xmx128m
使用
# 查看状态
$ brew services list
# 启动/重启/停止
$ brew services start elasticsearch@5.6
$ brew services restart elasticsearch@5.6
$ brew services stop elasticsearch@5.6