Install ElasticSearch2.3.3 on Centos 6.7

Source: Internet
Author: User

Install ElasticSearch2.3.3 on Centos 6.7

You can learn ElasticSearch, which is called the new full text. The first time a newbie installs a new full text, there are still many problems.

1. About ElasticSearch

ElasticSearch is a Lucene-based search tool. It is developed in Java and uses Lucene as the core for indexing and searching. However, it aims to hide the complexity of Lucene through a simple Restful API, making full-text search easier.

However, Elasticsearch not only describes Lucene and full-text search, but also describes it as follows:
1) distributed real-time file storage. Each field is indexed and searchable.
2) distributed real-time analysis and search engine
3) it can be expanded to hundreds of servers to process PB-level structured or unstructured data.
In addition, all these functions are integrated into a service. Your application can interact with it through simple RestfulAPI, client in various languages, or even command lines.

2. download the latest ElasticSearch installation package, which can be directly deployed on Linux.

Before installation, make sure that the latest JDK version is installed. For installation steps, see other user articles. It is best to put the installed toolkit in the/opt directory and install it in the/home directory under centos 6.7. Run the wget command to get the zip installation package.

[Plain] view plaincopy
  1. Elasticsearch2.3.3
  2. ZIPhttps: // download. elastic. co/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.3.3/elasticsearch-2.3.3.zip </span>
  3. Woohoo! Yourdownloadisalmostcomplete! It 'sclearyou' reabouttodogreatthingswithdata. whetherthisyourfirst, tenth, orumpteenthdownloadofanopensourceElasticproject, there 'salwayssomethingnewtolearn.
  4. So, beforeyoudiveincluthedocumentation, haveagandatthegoodnessbelow. Trysomethingnew, expandtoanewusecase, thinkupsomethingtotallynovel, and, aboveall, staycurious.

3. Officially install ElasticSearch

Decompress the zip package In the root user and/home directory, create a soft connection In-s ElasticSearch2.3.3 elasticsearch, cd/elasticsearch, and run./bin/elasticsearch. the following error occurs:

[Plain] view plaincopy
  1. [Root @ xxxxbin] #./elasticsearch
  2. Exceptioninthread "main" java. lang. RuntimeException: don 'trunelasticsearchasroot. </span>
  3. Atorg. elasticsearch. bootstrap. Bootstrap. initializeNatives (Bootstrap. java: 93)
  4. Atorg. elasticsearch. bootstrap. Bootstrap. setup (Bootstrap. java: 144)
  5. Atorg. elasticsearch. bootstrap. Bootstrap. init (Bootstrap. java: 270)
  6. Atorg. elasticsearch. bootstrap. Elasticsearch. main (Elasticsearch. java: 35)
  7. Refertothelogforcompleteerrordetails.

This is a condition set by ElasticSearch for system security considerations. Because ElasticSearch can receive and execute user input scripts, you can create a separate user to run ElasticSearch for system security considerations.

1) create a separate user group and elsearch User:

[Plain] view plaincopy
  1. Groupaddelsearch
  2. Useraddelsearch-gelsearch-pelasticsearch

2) Change/home/elasticsearch users and groups:

[Plain] view plaincopy
  1. <Spanstyle = "white-space: pre"> </span> cd/home
  2. <Spanstyle = "white-space: pre"> </span> chown-Relsearch: elsearchelasticsearch

3) use the elsearch user to execute the installation command

[Plain] view plaincopy
  1. <Spanstyle = "white-space: pre"> </span> suelsearch
  2. <Spanstyle = "white-space: pre"> </span> RUN cdelasticsearch/bin./elasticsearch
4. About Installing plugins (plug-in Management)

