The wikis are now using the new authentication system.
If you did not migrate your account yet, visit https://idp-portal-info.suse.com/

User:Tsu2/elasticsearch logstash official repos

Jump to: navigation, search

Installing Elasticsearch on openSUSE/SUSE using the Elasticsearch Repos

These are the directions for setting up the repos and installing on openSUSE and SUSE. Although the official Elasticsearch repository instructions describe using YUM, we can use zypper while pointing to the official repos without any problem. And, because the java binaries do not have distro-specific dependencies, everything will "just work." Although there are repositories for other versions of Elasticsearch and Logstash, only the current latest are listed here because the assumption is that any reader of this Wiki is either new to Elasticsearch or is deploying a relatively new cluster in Production.

Alternatives to installing Elasticsearch from Repo

There are actually several ways to deploy Elasticsearch, installing from repo may not even be preferable. Other options include
- Download TAR file and extract
Because Elasticsearch is a Java binary, the extracted files can be run from anywhere
- RPM
Download and point zypper at the package. Installs Elasticsearch with standard locations, sets up a systemd Unit file. Same result as installing from repo, but without the repo.
- Embedded
Elasticsearch does not have to be downloaded and run on its own. It's also possible to download only Logstash (same running options as Elasticsearch) and specify launching an embedded Elasticsearch by merely describing in the Logstash config file. See Embedded_Elasticsearch_and_Kibana
- Dockerized
Although not an official Elasticsearch deployment method, I have verified that ES will run on openSUSE (and likely other distros) as a Docker Application. Although it may be possible to also run within a Dockerized openSUSE, this approach does isolate the entire OS, it isolates only the application running in an OS, somewhat similar (but not the same) as a Terminal Services Application Mode.
Dockerized Elasticsearch

The advantage of course to using the Elasticsearch repositories is that you can always update to the latest stable with a standard "zypper up" and when a technology like Elasticsearch is so fast moving(minor versions released regularly every few weeks) updating to latest conveniently can be important.

Icon-warning.png

All instances of Elasticsearch should be the same version or they may not form a cluster

.


Elasticsearch

1. If you haven't already done so, install the latest openJDK in the OSS repo. It's the only real dependency.
You only need to specify installing java, an appropriate openjdk will be installed providing a suitable JRE.

zypper in java

You may also wish to install Oracle SE JDK 1.7, this can be done is less than 30 seconds using scripts from here openSUSE_Oracle_Java_Install If you install both openJDK and Oracle JDK, you can switch between or verify the Java you are running with

update-alternatives --config java

2. Add the Elasticsearch repository
Note the following code sample suggests ES 1.3 which is current as of this writing. You can modify to install any ES version past or latest by either researching the available or inspecting the repo metadata (I'd think if you don't know how to read repo metadata you probably aren't likely going to want anything other than latest, stable). Notice also how ES names each version as a separate major release, so will not automatically upgrade.

zypper ar -f http://packages.elastic.co/elasticsearch/1.7/centos Elasticsearch_1.7_repository

3. Refresh your repos, and accept the GPG key for the new repo you just added

zypper --gpg-auto-import-keys ref

4. Search for Elasticsearch packages and install. Current packages recommended are "elasticsearch" and "rsyslog-module-elasticsearch" if you wish to input your syslogs directly into Elasticsearch. Is unneeded if you use Logstash to parse and index your syslog.

zypper in elasticsearch

5. After installation, you may wish to start your Elasticsearch

systemctl start elasticsearch

6. You may also want Elasticsearch to start up automatically on boot (as a Service)

systemctl enable elasticsearch

7. Don't forget to re-locate your data directory as appropriately in /etc/elasticsearch/elasticsearch.yml and restart if already running

Logstash

If you wish, you can also install Logstash from the official repos as well The following repo URI is for Logstash version 1.3 which is currently latest

zypper ar -f http://packages.elastic.co/logstash/1.5/centos  Logstash_1.5_repository && zypper --gpg-auto-import-keys ref