elasticsearch-1.7.1 Cluster Construction

Source: Internet
Author: User

# #elasticsearch-1.7.1 Cluster construction
redis1:192.168.1.10
redis2:192.168.1.11
redis3:192.168.1.12
# # #java安装
RPM–IVH jdk-7u67-linux-x64.rpm
Vi/root/.bash_profile
Add content
java_home=/usr/java/jdk1.7.0_67
Path= $JAVA _home/bin: $PATH
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export Java_home
Export PATH
Export CLASSPATH
#使变量文件生效
Source/root/.bash_profile
Test: Java–version
REDIS1 configuration:
Https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.1.tar.gz
1. Unzip the tar package to create the cluster node
Mkdir-pv/storage/local/elasticsearch-cluster
Mv-r/storage/home/elasticsearch-1.7.1/storage/local/elasticsearch-cluster/elasticsearch-node1

#进入到节点配置路径
[Email protected] elasticsearch-cluster]# CD elasticsearch-node1/config/
[[email protected] config]# ls
Elasticsearch.yml logging.yml
2. Create the cluster configuration information:
Vim Elasticsearch.yml
# ELASTICSEARCH-NODE1 Configuration
# Configure the cluster name
Cluster.name:elasticsearch-cluster-centos
# Configure node Name
Node.name: "Es-node1"
# set up a custom port for communication between nodes (default is 9300)
transport.tcp.port:9300
# Set the custom side to listen for HTTP transmissions (default is 9200)
http.port:9200
Elasticsearch configuration file description See: http://www.linuxidc.com/Linux/2015-02/114244.htm

3. Install the head plugin
#进入到节点bin路径

Cd/storage/local/elasticsearch-cluster/elasticsearch-node1/bin
Installing plugins
[Email protected] bin]#/plugin-install Mobz/elasticsearch-head

After installing the plug-in, a plugins directory is created in the ES node bin path sibling, storing the installed plug-in

4. Copy a configured node to Elasticsearch-node2

[[email protected] elasticsearch-cluster]# ls
Elasticsearch-node1 Elasticsearch-node2

5. Modify the cluster configuration information in Node 2

# ELASTICSEARCH-NODE2 Configuration
# Configure the cluster name
Cluster.name:elasticsearch-cluster-centos
# Configure node Name
Node.name: "Es-node2"
# set up a custom port for communication between nodes (default is 9300)
transport.tcp.port:9301
# Set the custom side to listen for HTTP transmissions (default is 9200)
http.port:9201

Description
The above configuration indicates that there are 2 nodes in the cluster, the nodes are named "Es-node1" and "Es-node2", and belong to the cluster "Elasticsearch-cluster-centos".
Node two in the port can not be configured, ES at boot will be detected, if the target port is occupied, the next port will be detected. Because two nodes are deployed on the same day virtual machines to better illustrate the problem, the corresponding ports are configured manually here.
We can view the corresponding boot information, as well as the port binding information, from the ES corresponding log ().

6. Start the node separately
Cd/storage/local/elasticsearch-cluster/elasticsearch-node1/bin
[Email protected] bin]#/elasticsearch-d-xms512m-xmx512m

As above, for the command to start Node 1, ES initiates configuration related logs to view Elasticsearch-cluster-centos.log.

[Email protected] logs]# pwd
/export/search/elasticsearch-cluster/elasticsearch-node2/logs
[[email protected] logs]# ls
Elasticsearch-cluster-centos_index_indexing_slowlog.log Elasticsearch-cluster-centos.log Elasticsearch-cluster-centos_index_search_slowlog.log

7. Our simple cluster configuration is complete. View the cluster
Because we have the head plugin installed, we can see through the plugin that the virtual machine IP is 192.168.1.108.

http://192.168.1.11:9200/_plugin/head/(corresponding node 1)
http://192.168.1.108:9201/_plugin/head/(corresponding node 2)
8. Installing the Marvel Plugin

Marvel is a Elasticsearch management and monitoring tool for development use free of charge. It is equipped with an interactive console called sense, which facilitates direct interaction with Elasticsearch through the browser.
Marvel is a plugin that runs the following code in the Elasticsearch directory to download and install:

./bin/plugin-i Elasticsearch/marvel/latest

If you want to prohibit marvel, you can use the following method

Echo ' Marvel.agent.enabled:false ' >>/config/elasticsearch.yml


This article from "My Sky" blog, declined reprint!

elasticsearch-1.7.1 Cluster Construction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.