CentOS6.5 install Elasticsearch

Source: Internet
Author: User
ElasticSearch is an open-source, distributed, and RESTful search engine built based on Lucene. Designed for cloud computing, it can achieve real-time search, stability, reliability, and speed. 1. wgethttp: // download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-i586.rpm? Authpartam = 1416

ElasticSearch is an open-source, distributed, and RESTful search engine built based on Lucene. Designed for cloud computing, it can achieve real-time search, stable, reliable, fast, and easy to install and use.

1. wget http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-i586.rpm? AuthParam = 1416296390_276056c6b0870494311edae301500e4f

2, sudo rpm-ivh jdk-7u71-linux-i586.rpm

3. which java

4. vi ~ /. Bash_profile

 

Export JAVA_HOME =/usr/java/jdk1.7.0 _ 71
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ HOME/bin: $ JAVA_HOME/bin

 

5. source ~ /. Bash_profile & java-version

6. wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.0.tar.gz

7. tar zxf elasticsearch-1.4.0.tar.gz & cd elasticsearch-1.4.0/config

8. vim elasticsearch. yml

Node. name: "hiwechat"

Index. number_of_shards: 10

Index. number_of_replicas: 1

9. cd ../bin

10./elasticsearch-d

11. telnet 127.0.0.1 9300

12../plugin-install medcl/elasticsearch-analysis-ik/1.2.6

13. cd ../config/

14. wget http://github.com/downloads/medcl/elasticsearch-analysis-ik/ik.zip

15. unzip ik.zip

16. rm-rf ik.zip

Other: https://github.com/medcl/elasticsearch-rtf

17. yum install python-pip

18. pip install argparse

19. pip install elasticsearch

20. curl-x get localhost: 9200

21. python

 >>> from datetime import datetime

>>> From elasticsearch import Elasticsearch

# By default we connect to localhost: 9200

>>> Es = Elasticsearch ()

# Create an index in elasticsearch, ignore status code 400 (index alreadyexists)

>>> Es. indices. create (index = 'My-Index', ignore = 400)

{U'acknodgdged': True}

# Datetimes will be serialized

>>> Es. index (index = "my-index", doc_type = "test-type", id = 42, body = {"any": "data", "timestamp": datetime. now ()})

{U' _ id': u'42 ', u' _ INDEX': u'my-Index', u' _ type': u'test-type ', u' _ version': 1, u' OK ': True}

# But not deserialized

>>> Es. get (index = "my-index", doc_type = "test-type", id = 42) ['_ source']

{U'any': u'data', u'timestamp': u'2017-05-12T19: 45: 100 '}

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.