歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> CentOS 7安裝Splunk

CentOS 7安裝Splunk

日期:2017/3/3 11:53:09   编辑:Linux技術
導讀
Splunk是探索和搜索數據的最有力工具,從收集和分析應用程序、Web服務器、數據庫和服務器平台的實時可視化海量數據流,分析出IT企業產生的海量數據,安全系統或任何商業應用,給你一個總的見解獲得結果的最佳運營績效和業務。沒有官方的安裝必須條件,但為服務器安裝防火牆和網絡配置之前,我推薦一個合適的域名。該軟件只支持64位服務器架構,在這篇文章中,我指導你如何在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 athttp://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' target='_blank'>http://server1.centos7-test.com:8000[/code] 現在您可以訪問您的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界面,並在設置選項卡上單擊 > > 選擇添加數據選項

2.在這裡我們的任務是監視文件夾,所以我們繼續監視。

在監視器選項,有下圖所示的四個類別:
文件與目錄:監視文件/文件夾
HTTP事件收集器:監視通過HTTP的數據流
TCP/UDP:監視服務端口
腳本:監控腳本
3.根據我們的目的,我選擇文件及目錄選項。

4.從需要監視的服務器選擇確切的文件夾路徑。



5.現在你可以開始搜索和監測作為所需的日志文件。


在服務器上你可以看到我的日志被縮小到一個應用程序。

這只是Splunking一個簡單的例子,您可以將盡可能多的任務添加到這,浏覽您的服務器數據。我希望這篇文章是豐富的頩對你有用的。感謝您閱讀到這裡,請您提出寶貴的建議和意見。現在試著使用Splunk吧!!
本文轉載自:http://www.linuxprobe.com/centos7-install-splunk.html
免費提供最新Linux技術教程書籍,為開源技術愛好者努力做得更多更好:http://www.linuxprobe.com/
Copyright © Linux教程網 All Rights Reserved