[Plain] view plaincopy
  1. Exceptioninthread "main" java. lang. IllegalStateException: Unabletoaccess 'path. INS ins '(/home/hye/elasticsearch/plugins)
  2. Likelyrootcause: java. nio. file. AccessDeniedException:/home/hye/elasticsearch/plugins
  3. Atsun. nio. fs. UnixException. translateToIOException (UnixException. java: 84)
  4. Atsun. nio. fs. UnixException. rethrowAsIOException (UnixException. java: 102)
  5. Atsun. nio. fs. UnixException. rethrowAsIOException (UnixException. java: 107)
  6. Atsun. nio. fs. UnixFileSystemProvider. createDirectory (UnixFileSystemProvider. java: 384)
  7. Atjava. nio. file. Files. createDirectory (Files. java: 674)
  8. Atjava. nio. file. Files. createAndCheckIsDirectory (Files. java: 781)
  9. Atjava. nio. file. Files. createDirectories (Files. java: 767)
  10. Atorg. elasticsearch. bootstrap. Security. ensureDirectoryExists (Security. java: 337)
  11. Atorg. elasticsearch. bootstrap. Security. addPath (Security. java: 314)
  12. Atorg. elasticsearch. bootstrap. Security. addFilePermissions (Security. java: 246)
  13. Atorg. elasticsearch. bootstrap. Security. createPermissions (Security. java: 212)
  14. Atorg. elasticsearch. bootstrap. Security. configure (Security. java: 118)
  15. Atorg. elasticsearch. bootstrap. Bootstrap. setupSecurity (Bootstrap. java: 196)
  16. Atorg. elasticsearch. bootstrap. Bootstrap. setup (Bootstrap. java: 167)
  17. Atorg. elasticsearch. bootstrap. Bootstrap. init (Bootstrap. java: 270)
  18. Atorg. elasticsearch. bootstrap. Elasticsearch. main (Elasticsearch. java: 35)
  19. Refertothelogforcompleteerrordetails.

Follow the instructions on plguins Managerment on the official website and install the tool:

4.1 preparations before installation

[Plain] view plaincopy
  1. Runningasroot
  2. IfElasticsearchwasinstalledusingthedeborrpmpackagethenrunbin/pluginasrootsoitcanwritetotheappropriatefilesondisk. Otherwiserunbin/pluginastheuserthatownsalloftheElasticsearchfiles.

4.2 formally install the plugins plug-in

I have installed Core Elasticsearch plugins. Follow the steps shown in the figure to complete the installation.

[Plain] view plaincopy
  1. PluginManagement
  2. CoreElasticsearchpluginsedit
  3. CoreElasticsearchpluginscanbeinstalledasfollows:
  4. Sudobin/plugininstall [plugin_name]
  5. Forinstance, toinstallthecoreICUplugin, justrunthefollowingcommand:
  6. Sudobin/plugininstallanalysis-icu
  7. ThiscommandwillinstalltheversionofthepluginthatmatchesyourElasticsearchversion.
  8. Communityandnon-corepluginsedit
  9. Non-linear, orpluginsprovidedbythecommunity, canbeinstalledfromdownload. elastic. co, fromMaven (CentralandSonatype), orfromGitHub. Inthiscase, thecommandisasfollows:
  10. Sudobin/plugininstall [org]/[user | component]/[version] </span> <spanstyle = "font-size: 14px;">

5. Start ElasticSearch

Use a non-root user for installation:

[Plain] view plaincopy
  1. <Spanstyle = "white-space: pre"> </span> suelsearch
  2. <Spanstyle = "white-space: pre"> </span> cdelasticsearch/bin
  3. <Spanstyle = "white-space: pre"> </span>./elasticsearch

[Plain] view plaincopy
  1. If you want ElasticSearch to run on the backend:
  2. <Spanstyle = "white-space: pre"> </span>./elasticsearch-d

Console: (ElasticSearch started successfully)

