CentOS7 cluster environment Elastic configuration

(First Quguan network download elasticsearch the source code and extract to / usr / soft directory)

(The default root account)

1. Change profile

File Path: /usr/soft/elasticsearch-6.2.2/config/elasticsearch.yml

Open: notepad ++

Modify the content:

cluster.name: Host Name (their definition)

node.name: the current node name (their definition)

network.host: current ip address (current machine)

Note: The # sign in front also deleted

2. Authorization to ordinary users

Command: chown hy /usr/soft/elasticsearch-6.2.2 -R

hy for the average user name, -R behalf of recursion, granted to all files in the folder permissions to user hy

elasticsearch root account is not allowed to run

3. Ordinary users to run the program

su hy

cd /usr/soft/elasticsearch-6.2.2/bin 

sh elasticsearch

Here without -d

Found error: insufficient maximum memory, virtual memory

4. Modify the configuration file

we /etc/security/limits.conf

At the end of the last append the following:

* soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096





 

we /etc/sysctl.conf

At the end of the additional following:

vm.max_map_count=655360

Finally, execute the command:

sysctl -p

Again switched to the regular user, use the sh elasticsearch command, if the command line does not occur, then the success of open

Page-ended input

https: // Native ip: 9200 
prompted to download json json or text that is showing success

5. Installation nodeJS

es-head needs nodeJS environment support

First, install the necessary software packages compiled

sudo yum install gcc gcc-c++

II. Nodejs download the tar package (Source Code)

You can download page https://nodejs.org/en/download/ find the download address manually spread centos

You can also use the following command to directly download:

cd /usr/soft
wget https://nodejs.org/dist/v9.3.0/node-v9.3.0.tar.gz

Third, the installation package decompression nodejs

cd /usr/soft
tar -zxvf node-v9.3.0.tar.gz

Fourth, the node into the decompression folder, start compiling

cd node-v9.3.0/
./configure
make

make the process takes a long time

V. Installation Nodejs

the make install sudo 
// If the final prompt ERR error, repeat

Sixth, verification

node -v

6. Installation es-head

Download es-head

cd /usr/soft
wget  https://github.com/mobz/elasticsearch-head/archive/master.zip

Decompression

cd /usr/soft
unzip elasticSearch-head-master

command

cd /usr/soft/elasticSearch-head-master
npm install

Elasticsearch modify configuration files

cd /usr/soft/elasticsearch-6.2.2/config/ vi elasticsearch.yml

End of the file wrapping additional content:

http.cors.enabled: true

http.cors.allow-origin: "*"

 

2. Switch to the normal user

cd /usr/soft/elasticsearch-6.2.2/bin

sh elasticsearch -d

Login browser address localhost: 9200 appears json file that is downloaded es successful start

 

3. to root

 npm run start

At this point the browser login address localhost: 9100 appears management interface that is es-head, npm successful start

 

4. Add address of the child node and connected in 9100 page.

 

 

Guess you like

Origin www.cnblogs.com/whoyoung/p/10959183.html