环境

CentOS 7.3
root 用户
JDK 版本:1.8(最低要求),主推:JDK 1.8.0_121 以上
关闭 firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动 关闭selinux

 

安装 Elasticsearch

elasticsearch运行需要使用普通用户

修改 /etc/security/limits.conf

*    soft              nofile     600000
* hard nofile 600000
* soft nproc 60000
* hard nproc 60000
jt_app soft memlock unlimited
jt_app hard memlock unlimited

修改/etc/sysctl.conf

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
vm.swappiness = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.core.somaxconn = 16384
vm.max_map_count = 262144

修改配置文件:

 生产环境主要配置:

#grep -v '^#' elasticsearch.yml|grep -v '^$'
cluster.name: prod_es_cluster
node.name: elk-log-srv01
node.master: true
node.data: true
path.data: /opt/es_data/data
path.logs: /opt/elasticsearch/logs
bootstrap.memory_lock: false
network.host: elk-log-srv01
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping_timeout: 3s
discovery.zen.fd.ping_timeout: 60s
discovery.zen.fd.ping_interval: 10s
discovery.zen.ping.unicast.hosts: ["elk-log-srv01", "elk-log-srv02","elk-log-srv03"]
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 3
gateway.expected_nodes: 3
gateway.recover_after_time: 5m
indices.query.bool.max_clause_count: 10240
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-credentials: true
search.max_buckets: 1000000

  

 启动:

./bin/elasticsearch -d

 启动脚本:

[root@elk-log-srv01 elasticsearch]# cat /usr/lib/systemd/system/elasticsearch.service
[Unit]
Description=Elasticsearch
Documentation=http://www.elastic.co
Wants=network-online.target
After=network-online.target [Service]
RuntimeDirectory=elasticsearch
Environment=ES_HOME=/opt/elasticsearch
Environment=ES_PATH_CONF=/opt/elasticsearch/config
Environment=PID_DIR=/opt/elasticsearch
#EnvironmentFile=-/etc/sysconfig/elasticsearch
#Environment=JAVA_HOME=/opt/jdk WorkingDirectory=/opt/elasticsearch User=jt_app
Group=jt_app ExecStart=/opt/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet # StandardOutput is configured to redirect to journalctl since
# some error messages may be logged in standard output before
# elasticsearch logging system is initialized. Elasticsearch
# stores its logs in /var/log/elasticsearch and does not use
# journalctl by default. If you also want to enable journalctl
# logging, you can simply remove the "quiet" option from ExecStart.
StandardOutput=journal
StandardError=inherit # Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536 # Specifies the maximum number of processes
LimitNPROC=4096 # Specifies the maximum size of virtual memory
LimitAS=infinity # Specifies the maximum file size
LimitFSIZE=infinity #
LimitMEMLOCK=infinity # Disable timeout logic and wait until process is stopped
TimeoutStopSec=0 # SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM # Send the signal only to the JVM rather than its control group
KillMode=process # Java process is never killed
SendSIGKILL=no # When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143 [Install]
WantedBy=multi-user.target # Built for packages-6.3.2 (packages)
[root@elk-log-srv01 elasticsearch]#

 

安装 Kibana

选择一台节点安装即可
进入安装目录修改配置文件:
config/kibana.yml server.port: 5601 #端口
server.host: "elk-log-srv01" #访问ip地址
elasticsearch.url: "http://elk-log-srv01:9200" #连接elastic
kibana.index: ".kibana" #在elastic中添加.kibana索引
pid.file: /opt/kibana/kibana.pid
logging.dest: /opt/kibana/kibana.log

 启动:

nohup ./bin/kibana &

logstash安装

elasticsearch 常用插件安装

只是版本不一样,方法是一样的,替换成自己的版本即可

采用离线安装插件的方法

1、sql插件

### 项目地址
https://github.com/NLPchina/elasticsearch-sql
历史版本:
https://github.com/NLPchina/elasticsearch-sql/releases
### 下载sql插件
下载
wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip
安装
./bin/elasticsearch-plugin install file:///opt/elasticsearch-sql-5.5.1.0.zip 安装web访问
wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip
unzip ./es-sql-site-standalone.zip
cd site-server
npm install express --save
node node-server.js & #后台启动
默认端口:8080
cd _site
vim controllers.js
修改链接es地址
url = "http://localhost:9200"

 2 分词器

项目地址:
https://github.com/medcl/elasticsearch-analysis-ik/
下载地址:
wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.5.1/elasticsearch-analysis-ik-5.5.1.zip
安装插件
./bin/elasticsearch-plugin install file:///opt/elasticsearch-analysis-ik-5.5.1.zip

  

elasticsearch5.x安装head插件

5.0以上版本中不支持直接安装head插件,需要启动一个服务。
由于head插件本质上还是一个nodejs的工程,因此需要安装node,使用npm来安装依赖的包。(npm可以理解为maven)
#安装git
yum -y install git
#下载源码
git clone git://github.com/mobz/elasticsearch-head.git
安装 nodejs,修改环境变量
node -v
2、安装npm 3、使用npm安装grunt
由于 npm 是国外的源,下载速度比较慢,推荐使用国内淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org 下面开始修改 head 插件的配置 地址:
https://github.com/mobz/elasticsearch-head

  

cerebro插件安装

以单独进程启动
下载
wget https://github.com/lmenezes/cerebro/releases/download/v0.6.6/cerebro-0.6.6.zip
解压
unzip cerebro-0.6.6.zip
启动:
bin/cerebro -Dhttp.port=1234 -Dhttp.address=0.0.0.0 &
------------------------------------------------
其他配置
-Dconfig.file=/some/other/dir/alternate.conf ##项目地址
https://github.com/lmenezes/cerebro

 

