-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Build on top of #3881 and put docs in custom_installs. #4196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f31d441
written guide for elasticsearch local
irkartik b448a88
done requested changes and resolved styling issues
irkartik 9363600
typo correction
irkartik 4adc8a6
grammar correction
irkartik 3c73c7c
converted indentation to spaces
irkartik ec37b68
added link from install.rst to run-elasticsearch-local.rst
irkartik a5c86fe
removed unwanted line
irkartik 1d76345
Merge branch 'elasticsearch-guide' of https://github.com/rajujha373/r…
ericholscher 6cd82f7
Move elastic search guide to custom installs & link to it properly
ericholscher 09beef8
Mention ICU plugin
ericholscher de6b4ae
Merge remote-tracking branch 'origin/master' into rajujha373-elastics…
ericholscher 288ac2b
More details
ericholscher f42fd65
No json
ericholscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
========================================== | ||
Enabling Elasticsearch on the local server | ||
========================================== | ||
|
||
Read the Docs has been using Elasticsearch for indexing and searching. To enable this on your local installation, you need to install elasticsearch and run the Elastic server locally. | ||
|
||
Installation has been mainly divided into following steps. | ||
|
||
1. Installing Java | ||
------------------ | ||
|
||
Elasticsearch requires Java 8 or later. Use `Oracle official documentation <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_. | ||
or opensource distribution like `OpenJDK <http://openjdk.java.net/install/>`_. | ||
|
||
After installing java, verify the installation by,:: | ||
|
||
$ java -version | ||
|
||
The result should be something like this:: | ||
|
||
openjdk version "1.8.0_151" | ||
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12) | ||
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) | ||
|
||
|
||
2. Downloading and installing Elasticsearch | ||
------------------------------------------- | ||
|
||
Elasticsearch can be downloaded directly from elastic.co. For Ubuntu, it's best to use the deb (Debian) package which will install everything you need to run Elasticsearch. | ||
|
||
RTD currently uses elasticsearch 1.x which can be easily downloaded and installed from `elastic.co | ||
<https://www.elastic.co/downloads/past-releases/elasticsearch-1-3-8/>`_. | ||
|
||
Install the downloaded package by following command:: | ||
|
||
$ sudo apt install .{path-to-downloaded-file}/elasticsearch-1.3.8.deb | ||
|
||
|
||
3. Running Elasticsearch from command line | ||
------------------------------------------ | ||
|
||
Elasticsearch is not started automatically after installation. How to start and stop Elasticsearch depends on whether your system uses SysV init or systemd (used by newer distributions). You can tell which is being used by running this command:: | ||
|
||
$ ps -p 1 | ||
|
||
**Running Elasticsearch with SysV init** | ||
|
||
Use the ``update-rc.d command`` to configure Elasticsearch to start automatically when the system boots up:: | ||
|
||
$ sudo update-rc.d elasticsearch defaults 95 10 | ||
|
||
Elasticsearch can be started and stopped using the service command:: | ||
|
||
$ sudo -i service elasticsearch start | ||
$ sudo -i service elasticsearch stop | ||
|
||
If Elasticsearch fails to start for any reason, it will print the reason for failure to STDOUT. Log files can be found in /var/log/elasticsearch/. | ||
|
||
**Running Elasticsearch with systemd** | ||
|
||
To configure Elasticsearch to start automatically when the system boots up, run the following commands:: | ||
|
||
$ sudo /bin/systemctl daemon-reload | ||
$ sudo /bin/systemctl enable elasticsearch.service | ||
|
||
Elasticsearch can be started and stopped as follows:: | ||
|
||
$ sudo systemctl start elasticsearch.service | ||
$ sudo systemctl stop elasticsearch.service | ||
|
||
To verify run:: | ||
|
||
$ curl http://localhost:9200 | ||
|
||
You need the icu plugin:: | ||
|
||
$ elasticsearch/bin/plugin -install elasticsearch/elasticsearch-analysis-icu/2.3.0 | ||
|
||
You should get something like: | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
status: 200, | ||
name: "Amina Synge", | ||
version: { | ||
number: "1.3.8", | ||
build_hash: "475733ee0837fba18c00c3ee76cd49a08755550c", | ||
build_timestamp: "2015-02-11T14:45:42Z", | ||
build_snapshot: false, | ||
lucene_version: "4.9" | ||
}, | ||
tagline: "You Know, for Search" | ||
} | ||
|
||
4. Index the data available at RTD database | ||
------------------------------------------- | ||
|
||
In order to search through the RTD database, you need to index it into the elasticsearch index:: | ||
|
||
$ python manage.py reindex_elasticsearch | ||
|
||
You are ready to go! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to install the plugin before starting the elasticsearch