Install ElasticSearch2.0.0 on CentOS 6.7

Source: Internet
Author: User

Install ElasticSearch2.0.0 on CentOS 6.7

"Is it true that all sparrow will die in winter? Are all people losing their conscience in money? Is it true that only poor children can sing the most beautiful songs; is it true that only wandering people understand the bitterness of life." -- Shi

1. install and configure jdk

First, install jdk,
Initially using commandsyum install javaThe installed java does not have javac. In fact, I am not sure which packages are specific, so I will enable the willful mode-I don't care, so I will install all the packages related to version 1.7.0 ......

yum list java*yun install java-1.7.0-openjdk*

Then you need to set the JAVA_HOME environment variable. The question is, where is the jdk path just installed?

rpm -qa | grep java

Take a look and find a package namedjava-1.7.0-openjdk-1.7.0.91-2.6.2.2.el6_7.x86_64

rpm -ql java-1.7.0-openjdk-1.7.0.91-2.6.2.2.el6_7.x86_64

So I listed a large string of paths and found them./usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64/jre/bin, Cd found in this directory. Well, javac and java all have it. Configure the JAVA_HOME environment variable below

vim /etc/profile

Add

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport PATH=$PATH:$JAVA_HOME/bin

:wqExit the vim editor, and thensource /etc/profileThat's all.

2. ElasticSearch installation Configuration

Here using the yum method to install ES official site has instructions: https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html first download and install the Public Key

rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch

Configure the yum Source

vim /etc/yum.repos.d/elasticsearch.repo

elasticsearch.repoContent:

[elasticsearch-2.x]name=Elasticsearch repository for 2.x packagesbaseurl=http://packages.elastic.co/elasticsearch/2.x/centosgpgcheck=1gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearchenabled=1

Thenyum makecacheUpdate cache,

yum install elasticsearch

Elasticsearch installation is complete.

Then we need to run ElasticSearch as a service, refer to here https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-service.html

sudo /sbin/chkconfig --add elasticsearchsudo service elasticsearch start

So far, the elasticsearch service has been started. Visit port 9200.

curl -X GET localhost:9200
{  "name" : "Hindsight Lad",  "cluster_name" : "elasticsearch",  "version" : {    "number" : "2.0.0",    "build_hash" : "de54438d6af8f9340d50c5c786151783ce7d6be5",    "build_timestamp" : "2015-10-22T08:09:48Z",    "build_snapshot" : false,    "lucene_version" : "5.2.1"  },  "tagline" : "You Know, for Search"}

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.