Install Logstash 2.2.0 and Elasticsearch 2.2.0 on CentOS

Source: Internet
Author: User
Tags kibana logstash

Install Logstash 2.2.0 and Elasticsearch 2.2.0 on CentOS

This article describes how to install logstash 2.2.0 and elasticsearch 2.2.0. The operating system environment version is CentOS/Linux 2.6.32-504.23.4.el6.x86 _ 64.

JDK installation is required. It is generally available in the operating system. It is only a version issue and will be mentioned later.

Kibana is only a front-end UI written in pure JavaScript. Because recently, the company needs to analyze the logs of all systems before starting ELK, but the personnel and time are limited. The three frameworks are both researched and not realistic.

Use Elasticsearch + Logstash + Kibana to build a centralized Log Analysis Platform

Full record of installation and deployment of ElasticSearch on Linux

Elasticsearch installation and usage tutorial

ElasticSearch configuration file Translation

ElasticSearch cluster creation instance

Build a standalone and server environment for distributed search ElasticSearch

Working Mechanism of ElasticSearch

ElasticSearch details: click here
ElasticSearch: click here

Elasticsearch

Elasticsearch (Elasticsearch) provides ZIP, TAR, DEB, and RPM packages. However, Github provides an Elasticsearch-RTF for the Chinese environment. The RTF is Ready To Fly, which is a Chinese release version. In other words, it helps you get started. This document takes Elasticsearch-RTF as an example. Basically, elasticsearch can be used after decompression.

Suppose you have downloaded elasticsearch-rtf from Github, named elasticsearch-master.zip, and uploaded to your Linux Server/usr/local/elasticsearch directory (if not, use the mkdir command to create one ).
• Decompress the package and rename the folder:


[Root @ bkjia local] # cd/usr/local/elasticsearch

[Root @ bkjia local] # unzip elasticsearch-master.zip

[Root @ bkjia elasticsearch] # ls

Elasticsearch-master elasticsearch-master.zip

[Root @ bkjia local] # mv elasticsearch-master elasticsearch

[Root @ bkjia elasticsearch] # ls

Elasticsearch elasticsearch-master.zip
• Try to run elasticsearch:

Linux environment:


[Root @ bkjia elasticsearch] # pwd

/Usr/local/elasticsearch

[Root @ bkjia elasticsearch] # bin/elasticsearch


In windows, run the corresponding. bat file, that is, elasticsearch. bat.

But an error is reported:


[Root @ bkjia elasticsearch] # bin/elasticsearch

Exception in thread "main" java. lang. runtimeException: Java version: Oracle Cooration 1.7.0 _ 51 [Java HotSpot (TM) 64-Bit Server VM 24.51-b03] suffers from crical bug https://bugs.openjdk.java.net/browse/JDK-8024830 which can cause dataorruption.

Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/referce/current/_installation.html for current recommendations.

If you absolutely cannot upgrade, please add-XX:-UseSuperWord to the JAVA_OPT environment variable.

Upgrading is preferred, this workaround will result in degraded performance.

At org. elasticsearch. bootstrap. JVMCheck. check (JVMCheck. java: 123)

At org. elasticsearch. bootstrap. Bootstrap. init (Bootstrap. java: 283)

