CentOS 7安装Splunk具体步骤

Splunk 是机器数据的引擎。使用 Splunk 可收集、索引和利用所有应用程序、服务器和设备生成的快速移动型计算机数据 。 使用 Splunking 处理计算机数据,可让您在几分钟内解决问题和调查安全事件,下面为大家讲解一下CentOS 7安装Splunk具体步骤。

1.创建一个Splunk用户

Splunk总是建议使用专用用户为此应用程序运行,而不是根用户。我创建了一个用户运行该应用程序,并创建了一个文件夹安装应用程序。

[root@server1 tmp]# groupadd splunk
[root@server1 tmp]# useradd -d /opt/splunk -m -g splunk splunk
[root@server1 tmp]# su - splunk
[splunk@server1 ~]$ id
uid=1001(splunk) gid=1001(splunk) groups=1001(splunk)

Confirm the server architecture

[splunk@server1 ~]$ getconf LONG_BIT
64

2.下载解压Splunk企业版

从Splunk官方网站下载Splunk软件,创建一个账户。 现在解压tar文件,将文件复制到/opt/splunk下已经创建splunk的应用程序文件夹下面。

root@server1 tmp]# tar -xvf splunk-6.4.0-f2c836328108-Linux-x86_64.tgz
[root@server1 tmp]# cp -rp splunk/* /opt/splunk/
[root@server1 tmp]# chown -R splunk: /opt/splunk/

3.安装Splunk

Splunk软件下载之后,您可以用您的Splunk用户登录运行安装脚本。我选择试用许可证,所以它会默认。

root@server1 tmp]# su - splunk
Last login: Fri Apr 29 08:14:12 UTC 2016 on pts/0

[splunk@server1 ~]$ cd bin/
[splunk@server1 bin]$ ./splunk start --accept-license

This appears to be your first time running this version of Splunk.

Copying '/opt/splunk/etc/openldap/ldap.conf.default' to '/opt/splunk/etc/openldap/ldap.conf'.
Generating RSA private key, 1024 bit long modulus
.++++++
..................++++++
e is 65537 (0x10001)
writing RSA key

Generating RSA private key, 1024 bit long modulus
................++++++
..++++++
e is 65537 (0x10001)
writing RSA key

Moving '/opt/splunk/share/splunk/search_mrsparkle/modules.new' to '/opt/splunk/share/splunk/search_mrsparkle/modules'.

Splunk> Australian for grep.

Checking prerequisites...
Checking http port [8000]: open
Checking mgmt port [8089]: open
Checking appserver port [127.0.0.1:8065]: open
Checking kvstore port [8191]: open
Checking configuration... Done.
Creating: /opt/splunk/var/lib/splunk
Creating: /opt/splunk/var/run/splunk
Creating: /opt/splunk/var/run/splunk/appserver/i18n
Creating: /opt/splunk/var/run/splunk/appserver/modules/static/css
Creating: /opt/splunk/var/run/splunk/upload
Creating: /opt/splunk/var/spool/splunk
Creating: /opt/splunk/var/spool/dirmoncache
Creating: /opt/splunk/var/lib/splunk/authDb
Creating: /opt/splunk/var/lib/splunk/hashDb
Checking critical directories... Done
Checking indexes...
Validated: _audit _internal _introspection _thefishbucket history main summary
Done
New certs have been generated in '/opt/splunk/etc/auth'.
Checking filesystem compatibility... Done
Checking conf files for problems...
Done
Checking default conf files for edits...
Validating installed files against hashes from '/opt/splunk/splunk-6.4.0-f2c836328108-linux-2.6-x86_64-manifest'
All installed files intact.
Done
All preliminary checks passed.

Starting splunk server daemon (splunkd)...
Generating a 1024 bit RSA private key
.....................++++++
...........................++++++
writing new private key to 'privKeySecure.pem'
-----
Signature ok
subject=/CN=server1.centos7-test.com/O=SplunkUser
Getting CA Private Key
writing RSA key
Done
[ OK ]

Waiting for web server at http://127.0.0.1:8000 to be available.... Done
If you get stuck, we're here to help. Look for answers here: http://docs.splunk.com The Splunk web interface is at http://server1.centos7-test.com:8000 

现在您可以访问您的Splunk Web界面http://IP:8000 /或http://hostname:8000,您需要确保这个端口8000在您服务器防火墙上面开放。

4.配置Splunk Web界面