[Plain] view plaincopy
  1. [Elsearch @ xhyu-100elasticsearch] $./bin/elasticsearch
  2. [2016-06-1900: 27: 24,188] [WARN] [bootstrap] unabletoinstallsyscallfilter: seccompunavailable: config_seccompnotcompiled1_kernel, CONFIG_SECCOMPandCONFIG_SECCOMP_FILTERareneeded
  3. [2016-06-1900: 27: 24,417] [INFO] [node] [Mad-Dog] version [2.3.3], pid [4260], build [218bdf1/2016-05-17T15: 40: 04Z]
  4. [2016-06-1900: 27: 24,417] [INFO] [node] [Mad-Dog] initializing...
  5. [2016-06-1900: 27: 25,040] [INFO] [plugins] [Mad-Dog] modules [reindex, lang-expression, lang-groovy], plugins [analysis-icu], sites []
  6. [2016-06-1900: 27: 25,066] [INFO] [env] [Mad-Dog] using [1] datapaths, mounts [[/(/dev/sda3)], netusable_space [33.4 gb], nettotal_space [45.6 gb], spins? [Possibly], types [ext4]
  7. [2016-06-1900: 27: 25,066] [INFO] [env] [Mad-Dog] heapsize [1015.6 mb], compressedordinaryobjectpointers [true]
  8. [2016-06-1900: 27: 25,066] [WARN] [env] [Mad-Dog] maxfiledescriptors [4096] forelasticsearchprocesslikelytoolow, considerincreasingtoatleast [65536]
  9. [2016-06-1900: 27: 27,264] [INFO] [node] [Mad-Dog] initialized
  10. [2016-06-1900: 27: 27,264] [INFO] [node] [Mad-Dog] starting...
  11. [2016-06-1900: 27: 27,330] [INFO] [transport] [Mad-Dog] publish_address {192.168.31.200: 9300}, bound_addresses {192.168.31.200: 9300}
  12. [2016-06-1900: 27: 27,333] [INFO] [discovery] [Mad-Dog] elasticsearch/-H0Z_q6iRsuYDXd1b1jCAg
  13. [2016-06-1900: 27: 30,390] [INFO] [cluster. service] [Mad-Dog] new_master {Mad-Dog} {-H0Z_q6iRsuYDXd1b1jCAg} {192.168.31.200} {192.168.31.200: 9300}, reason: zen-disco-join (elected_as_master, [0] joinsreceived)
  14. [2016-06-1900: 27: 30,420] [INFO] [http] [Mad-Dog] publish_address {192.168.31.200: 9200}, bound_addresses {192.168.31.200: 9200}
  15. [2016-06-1900: 27: 30,420] [INFO] [node] [Mad-Dog] started
  16. [2016-06-1900: 27: 30,441] [INFO] [gateway] [Mad-Dog] recovered [0] indicesintoter_state

6. failed to verify the ElasticSearch interface. Modify the ElasticSearch configuration file.

Use a non-root user to install elasticsearch before modifying the configuration file.

[Plain] view plaincopy
  1. [Root @ xxxxelasticsearch] # curl-XGEThttp: // machine ip: 9200/
  2. Curl :( 7) couldn 'tconnecttohost

According to the online articles and installation instructions on the official website, the default configuration file is not modified.

[Plain] view plaincopy
  1. /Home/hye/elasticsearch/config

After the modification, enable the verification interface. It is best to find a better browser, and the QQ browser will be unavailable. You can use the Chrome browser.

Enter http: // the ip address of the server to be installed: 9200/on the page. The following information is returned:

[Plain] view plaincopy
  1. {
  2. "Name": "Mad-Dog ",
  3. "Cluster_name": "elasticsearch ",
  4. "Version ":{
  5. "Number": "2.3.3 ",
  6. "Build_hash": "218bdf000090eef486ff2c41a3df5cfa32dadcfde ",
  7. "Build_timestamp": "2016-05-17T15: 40: 04Z ",
  8. "Build_snapshot": false,
  9. "Inclue_version": "5.5.0"
  10. },
  11. "Tagline": "YouKnow, forSearch"
  12. }

So far, the installation is complete...

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.