At org. elasticsearch. bootstrap. Elasticsearch. main (Elasticsearch. java: 3

Refer to the log for complete error details.

Java runtime exception. JDK of the local version has a bug ...... Upgrade JVM. If it cannot be upgraded, add the-XX:-UseSuperWord option to the JAVA_OPT environment variable.

So let's take a look at the local Java version:


[Root @ bkjia elasticsearch] # java-version

Java version "1.7.0 _ 51"

Java (TM) SE Runtime Environment (build 1.7.0 _ 51-b13)

Java HotSpot (TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

[Root @ bkjia elasticsearch] # echo $ JAVA_HOME

/Usr/java/jdk1.7.0 _ 51

[Root @ bkjia elasticsearch] #
 

The version is 1.7.0 _ 51. I checked it on the official website and said, "Elasticsearch requires at least Java 7. specifically as of this writing, it is recommended that you use the Oracle JDK version 1.8.0 _ 72. java installation varies from platform to platform so we won't go into those details here. oracle's recommended installation documentation can be found on Oracle's website. suffice to say, before you install Elasticsearch, please check your Java versio N first by running (and then install/upgrade accordingly if needed): ", the general idea is that ES requires at least 7, and 1.8.0 _ 72 is recommended.
• Delete the previous version and press a new version. Delete the previous JDK, and then use yum to add a new one:


[Root @ bkjia elasticsearch] # yum list installed | grep java

[Root @ bkjia elasticsearch] # yum list installed | grep jdk

Jdk. x86_64 2000. 7.0 _ 51-fcs installed

[Root @ bkjia elasticsearch] # yum-y remove jdk. x86_64

......

[Root @ bkjia elasticsearch] # yum-y install java-1.8.0-openjdk *

......

Note: java-1.8.0-openjdk * ", followed by an asterisk, that is, install all java related things ~
• After the installation is complete, set the JDK environment variable:


[Root @ bkjia elasticsearch] # export JAVA_HOME =/usr/lib/jvm/java-1.8.0

[Root @ bkjia elasticsearch] # export PATH = $ JAVA_HOME/bin: $ PATH

[Root @ bkjia elasticsearch] # export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

[Root @ bkjia elasticsearch] # java-version

Openjdk version "1.8.0 _ 71"

OpenJDK Runtime Environment (build 1.8.0 _ 71-b15)

OpenJDK 64-Bit Server VM (build 25.71-b15, mixed mode)

[Root @ bkjia elasticsearch] # echo $ JAVA_HOME

/Usr/lib/jvm/java-1.8.0.

[Root @ bkjia elasticsearch] #

In addition, JDK is installed in the/usr/lib/jvm directory of my machine. Check your path by yourself.
• Run again:


[Root @ bkjia elasticsearch] # bin/elasticsearch

Exception in thread "main" java. lang. RuntimeException: don't run elasticsearch as root.

At org. elasticsearch. bootstrap. Bootstrap. initializeNatives (Bootstrap. java: 93)

At org. elasticsearch. bootstrap. Bootstrap. setup (Bootstrap. java: 144)

At org. elasticsearch. bootstrap. Bootstrap. init (Bootstrap. java: 285)

At org. elasticsearch. bootstrap. Elasticsearch. main (Elasticsearch. java: 35)

Refer to the log for complete error details.

[Root @ bkjia elasticsearch] #
• An error is reported. elasticsearch cannot be run by the root user:


[Root @ bkjia elasticsearch] # groupadd es

[Root @ bkjia elasticsearch] # useradd-g es

[Root @ bkjia elasticsearch] # passwd es

Changing password for user es.

New password:

Bad password: it is WAY too short

Bad password: is too simple

Retype new password:

Passwd: all authentication tokens updated successfully.

[Root @ bkjia elasticsearch] #

[Root @ bkjia elasticsearch] # chown-R root.

[Root @ bkjia elasticsearch] # chown-R es.

[Root @ bkjia elasticsearch] # chgrp-R es.

[Root @ bkjia elasticsearch] # ls-l

Total 4

Drwxr-xr-x 7 es 4096 Mar 1 elasticsearch

[Root @ bkjia elasticsearch] #
• Re-open a terminal, log on with the es user, and run elasticsearch:


[Root @ bkjia ~] $ Cd/usr/local/elasticsearch

[Root @ bkjia elasticsearch] $ bin/elasticsearch

[05:11:48, 413] [WARN] [bootstrap] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed

[05:11:48, 750] [INFO] [node] [Googam] version [2.1.1], pid [15042], build [40e2c53/2015-12-15T13: 05: 55Z]

[05:11:48, 750] [INFO] [node] [Googam] initializing...

[05:11:49, 088] [INFO] [plugins] [Googam] loaded [elasticsearch-analysis-ik, elasticsearch-analysis-mmseg, elasticsearch-analysis-stconvert, elasticsearch-analysis-pinyin], sites []

[05:11:49, 121] [INFO] [env] [Googam] using [1] data paths, mounts [[/(/dev/mapper/vg_bkjia-lv_root)], net usable_space [26.1 gb], net total_space [34.8 gb], spins? [Possibly], types [ext4]

[05:11:51, 119] [INFO] [mmseg-analyzer] [Dict Loading] chars loaded time = 42 ms, line = 12638, on file = chars. dic

......
• Access elasticsearch on another terminal:


[Root @ bkjia elasticsearch] # curl-x get http: // localhost: 9200

{

"Name": "Captain Savage ",

"Cluster_name": "elasticsearch ",

"Version ":{

"Number": "2.1.1 ",

"Build_hash": "40e2c53a6b6c2972b3d13846e424e66f4375bd71 ",

"Build_timestamp": "2015-12-15T13: 05: 55Z ",

"Build_snapshot": false,

"Inclue_version": "5.3.1"

},

"Tagline": "You Know, for Search"

}

[Root @ bkjia elasticsearch] #
 

ES has been installed successfully.

However, elasticsearch cannot access elasticsearch by IP address. Therefore, you must modify config/elasticsearch. yml. Find the "network. host" line. In that example, add a line:


Network. host: your id address

You can access it through an IP address or a browser.

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

Related Article

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.