ref
install eleasticsearch on CentOS 7.3 - AKAI TSUKI
environment
hostname | ip | node |
---|---|---|
cent7no31 | 172.16.10.231 | Coordinating node, elasticsearch-head |
pre install
install bzip2 and lbzip2 for tar command.
# yum install bzip2 # yum install lbzip2
install git and nodejs
# yum install -y git # yum install -y epel-release # yum install -y nodejs
install elasticsearch-head
GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster
install
# git clone git://github.com/mobz/elasticsearch-head.git # cd elasticsearch-head # npm install > phantomjs-prebuilt@2.1.16 install /root/elasticsearch-head/node_modules/phantomjs-prebuilt > node install.js PhantomJS not found on PATH Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 Verified checksum of previously downloaded file Extracting tar contents (via spawned process) Removing /root/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1509856016577/phantomjs-2.1.1-linux-x86_64 -> /root/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom Writing location.js file Done. Phantomjs binary available at /root/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs elasticsearch-head@0.0.0 /root/elasticsearch-head *snip* npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression #
note
When I execute npm install
, error occured as follows:
# npm install npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference #
so, I execute command as follows:
# yum update openssl
start elasticsearch-head
[root@cent7no31 ~]# cd elasticsearch-head/ [root@cent7no31 elasticsearch-head]# npm run start > elasticsearch-head@0.0.0 start /root/elasticsearch-head > grunt server Running "connect:server" (connect) task Waiting forever... Started connect web server on http://localhost:9100
configure elasticsearch
add two parameters to elasticsearch.yml
# vi /etc/elasticsearch/elasticsearch.yml http.cors.enabled: true http.cors.allow-origin: "*"
as a result,
# grep -v "^#" /etc/elasticsearch/elasticsearch.yml | grep -v "^$" cluster.name: test-cluster node.name: cent7no31 network.host: 0.0.0.0 discovery.zen.ping.unicast.hosts: ["cent7no11", "cent7no12", "cent7no13", "cent7no31"] node.master: false node.data: false node.ingest: false http.cors.enabled: true http.cors.allow-origin: "*" #
restart elasticsearch
# systemctl restart elasticsearch
open elastic
open http://172.16.10.231:9100/
by browser
change connection url to elasticsearch
change from http://localhost:9200/
to http://172.16.10.231:9200/
,
and push Connect
button.