我已经完成Splunk的安装,Splunk服务在我的服务器中正常运行。现在我需要设置我Splunk Web界面,使用我设置的管理员密码访问Splunk web界面。 第一次当您访问Splunk的界面,你在页面中使用的是管理员用户和密码。一旦登录,就在下一页,它会要求更改和确认您的新密码。 现在,您已经设置新的管理员密码。一旦您使用新密码登录,您将有准备使用的Splunk仪表板。 在主页上列出了不同的类别,您可以选择所需的一个开始splunking。

5.添加任务

我要加入一个例子为一个简单的任务,它被添加到 Splunk 系统。只是看到我的快照,以了解我将如何添加它。我的任务是将 /var/log文件夹添加到Splunk系统的监测。

1.打开Splunk Web界面,并在设置选项卡上单击 > > 选择添加数据选项

CentOS 7安装SplunkCentOS 7安装Splunk

2.在这里我们的任务是监视文件夹,所以我们继续监视。

在监视器选项,有下图所示的四个类别:

文件与目录:监视文件/文件夹

HTTP事件收集器:监视通过HTTP的数据流

TCP/UDP:监视服务端口

脚本:监控脚本

3.根据我们的目的,我选择文件及目录选项。

CentOS 7安装SplunkCentOS 7安装Splunk

4.从需要监视的服务器选择确切的文件夹路径。

5.现在你可以开始搜索和监测作为所需的日志文件。

在服务器上你可以看到我的日志被缩小到一个应用程序。 这只是Splunking一个简单的例子,您可以将尽可能多的任务添加到这,浏览您的服务器数据。我希望这篇文章是丰富的頩对你有用的。感谢您阅读到这里,请您提出宝贵的建议和意见。现在试着使用Splunk吧!!

原创文章,作者:晴川运维,如若转载,请注明出处:https://baike.qcidc.com/15728.html

(0)
晴川运维晴川运维
上一篇 2025年10月19日
下一篇 2025年10月19日

相关推荐

  • 在CentOS 7上安装Jenkins

    在centos 7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://…

    CentOS 2025年6月11日
  • CentOS 6.6上安装与配置Solr 6.5

    这篇文章主要是介绍在CentOS 6.6上Solr 6.5的安装与配置。 一、安装准备及各软件使用版本说明: 1、JDK8,版本jdk1.8.0_121下载地址:jdk-8u121…

    CentOS 2025年10月26日
  • CentOS 7下yum成功安装 MySQL 5.7

    第一部分:centos 7安装mysql 5.7 1.下载yum库 shell > wget http://dev.mysql.com/get/mysql57-communi…

    CentOS 2025年6月17日
  • 配置CentOS系统下的GAMIT自动发邮件

    前言 在使用GAMIT/GLOBK软件进行自动批处理时,是可以实现让软件处理完成之后发送电子邮件功能的。但是很多朋友都表示没有收到过邮件。那是因为GAMIT是调用mailx程序来自…

    CentOS 2025年10月21日
  • CentOS 7 中使用NTP进行时间同步

    1. NTP时钟同步方式说明NTP在linux下有两种时钟同步方式,分别为直接同步和平滑同步: 直接同步 使用ntpdate命令进行同步,直接进行时间变更。如果服务器上存在一个12…

    CentOS 2025年10月22日
  • RHEL 8发布后,用户等待CentOS 8的推出

    本周发布的Red Hat Enterprise Linux 8 (RHEL 8)让所有人都在等待CentOS 8的重新构建。CentOS 8的发布将需要对安装程序、软件包、打包和构…

    CentOS 2025年10月8日
  • CentOS 6.5全新安装Firefox45.2浏览器脚本

    在centos 6.5x86_64系统中自带的是firefox 17版,版本太低,由于腾讯云实验室需要在firefox浏览器45版或45版以上的版本来支持,否则无法进入腾讯云实验室…

    CentOS 2025年6月22日
  • CentOS 8清空DNS缓存的方法

    DNS缓存不仅仅产生于操作系统,在浏览器和应用程序以及IPS网络运营商都会对DNS进行缓存,下面详细讲解一下清空DNS缓存的方法。 nscd清理缓存命令如下: [root@loca…

    CentOS 2025年6月8日
  • CentOS 7.4搭建DNS服务器实现主从同步

    相关概念:正向解析:将域名解析成IP地址反向解析:将IP地址解析成域名 第一步:准备工作systemctl stop firewalld //关闭防火墙setenforce 0 /…

    CentOS 2025年6月8日
  • Centos7中安装轻量级运维利器:pssh

    pssh 提供了并行版本的 OpenSSH 工具,特别适合用来控制有大量机器需要连接的情况,包括并行版本的 ssh、scp、rsync 和 kill 命令。 下载pssh安装包 […

    CentOS 2025年6月23日

发表回复

登录后才能评论