Mac elasticsearch installation

elasticsearch version: 5.6.4

System: Mac OS X 10.10.5

Java: 1.8.0_73

1. Unzip the installation

1. Preparation

        Go to the elasticsearch official website to download the corresponding version 5.6.4

         Download the corresponding noon participle version ik 5.6.4

2. Unzip the configuration (default download directory ~/Downloads)

    2.1 Create the analysis-ik directory under the elasticsearch-5.6.4/config and elasticsearch-5.6.4/plugins directories respectively

        mkdir ~/Downloads/elasticsearch-5.6.4/plugins/analysis-ik

        mkdir ~/Downloads/elasticsearch-5.6.4/config/analysis-ik

    2.2 Copy files        

cp -rf ~/Downloads/elasticsearch/config/* ~/Downloads/elasticsearch-5.6.4/config/analysis-ik
cp -rf ~/Downloads/elasticsearch/plugins/* ~/Downloads/elasticsearch-5.6.4/plugins/analysis-ik

3. The test is normal

    start up

    

~/Downloads/elasticsearch-5.6.4/bin/elasticsearch

    an examination

curl -XGET "localhost:9200"
curl -XPUT "localhost:9200/index"
curl -XPOST "localhost:9200/index/_analyze?pretty=true" -d "我爱北京天安门"

directory agency

elasticsearch 5.6.4/config/analysis-ik

├── extra_main.dic
├── extra_single_word.dic
├── extra_single_word_full.dic
├── extra_single_word_low_freq.dic
├── extra_stopword.dic
├── IKAnalyzer.cfg.xml
├── main.dic
├── preposition.dic
├── quantifier.dic
├── stopword.dic
├── suffix.dic
└── surname.dic

elasticsearch 5.6.4/plugins/analysis-ik
├── commons-codec-1.9.jar
├── commons-logging-1.2.jar
├── elasticsearch-analysis-ik-5.5.2.jar
├── httpclient-4.5.2.jar
├── httpcore-4.4.4.jar
└── plugin-descriptor.properties

 

Second, brew installation

# 更新 brew
$ brew update
# 修改formula
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
$ git checkout 5874ac8c8fab69f8a714d643581e489bcb176d92 [email protected]
# 安装
$ brew install [email protected]
# 查看
$ brew info [email protected]
# 锁定版本, 防止被误升级
$ brew pin [email protected]
# 安装ik
$ cd /usr/local/Cellar/[email protected]/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

configure

# /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

use

# 查看状态
$ brew services list
# 启动/重启/停止
$ brew services start [email protected]
$ brew services restart [email protected]
$ brew services stop [email protected]

    

    

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324950297&siteId=291194637