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
- Elasticsearch2.3.3
- ZIPhttps: // download. elastic. co/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.3.3/elasticsearch-2.3.3.zip </span>
- Woohoo! Yourdownloadisalmostcomplete! It 'sclearyou' reabouttodogreatthingswithdata. whetherthisyourfirst, tenth, orumpteenthdownloadofanopensourceElasticproject, there 'salwayssomethingnewtolearn.
- 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
- [Root @ xxxxbin] #./elasticsearch
- Exceptioninthread "main" java. lang. RuntimeException: don 'trunelasticsearchasroot. </span>
- Atorg. elasticsearch. bootstrap. Bootstrap. initializeNatives (Bootstrap. java: 93)
- Atorg. elasticsearch. bootstrap. Bootstrap. setup (Bootstrap. java: 144)
- Atorg. elasticsearch. bootstrap. Bootstrap. init (Bootstrap. java: 270)
- Atorg. elasticsearch. bootstrap. Elasticsearch. main (Elasticsearch. java: 35)
- 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
- Groupaddelsearch
- Useraddelsearch-gelsearch-pelasticsearch
2) Change/home/elasticsearch users and groups:
[Plain] view plaincopy
- <Spanstyle = "white-space: pre"> </span> cd/home
- <Spanstyle = "white-space: pre"> </span> chown-Relsearch: elsearchelasticsearch
3) use the elsearch user to execute the installation command
[Plain] view plaincopy
- <Spanstyle = "white-space: pre"> </span> suelsearch
- <Spanstyle = "white-space: pre"> </span> RUN cdelasticsearch/bin./elasticsearch
4. About Installing plugins (plug-in Management)
[Plain] view plaincopy
- Exceptioninthread "main" java. lang. IllegalStateException: Unabletoaccess 'path. INS ins '(/home/hye/elasticsearch/plugins)
- Likelyrootcause: java. nio. file. AccessDeniedException:/home/hye/elasticsearch/plugins
- Atsun. nio. fs. UnixException. translateToIOException (UnixException. java: 84)
- Atsun. nio. fs. UnixException. rethrowAsIOException (UnixException. java: 102)
- Atsun. nio. fs. UnixException. rethrowAsIOException (UnixException. java: 107)
- Atsun. nio. fs. UnixFileSystemProvider. createDirectory (UnixFileSystemProvider. java: 384)
- Atjava. nio. file. Files. createDirectory (Files. java: 674)
- Atjava. nio. file. Files. createAndCheckIsDirectory (Files. java: 781)
- Atjava. nio. file. Files. createDirectories (Files. java: 767)
- Atorg. elasticsearch. bootstrap. Security. ensureDirectoryExists (Security. java: 337)
- Atorg. elasticsearch. bootstrap. Security. addPath (Security. java: 314)
- Atorg. elasticsearch. bootstrap. Security. addFilePermissions (Security. java: 246)
- Atorg. elasticsearch. bootstrap. Security. createPermissions (Security. java: 212)
- Atorg. elasticsearch. bootstrap. Security. configure (Security. java: 118)
- Atorg. elasticsearch. bootstrap. Bootstrap. setupSecurity (Bootstrap. java: 196)
- Atorg. elasticsearch. bootstrap. Bootstrap. setup (Bootstrap. java: 167)
- Atorg. elasticsearch. bootstrap. Bootstrap. init (Bootstrap. java: 270)
- Atorg. elasticsearch. bootstrap. Elasticsearch. main (Elasticsearch. java: 35)
- Refertothelogforcompleteerrordetails.
Follow the instructions on plguins Managerment on the official website and install the tool:
4.1 preparations before installation
[Plain] view plaincopy
- Runningasroot
- 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
- PluginManagement
- CoreElasticsearchpluginsedit
- CoreElasticsearchpluginscanbeinstalledasfollows:
- Sudobin/plugininstall [plugin_name]
- Forinstance, toinstallthecoreICUplugin, justrunthefollowingcommand:
- Sudobin/plugininstallanalysis-icu
- ThiscommandwillinstalltheversionofthepluginthatmatchesyourElasticsearchversion.
- Communityandnon-corepluginsedit
- Non-linear, orpluginsprovidedbythecommunity, canbeinstalledfromdownload. elastic. co, fromMaven (CentralandSonatype), orfromGitHub. Inthiscase, thecommandisasfollows:
- Sudobin/plugininstall [org]/[user | component]/[version] </span> <spanstyle = "font-size: 14px;">
5. Start ElasticSearch
Use a non-root user for installation:
[Plain] view plaincopy
- <Spanstyle = "white-space: pre"> </span> suelsearch
- <Spanstyle = "white-space: pre"> </span> cdelasticsearch/bin
- <Spanstyle = "white-space: pre"> </span>./elasticsearch
[Plain] view plaincopy
- If you want ElasticSearch to run on the backend:
- <Spanstyle = "white-space: pre"> </span>./elasticsearch-d
Console: (ElasticSearch started successfully)
[Plain] view plaincopy
- [Elsearch @ xhyu-100elasticsearch] $./bin/elasticsearch
- [2016-06-1900: 27: 24,188] [WARN] [bootstrap] unabletoinstallsyscallfilter: seccompunavailable: config_seccompnotcompiled1_kernel, CONFIG_SECCOMPandCONFIG_SECCOMP_FILTERareneeded
- [2016-06-1900: 27: 24,417] [INFO] [node] [Mad-Dog] version [2.3.3], pid [4260], build [218bdf1/2016-05-17T15: 40: 04Z]
- [2016-06-1900: 27: 24,417] [INFO] [node] [Mad-Dog] initializing...
- [2016-06-1900: 27: 25,040] [INFO] [plugins] [Mad-Dog] modules [reindex, lang-expression, lang-groovy], plugins [analysis-icu], sites []
- [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]
- [2016-06-1900: 27: 25,066] [INFO] [env] [Mad-Dog] heapsize [1015.6 mb], compressedordinaryobjectpointers [true]
- [2016-06-1900: 27: 25,066] [WARN] [env] [Mad-Dog] maxfiledescriptors [4096] forelasticsearchprocesslikelytoolow, considerincreasingtoatleast [65536]
- [2016-06-1900: 27: 27,264] [INFO] [node] [Mad-Dog] initialized
- [2016-06-1900: 27: 27,264] [INFO] [node] [Mad-Dog] starting...
- [2016-06-1900: 27: 27,330] [INFO] [transport] [Mad-Dog] publish_address {192.168.31.200: 9300}, bound_addresses {192.168.31.200: 9300}
- [2016-06-1900: 27: 27,333] [INFO] [discovery] [Mad-Dog] elasticsearch/-H0Z_q6iRsuYDXd1b1jCAg
- [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)
- [2016-06-1900: 27: 30,420] [INFO] [http] [Mad-Dog] publish_address {192.168.31.200: 9200}, bound_addresses {192.168.31.200: 9200}
- [2016-06-1900: 27: 30,420] [INFO] [node] [Mad-Dog] started
- [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
- [Root @ xxxxelasticsearch] # curl-XGEThttp: // machine ip: 9200/
- 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
- /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
- {
- "Name": "Mad-Dog ",
- "Cluster_name": "elasticsearch ",
- "Version ":{
- "Number": "2.3.3 ",
- "Build_hash": "218bdf000090eef486ff2c41a3df5cfa32dadcfde ",
- "Build_timestamp": "2016-05-17T15: 40: 04Z ",
- "Build_snapshot": false,
- "Inclue_version": "5.5.0"
- },
- "Tagline": "YouKnow, forSearch"
- }
So far, the installation is complete...