Elasticsearch2.2 installation steps for Elk in Linux

Source: Internet
Author: User
Tags curl mkdir redis git clone elastic search

LK Stack
In general:
1, developers are unable to log on to the online server to view log information
2, various systems log a wide range of log data scattered difficult to find
3, the volume of log data is large, the query speed is slow, the data is not enough real time
4, a call involves multiple systems, which makes it difficult to locate data quickly in these systems

Elk Stack = Elastic Search + Logstash + Kibana
20160305165135.png
Here's Redis, loosely coupled, any data written to Redis can be

Elasticsearch configuration:

1, you need to configure the JDK to configure the environment variables first.
[Root@nginx-proxy2 local]# RPM-IVH jdk-8u73-linux-x64.rpm
Preparing ... ########################################### [100%]
1:jdk1.8.0_73 ########################################### [100%]
Unpacking JAR files ...
Tools.jar ...
Plugin.jar ...
Javaws.jar ...
Deploy.jar ...
Rt.jar ...
Jsse.jar ...
Charsets.jar ...
Localedata.jar ...
Jfxrt.jar ...
[Root@nginx-proxy2 local]# cat/etc/profile.d/java.sh
Export Java_home=/usr/java/latest
Export path= $JAVA _home/bin/: $PATH
[Root@nginx-proxy2 local]# source/etc/profile.d/java.sh
[Root@nginx-proxy2 local]# Java-version
Java Version "1.8.0_73"
Java (TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot (TM) 64-bit Server VM (build 25.73-b02, Mixed mode)
[Root@nginx-proxy2 local]#
Elasticsearch Installation:
Installation reference: Https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html#setup-installation

[Root@nginx-proxy2 local]# wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/ Distribution/tar/elasticsearch/2.2.0/elasticsearch-2.2.0.tar.gz
[Root@nginx-proxy2 local]# Tar XF elasticsearch-2.2.0.tar.gz
[Root@nginx-proxy2 local]# ln-sv elasticsearch-2.2.0 elasticsearch
' Elasticsearch '-> ' elasticsearch-2.2.0 '
[Root@nginx-proxy2 local]#
Configuration file

Cluster.name:node1
Node.name: "Linux-node1"
Node.master:true whether this node is elected as master node
node.data:true  Whether this node stores data
Index.number_of_shards:5 index fragment to 5
Index.number_of_replicas:1 fragment defaults to 1
Path.data:/usr/local/ Elasticsearch/data data file location, using commas, you can configure multiple
Path.conf:/usr/local/elasticsearch/conf profile Locations
Path.work:/usr/local/ elasticsearch/work  Temporary Files directory
Path.logs:/usr/local/elasticsearch/conf/logs log file directory
Path.plugins:/usr/ Local/elasticsearch/plugins plug-in directory, most of the JS program
bootstrap.mlockall:true  swap efficiency is lower, lock memory efficiency increase
before 2.0 changes

[Root@nginx-proxy2 config]# grep "^[a-z]" elasticsearch.yml
Cluster.name:node1
Node.name: "Linux-node1"
Node.master:true
Node.data:true
Index.number_of_shards:5
Index.number_of_replicas:1
Path.data:/usr/local/elasticsearch/data
Path.conf:/usr/local/elasticsearch/conf
Path.work:/usr/local/elasticsearch/work
Path.logs:/usr/local/elasticsearch/logs
Path.plugins:/usr/local/elasticsearch/plugins
Bootstrap.mlockall:true
[Root@nginx-proxy2 config]# Mkdir/usr/local/elasticsearch/conf-p
[Root@nginx-proxy2 config]# Mkdir/usr/local/elasticsearch/logs-p
[Root@nginx-proxy2 config]# Mkdir/usr/local/elasticsearch/work-p
[Root@nginx-proxy2 config]# Mkdir/usr/local/elasticsearch/data-p
I have only modified the following:

Cluster.name:my-linuxea
Node.name: "Linuxea"
Curl Test

[Mark@nginx-proxy2 elasticsearch]# su Mark
[Mark@nginx-proxy2 elasticsearch]$ bin/elasticsearch-d
[Root@nginx-proxy2 ~]# Curl 127.0.0.1:9200
{
"Name": "Linuxea",
"Cluster_Name": "My-linuxea",
"Version": {
"Number": "2.2.0",
"Build_hash": "8ff36d139e16f8720f2947ef62c8167a888992fe",
"Build_timestamp": "2016-01-27t13:32:39z",
"Build_snapshot": false,
"Lucene_version": "5.4.1"
},
"Tagline": "Your Know, for Search"
}
[Root@nginx-proxy2 ~]#
Close off

[Root@nginx-proxy2 ~]# JPS
3515 Elasticsearch
3564 Jps
[Root@nginx-proxy2 ~]# Kill 3515
Go to gitlab website Download service startup script:

[Root@nginx-proxy2 ~]# git clone https://github.com/elastic/elasticsearch-servicewrapper.git
initialized Empty Git repository in/root/elasticsearch-servicewrapper/.git/
remote:counting objects:184, done.
Remote:tot Al 184 (Delta 0), reused 0 (Delta 0), pack-reused 184
Receiving objects:100% (184/184), 4.55 MiB | 245 kib/s, done. Resolving deltas:100% (53/53), done.
[root@nginx-proxy2 ~]# mv elasticsearch-servicewrapper/service//usr/local/elasticsearch/bin/
[ Root@nginx-proxy2 ~]#/usr/local/elasticsearch/bin/service/elasticsearch
Usage:/usr/local/elasticsearch/bin/ Service/elasticsearch [Console | start | stop | restart | condrestart | status | install | remove | dump]

Commands:
  console      Launch in the current console.
  start         Start in the background as a daemon process.
  stop         Stop if running as a daemon or in another console.
  restart      Stop if running and then start.
  condrestart  Restart only if already running.
  status       Query the current status.
  install      install to start automatically when system boots.
  remove       Uninstall.
  dump         Request a Java thread dump if running.

[Root@nginx-proxy2 ~]#.
Install it
[root@nginx-proxy2 ~]#/usr/local/elasticsearch/bin/service/elasticsearch Install
detected RHEL or Fedora:
Installing the Elasticsearch daemon ...
[Root@nginx-proxy2 ~]# ls/etc/init.d/elasticsearch
/etc/init.d/elasticsearch
[Root@nginx-proxy2 ~]# Chkconfig--list |grep ELA
elasticsearch   0:off   1:off   2:on    3 :on    4:on    5:on    6:off
[Root@nginx-proxy2 ~]#
is unfortunately not yet supported. Gitlab Clinton Gormley was not updated for 2.2, all of which could not be started.

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.