环境

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

 

安装 Elasticsearch

elasticsearch运行需要使用普通用户

修改 /etc/security/limits.conf

  1. * soft nofile 600000
  2. * hard nofile 600000
  3. * soft nproc 60000
  4. * hard nproc 60000
  5. jt_app soft memlock unlimited
  6. jt_app hard memlock unlimited

修改/etc/sysctl.conf

  1. net.ipv4.ip_forward = 1
  2. net.ipv4.conf.default.rp_filter = 1
  3. net.ipv4.conf.default.accept_source_route = 0
  4. kernel.sysrq = 0
  5. vm.swappiness = 0
  6. kernel.core_uses_pid = 1
  7. net.ipv4.tcp_syncookies = 1
  8. kernel.msgmnb = 65536
  9. kernel.msgmax = 65536
  10. kernel.shmmax = 68719476736
  11. kernel.shmall = 4294967296
  12. net.core.somaxconn = 16384
  13. vm.max_map_count = 262144

修改配置文件:

 生产环境主要配置:

  1. #grep -v '^#' elasticsearch.yml|grep -v '^$'
  2. cluster.name: prod_es_cluster
  3. node.name: elk-log-srv01
  4. node.master: true
  5. node.data: true
  6. path.data: /opt/es_data/data
  7. path.logs: /opt/elasticsearch/logs
  8. bootstrap.memory_lock: false
  9. network.host: elk-log-srv01
  10. http.port: 9200
  11. transport.tcp.port: 9300
  12. discovery.zen.ping_timeout: 3s
  13. discovery.zen.fd.ping_timeout: 60s
  14. discovery.zen.fd.ping_interval: 10s
  15. discovery.zen.ping.unicast.hosts: ["elk-log-srv01", "elk-log-srv02","elk-log-srv03"]
  16. discovery.zen.minimum_master_nodes: 2
  17. gateway.recover_after_nodes: 3
  18. gateway.expected_nodes: 3
  19. gateway.recover_after_time: 5m
  20. indices.query.bool.max_clause_count: 10240
  21. http.cors.enabled: true
  22. http.cors.allow-origin: "*"
  23. http.cors.allow-credentials: true
  24. search.max_buckets: 1000000

  

 启动:

  1. ./bin/elasticsearch -d

 启动脚本:

  1. [root@elk-log-srv01 elasticsearch]# cat /usr/lib/systemd/system/elasticsearch.service
  2. [Unit]
  3. Description=Elasticsearch
  4. Documentation=http://www.elastic.co
  5. Wants=network-online.target
  6. After=network-online.target
  7.  
  8. [Service]
  9. RuntimeDirectory=elasticsearch
  10. Environment=ES_HOME=/opt/elasticsearch
  11. Environment=ES_PATH_CONF=/opt/elasticsearch/config
  12. Environment=PID_DIR=/opt/elasticsearch
  13. #EnvironmentFile=-/etc/sysconfig/elasticsearch
  14. #Environment=JAVA_HOME=/opt/jdk
  15.  
  16. WorkingDirectory=/opt/elasticsearch
  17.  
  18. User=jt_app
  19. Group=jt_app
  20.  
  21. ExecStart=/opt/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet
  22.  
  23. # StandardOutput is configured to redirect to journalctl since
  24. # some error messages may be logged in standard output before
  25. # elasticsearch logging system is initialized. Elasticsearch
  26. # stores its logs in /var/log/elasticsearch and does not use
  27. # journalctl by default. If you also want to enable journalctl
  28. # logging, you can simply remove the "quiet" option from ExecStart.
  29. StandardOutput=journal
  30. StandardError=inherit
  31.  
  32. # Specifies the maximum file descriptor number that can be opened by this process
  33. LimitNOFILE=65536
  34.  
  35. # Specifies the maximum number of processes
  36. LimitNPROC=4096
  37.  
  38. # Specifies the maximum size of virtual memory
  39. LimitAS=infinity
  40.  
  41. # Specifies the maximum file size
  42. LimitFSIZE=infinity
  43.  
  44. #
  45. LimitMEMLOCK=infinity
  46.  
  47. # Disable timeout logic and wait until process is stopped
  48. TimeoutStopSec=0
  49.  
  50. # SIGTERM signal is used to stop the Java process
  51. KillSignal=SIGTERM
  52.  
  53. # Send the signal only to the JVM rather than its control group
  54. KillMode=process
  55.  
  56. # Java process is never killed
  57. SendSIGKILL=no
  58.  
  59. # When a JVM receives a SIGTERM signal it exits with code 143
  60. SuccessExitStatus=143
  61.  
  62. [Install]
  63. WantedBy=multi-user.target
  64.  
  65. # Built for packages-6.3.2 (packages)
  66. [root@elk-log-srv01 elasticsearch]#

 

