導讀 | Splunk是探索和搜索數據的最有力工具,從收集和分析應用程序、Web服務器、數據庫和服務器平台的實時可視化海量數據流,分析出IT企業產生的海量數據,安全系統或任何商業應用,給你一個總的見解獲得結果的最佳運營績效和業務。 |
沒有官方的安裝必須條件,但為服務器安裝防火牆和網絡配置之前,我推薦一個合適的域名。該軟件只支持64位服務器架構,在這篇文章中,我指導你如何在CentOS 7服務器安裝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
從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/
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在您服務器防火牆上面開放。
我已經完成Splunk的安裝,Splunk服務在我的服務器中正常運行。現在我需要設置我Splunk Web界面,使用我設置的管理員密碼訪問Splunk web界面。
第一次當您訪問Splunk的界面,你在頁面中使用的是管理員用戶和密碼。一旦登錄,就在下一頁,它會要求更改和確認您的新密碼。
現在,您已經設置新的管理員密碼。一旦您使用新密碼登錄,您將有准備使用的Splunk儀表板。
在主頁上列出了不同的類別,您可以選擇所需的一個開始splunking。
我要加入一個例子為一個簡單的任務,它被添加到 Splunk 系統。只是看到我的快照,以了解我將如何添加它。我的任務是將 /var/log文件夾添加到Splunk系統的監測。
在監視器選項,有下圖所示的四個類別:
文件與目錄:監視文件/文件夾
HTTP事件收集器:監視通過HTTP的數據流
TCP/UDP:監視服務端口
腳本:監控腳本
在服務器上你可以看到我的日志被縮小到一個應用程序。
這只是Splunking一個簡單的例子,您可以將盡可能多的任務添加到這,瀏覽您的服務器數據。我希望這篇文章是豐富的頩對你有用的。感謝您閱讀到這里,請您提出寶貴的建議和意見。現在試着使用Splunk吧!!