Installation of ES and its plugins

1. Install and run
elasticsearch 1. Pre-install java8
jdk-8u112-linux-x64.rpm
Download address: http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Download
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.tar.gz
3. Unzip
tar -xvf elasticsearch-5.5.1.tar.gz
4. Run
./bin/elasticsearch
./ bin/elasticsearch -d #Run in the background
tail -f logs/elasticsearch.log #View logs

Note: ES has the ability to execute scripts. Due to security factors, it cannot be run under the root user. Forcible operation will report the following error:
org.elasticsearch. bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
Solution:
groupadd es #Add es group
useradd es -g es -p pwd #Add es user and attach to es group
chown -R es:es elasticsearch-5.5.1 #Give directory permissions
su es #Use es
user./bin/elasticsearch -d #Run es
external network in the background to access
vi conf/elasticsearch.yml
Modify network.host:

0.0.0.0Note : When restarting, the following error may appear.
Problem 1
ERROR: bootstrap checks failed

max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]

Reason: Unable to create local files problem, the maximum number of files the user can create is too small

Solution:
Switch to root user , edit the limits.conf configuration file, and add content similar to the following:

vi /etc/security/limits.conf

Add the following content:
* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096
Note: * represents all Linux user names (such as hadoop)
Question 2:
max number of threads [1024] for user [es] likely too low, increase to at least [2048]
Reason: Unable to create local threads, the maximum number of threads the user can create is too small
Solution: Switch to root user and enter limits. In the d directory, modify the 90-nproc.conf configuration file.

vi /etc/security/limits.d/90-nproc.conf

find the following:

* soft nproc 1024 #Modify

to

* soft nproc 2048
Question 3:
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
Reason: The maximum virtual memory is too small
Solution: Switch to the root user, modify the configuration file sysctl.conf

vi /etc/sysctl.conf and

add the following configuration:

vm.max_map_count=655360

and execute the command:

sysctl -p
problem Four:
Startup exception: ERROR: bootstrap checks failed
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

Reason: Because Centos6 does not support SecComp, and ES5.2.1 defaults bootstrap.system_call_filter to true for detection, the detection fails, After the failure, the ES cannot be started directly.
Solution: configure bootstrap.system_call_filter to false in elasticsearch.yml, pay attention to the following memory:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
Second, install the elasticsearch-head plugin
elasticsearch 5 and later versions are relatively new and do not support direct installation head plugin.
1. Download head plugin
wget https://codeload.github.com/mobz/elasticsearch-head/zip/master
2. Download nodejs
wget https://nodejs.org/dist/v6.9.2/node-v6.9.2- linux-x64.tar.xz
Note that there is an error here, and the --no-check-certificate parameter is required to force the download.
3. Configure the node environment variable

tar –xvf node-v6.9.2-linux-x64.tar.xz
mv node-v6.9.2-linux-x64 /usr/node/

vim /etc/profile
export NODE_HOME=/usr/node/node-v6.9.2-linux-x64
export PATH=$PATH:$NODE_HOME/bin
source /etc/profile

# node –v
v6.9.2
# npm –v
3.10.9
4、安装grunt

cd elasticsearch-head-master
npm install grunt --registry=https://registry.npm.taobao.org
进入目录:
/usr/elasticsearch-head-master/node_modules/grunt/bin
执行./grunt
出现以下提示,为Gruntfile.js引用的,缺少以下包

>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue.

Aborted due to warnings.

安装

npm install grunt-contrib-clean --registry=https://registry.npm.taobao.org

npm install grunt-contrib-concat --registry=https://registry.npm.taobao.org

npm install grunt-contrib-watch --registry=https://registry.npm.taobao.org
npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org
npm install grunt-contrib-copy --registry=https://registry.npm.taobao.org
npm install grunt-contrib-jasmine --registry=https://registry.npm.taobao.org

6. Run

grunt server


7. Test

http://localhost:9100/
Modify the Gruntfile.js configuration in the head directory, head defaults Monitor 127.0.0.1

vm Gruntfile.js

hostname: '0.0.0.0',

8. Set cross-domain access for es

vi config/elasticsearch.yml #Add two lines

http.cors.enabled: true

http.cors.allow-origin: "*"

9. Start es, start the head plugin
3. Kibana installation
1. Download
Wget https://artifacts.elastic.co/downloads/ibana/kibana-5.5.1-linux-x86_64.tar.gz
tar -xvf kibana -5.5.1-Linux-x86_64.tar.gz
2. Configure Kibana
vim config/kibana.yml
server.host: "0.0.0.0" elasticsearch.url
: http://localhost:9200
3. start kabana
./kabana
4. Visit
http://localhost:5601

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326903270&siteId=291194637
Recommended