elasticsearch-headプラグインをダウンロードしてインストールします



Download Install Elasticsearch Head Plugin



1つ:Gitをインストールします(インストールされていない場合)

1, yum install git 2. git --version #View version

2:ノードのインストール(インストールされていない場合)
1.ノードの公式ウェブサイトにアクセスしてLinuxバージョンをダウンロードします。32ビットバージョンと64ビットバージョンがあります。アドレスは次のとおりです。独自のサーバーモデルに従ってインストールしてください。
http://nodejs.cn/download/
2.ファイルをLinuxにアップロードします
3. tar -xvfnode-v8.9.3-linux-x64.tar.xzを使用して解凍します
4.ソフト接続を確立し、グローバルになります



ln -s /usr/local/node-v8.9.3-linux-x64/bin/npm /usr/local/bin/ ln -s /usr/local/node-v8.9.3-linux-x64/bin/node /usr/local/bin/

5.Linuxコマンドラインでnode-vコマンドはnodejsバージョンを表示します

6、cnpmをインストールします(npmを使用して他のプラグインをインストールすると失敗することがよくあります。もちろん、cnpmを使用すると、その逆もあります)



npm install -g cnpm --registry = https://registry.npm.taobao.org

3:gruntをインストールします(インストールされていない場合は、gruntを使用してheadプラグインを起動します)

npm install -g grunt-cli #Install grunt command line tool grunt-cli npm install grunt --save-dev #Install grunt and its plugins grunt -version #View the installation version

4:elasticsearch-headをダウンロードしてインストールします



# Select a directory and execute the following command. Don't clone the head plugin and put it in the plugins directory of elasticsearch, otherwise an error will be reported git clone git://github.com/mobz/elasticsearch-head.git #git download cd elasticsearch-head #Enter the directory npm install # If npm uses a lot of errors, try to use cnpm npm install grunt --save #Install grunt into the module and save

5:2つの場所の構成を変更します
(1):elasticsearch-5.5.2のインストールディレクトリの下にあるconfig /elasticsearch.ymlを変更します

# Add the following fields http.cors.enabled: true http.cors.allow-origin: '*'

(2):elasticsearch-headの下のGruntfile.jsを変更します

画像
(3)elasticsearch-headのデフォルトの接続アドレスを変更します。

#Enter the elasticsearch-head installation directory cd /usr/local/elasticsearch-head/_site/ vi app.js Modify the localhost in this.base_uri = this.config.base_uri || this.prefs.get('app-base_uri') || 'http://localhost:9200' to your es server address, mine is : 192.168.1.60:9200

(4)クロスドメインアクセスを許可するようにelasticsearchを構成します

Enter the elasticsearch configuration file and add the following two lines: http.cors.enabled: true http.cors.allow-origin: '*'

elasticsearch-headを再起動し、elasticsearchを構成します
起動画面が次のようになっている場合は、elasticsearch-headのインストールが成功していることを示しています。

grunt server (node:5687) ExperimentalWarning: The http2 module is an experimental API. Running 'connect:server' (connect) task Waiting forever... Started connect web server on http://localhost:9100