安装 Kibana

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

 启动:

  1. nohup ./bin/kibana &

logstash安装

elasticsearch 常用插件安装

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

采用离线安装插件的方法

1、sql插件

  1. ### 项目地址
  2. https://github.com/NLPchina/elasticsearch-sql
  3. 历史版本:
  4. https://github.com/NLPchina/elasticsearch-sql/releases
  5. ### 下载sql插件
  6. 下载
  7. wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip
  8. 安装
  9. ./bin/elasticsearch-plugin install file:///opt/elasticsearch-sql-5.5.1.0.zip
  10.  
  11. 安装web访问
  12. wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip
  13. unzip ./es-sql-site-standalone.zip
  14. cd site-server
  15. npm install express --save
  16. node node-server.js & #后台启动
  17. 默认端口:8080
  18. cd _site
  19. vim controllers.js
  20. 修改链接es地址
  21. url = "http://localhost:9200"

 2 分词器

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

  

elasticsearch5.x安装head插件

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

  

cerebro插件安装

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

 

kibana安装x-pack插件

  1. 先下载x-pack-5.5.1.zip
  2. https://artifacts.elastic.co/downloads/packs
  3. 在线安装
  4. bin/kibana-plugin install x-pack
  5. 离线安装
  6. ./bin/kibana-plugin install file:///opt/x-pack-5.5.1.zip
  7.  
  8. 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. Mysql训练:第二高的薪水(IFNULL,OFFSET,LIMIT)

    编写一个 SQL 查询,获取 Employee 表中第二高的薪水(Salary) . +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 ...

  2. Java流程控制:循环结构

    一.简介 顺序结构的程序语句只能被执行一次,如果您想要同样的操作执行多次,就需要使用循环结构. Java中有三种主要的循环结构: 'while'循环 'do...while'循环 'for'循环 在J ...

  3. su: Authentication failure解决方法

    su命令不能切换root,提示su: Authentication failure,需要sudo passwd root一次之后,下次再su的时候只要输入密码就可以成功登录.

  4. Go的指针

    目录 指针 一.指针的声明 二.指针的默认值(Zero Value) 三.指针的解引用 四.向函数传递指针参数 1.非 数组/切片 指针传参 2.数组/切片 指针传参 五.Go不支持指针运算 指针 指 ...

  5. 痞子衡嵌入式:盘点国内RISC-V内核MCU厂商

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是国内RISC-V内核MCU厂商. 虽然RISC-V风潮已经吹了好几年,但2019年才是其真正进入主流市场的元年,最近国内大量芯片公司崛起 ...

  6. Manjaro安装后简单配置

    一个相见恨晚的 Linux 操作系统 Manjaro 到底有多受欢迎? DistroWatch是一个包含了各种Linux发行版及其他自由/开放源代码的类Unix操作系统. (如OpenSolaris. ...

  7. 微信小程序onReachBottom第二次失效

    当整个页面就是一个view包着一个轮播.一个横向scroll-view和一个纵向scroll-view onReachBottom方法只执行一次 解决方法:

  8. RichTextBox FlowDocument类型操作

      最近研究微信项目,套着web版微信协议做了一个客户端,整体WPF项目MVVM架构及基本代码参考于:http://www.cnblogs.com/ZXdeveloper/archive/2016/1 ...

  9. Python基础学习【day2】

    运算符 运算符有哪些? 加            + 减            - 乘            * 除            / 幂            ** 取余        % ...

  10. android分析之Condition

    Condition的含义是条件变量,其实现依赖于系统,一般都要配合Mutex使用,使用步骤为:给mutex上锁(Lock),调用wait等待"条件"发生,如果没有发生则re-wai ...