kibana安装x-pack插件

先下载x-pack-5.5.1.zip
https://artifacts.elastic.co/downloads/packs
在线安装
bin/kibana-plugin install x-pack
离线安装
./bin/kibana-plugin install file:///opt/x-pack-5.5.1.zip elasticsearch安装此插件一样

  

ELK安装和配置及常用插件安装的更多相关文章

  1. Sublime Text3安装、配置及常用插件(陆续补全中~)

    一.安装Sublime Text3 网址:http://www.sublimetext.com/3 注册码:(sublime Text3汉化和激活注册码) ----- BEGIN LICENSE -- ...

  2. 基于Hadoop集群搭建Hive安装与配置(yum插件安装MySQL)---linux系统《小白篇》

    用到的安装包有: apache-hive-1.2.1-bin.tar.gz mysql-connector-java-5.1.49.tar.gz 百度网盘链接: 链接:https://pan.baid ...

  3. 2018超详细sublime text3+python3.x安装配置教程(附常用插件安装教程)

    导读 本文是关于2018年7月最新版sublime text3+pythin3.x下载及安装配置教程,sublime text3版本为3176,python版本为3.7,安装环境是基于windows1 ...

  4. Sublime text3 常用插件 安装

    1 安装插件前的准备工作 首先确保你的Sublime Text3编辑器为官方版(非破解版),建议下载官网的便携版本(好处多多). 然后安装插件管理工具(Package Control) 1.1 打开S ...

  5. Fedora 28 系统基础配置以及常用软件安装方式

    实验说明: 很多人说Linux很难用,很难上手,其实不然,倘若不玩游戏,其实很多发行版Linux都可以成为主力系统,就比如本章要讲的 Fedora 28.本章会从镜像来源.系统安装.基础配置和常用软件 ...

  6. Sublime text 3搭建Python开发环境及常用插件安装 转载

    Sublime text 3搭建Python开发环境及常用插件安装 一.环境准备 1.官方网站地址 2.Windows 10 3.Sublime Text 3 + 官网购买license(Just a ...

  7. 持续集成-Jenkins常用插件安装

    1. 更新站点修改 由于之前说过,安装Jenkins后首次访问时由于其他原因[具体未知]会产生离线问题.网上找了个遍还是不能解决,所以只能跳过常用插件安装这步.进入Jenkins后再安装这些插件. 在 ...

  8. Sublime Text 3常用插件安装

    Sublime Text 3常用插件安装 PS:sublime是笔者用过的最好用的编辑器,也是最轻量级,功能最强大的编辑器.好东西应该被分享! 1.直接安装 --下载安装包解压缩到Packages目录 ...

  9. ElasticSearch之常用插件安装命令

    #head监控安装,推荐 bin/plugin -install mobz/elasticsearch-head #bigdesk集群状态,推荐 bin/plugin -install lukas-v ...

随机推荐

  1. ffmpeg番外篇:听说这款水印曾经在某音很火?办它!

    今天在瞎逛时,偶然看到一个CSDN上的哥们说,他们曾经被一个水印难住了,仔细看了下,感觉可以用一行命令实现. 需求如下:视频加gif水印,gif循环,同时n秒后水印切换位置继续循环 这哥们遇到了两个问 ...

  2. 【翻译】Python PEP8编码规范(中文版)

    原文链接:http://legacy.python.org/dev/peps/pep-0008/ item detail PEP 8 Title Style Guide for Python Code ...

  3. apiAutoTest:支持自定义函数,用例中可调用

    0. 前言 apiAutoTest从去年8月以来开源至今,也更新了不少内容,一起来看看吧 第一个版本 - 2020/08/08 增加实际响应存储数据的方法,并在字典可以处理依赖见tools/svae_ ...

  4. 2021-2-28:调用 System.gc() 后究竟发生了什么?

    首先,根据 DisableExplicitGC 这个 JVM 启动参数的状态,确定是否会 GC,如果需要 GC,不同 GC 会有不同的处理. 1. G1 GC 的处理 如果是 System.gc() ...

  5. Python3.x 基础练习题100例(01-10)

    练习01: 题目: 有四个数字:1.2.3.4,能组成多少个互不相同且无重复数字的三位数?各是多少? 分析: 可填在百位.十位.个位的数字都是1.2.3.4.组成所有的排列后再去 掉不满足条件的排列. ...

  6. 一文了解python的 @property

    参考自: https://www.programiz.com/python-programming/property Python为我们提供了一个内置装饰器@property,此方法使得getter和 ...

  7. Codeforces (ccpc-wannafly camp day2) L. Por Costel and the Semipalindromes

    题目链接:http://codeforces.com/gym/100923/problem/L 分析:题目要求序列首尾相同,在此基础上的字典序第k个:因为只存在a,b所以我们把它等效成0和1的话,字典 ...

  8. 200-Java语言基础-Java编程入门-006 | Java数组定义及使用(引用数据类型)

    一.数组概述和定义格式说明 为什么要有数组(容器): 为了存储同种数据类型的多个值 数组概念: 数组是存储同一种数据类型多个元素的集合.也可以看成是一个容器. 数组既可以存储基本数据类型,也可以存储引 ...

  9. Qt update刷新之源码分析(三)

    大家好,我是IT文艺男,来自一线大厂的一线程序员 上次视频给大家从源码层面剖析了Qt刷新事件(QEvent::UpdateRequest)的处理流程,这次视频主要从源码层面剖析对刷新事件的进一步处理, ...

  10. P1012 拼数(JAVA语言)

    //早起刷题傻一天 题目描述 设有nn个正整数(n≤20)(n≤20),将它们联接成一排,组成一个最大的多位整数. 例如:n=3n=3时,33个整数1313,312312,343343联接成的最大整数 ...