美文网首页
logstash 启动缓慢问题-haveged安装

logstash 启动缓慢问题-haveged安装

作者: 皮皮猿的博客 | 来源:发表于2017-06-11 15:06 被阅读0次

    网上有篇logstash启动缓慢的帖子,翻译过来的,基本都是熵过低导致jruby启动缓慢的问题,需要安装haveged,但是却没有详细的文档(人能看懂的)

    测试平台: CentOS-7.3

    1.测试是否需要安装haveged

    [hdfs@cdh-03 ~]$ cat /proc/sys/kernel/random/entropy_avail
    186
    

    如果值比较低(<1000),建议安装 haveged. 否则加密程序会等待系统有足够的熵。

    2.安装haveged

    有两种方式: 1.yum安装; 2.tar.gz包直接安装, 选其一种安装即可

    2.1yum安装

    step1. 加入epel源(实际就是添加yum源配置)

    [root@cdh-03 ~]# yum install epel-release -y
    

    step2. 安装haveged

    [root@cdh-03 ~]# yum install haveged -y
    

    step3. 启动haveged并开机启动,并查看haveged状态(对centos7不熟悉的童鞋需要补补哦_)

    [root@cdh-03 ~]# systemctl start haveged                    #启动
    [root@cdh-03 ~]# systemctl enable haveged                   #开机启动
    [root@cdh-03 ~]# systemctl status haveged                   #查看启动状态
    Created symlink from /etc/systemd/system/multi-user.target.wants/haveged.service to /usr/lib/systemd/system/haveged.service.
    [root@cdh-03 ~]# systemctl list-unit-files | grep haveged    #查看开机启动状态
    haveged.service                             enabled
    

    2.2 二进制包安装(失败)

    前提条件需要安装gcc,否则不能编译(yum -y install gcc)

    step1. 下载地址 http://www.issihosts.com/haveged/downloads.html

    [root@cdh-03 opt]# wget http://www.issihosts.com/haveged/haveged-1.9.1.tar.gz
    

    step2. 解压安装

    [root@cdh-03 opt]# tar -xzvf haveged-1.9.1.tar.gz
    [root@cdh-03 opt]# cd haveged-1.9.1
    [root@cdh-03 haveged-1.9.1]# ./configure
    [root@cdh-03 haveged-1.9.1]# make
    [root@cdh-03 haveged-1.9.1]# make install
    

    问题:不知道怎么启动,用haveged -r 0启动,但是没有作用,熵值没有上来,忘看到的大神解答疑惑...

    3. 查看熵是否到正常值

    [root@cdh-03 ~]# cat /proc/sys/kernel/random/entropy_avail
    2001
    

    值已经>1000,可看应该是安装成功

    参考资料:
    https://www.systutorials.com/docs/linux/man/8-haveged/
    https://blog.bangbang93.com/2017/03/05/解决logstash启动过慢的问题.moe

    相关文章

      网友评论

          本文标题:logstash 启动缓慢问题-haveged安装

          本文链接:https://www.haomeiwen.com/subject/jnuhqxtx.html