<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)? in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346343#M12897</link>
    <description>&lt;P&gt;Thanks self. Now how would I remove it automatically?&lt;/P&gt;</description>
    <pubDate>Mon, 12 Mar 2018 18:48:20 GMT</pubDate>
    <dc:creator>sd306</dc:creator>
    <dc:date>2018-03-12T18:48:20Z</dc:date>
    <item>
      <title>How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346341#M12895</link>
      <description>&lt;P&gt;I am looking for an automated way to install Splunk 7.0.2 on CentOS 7 64 bit using the best practices for setting Transparent Huge Pages (THP), ulimit, permissions, ports, and inputs settings. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 17:50:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346341#M12895</guid>
      <dc:creator>sd306</dc:creator>
      <dc:date>2018-03-12T17:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346342#M12896</link>
      <description>&lt;P&gt;Hello self, &lt;/P&gt;

&lt;P&gt;You can use the following automated shell script for CentOS 7 64 bit ONLY &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Features:&lt;/STRONG&gt;&lt;BR /&gt;
-Installs wget and downloads the Splunk installer from the web.&lt;BR /&gt;
-Disables THP. &lt;BR /&gt;
-Sets ulimit.&lt;BR /&gt;
-Installs Splunk 7.0.2 on CentOS 7 64 bit ONLY, automatically. &lt;BR /&gt;
-Creates Linux user "splunk" and sets password. &lt;BR /&gt;
-Sets proper permissions.&lt;BR /&gt;
-Opens firewall ports.&lt;BR /&gt;
-Creates SplunkTCP input over 9997.&lt;BR /&gt;
-Create UDP input over 10514. &lt;BR /&gt;
-Adjusts splunk-launch.conf to mitigate privilege escalation attack.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;How-to:&lt;/STRONG&gt;&lt;BR /&gt;
1. Login as root&lt;BR /&gt;
2. Create a file called "installSplunk702.sh" in your home directory using the command: vi installSplunk702.sh&lt;BR /&gt;
3. Press "i" when you are in "vi" to insert text. Copy and paste the below script into the window:&lt;/P&gt;

&lt;HR /&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash
echo
echo '##############################################'
echo '#                                            #'
echo '# Welcome to the Splunk 7.0.2 auto-installer #'
echo '# for CentOS 7 x64.                          #'
echo '# Last updated 03/12/2018.                   #'
echo '# Enter the "splunk" linux user account      #'
echo '# password and press enter to let the magic  #'
echo '# happen. Note: You will change the Splunk   #'
echo '# Web admin password upon first login.       #'
echo '#                                            #'
echo '##############################################'
echo
read splunkPassword
echo
echo "never" &amp;gt; /sys/kernel/mm/transparent_hugepage/enabled
echo "never" &amp;gt; /sys/kernel/mm/transparent_hugepage/defrag
echo "[Unit]" &amp;gt; /etc/systemd/system/disable-thp.service
echo "Description=Disable Transparent Huge Pages" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo "" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo "[Service]" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo "Type=simple" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo 'ExecStart=/bin/sh -c "echo never &amp;gt; /sys/kernel/mm/transparent_hugepage/enabled &amp;amp;&amp;amp; echo never &amp;gt; /sys/kernel/mm/transparent_hugepage/defrag"' &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo "Type=simple" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo "" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo "[Install]" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
echo "WantedBy=multi-user.target" &amp;gt;&amp;gt; /etc/systemd/system/disable-thp.service
systemctl daemon-reload
systemctl start disable-thp
systemctl enable disable-thp
echo
echo "Transparent Huge Pages (THP) Disabled."
echo
ulimit -n 64000
ulimit -u 20480
echo "DefaultLimitFSIZE=-1" &amp;gt;&amp;gt; /etc/systemd/system.conf
echo "DefaultLimitNOFILE=64000" &amp;gt;&amp;gt; /etc/systemd/system.conf
echo "DefaultLimitNPROC=20480" &amp;gt;&amp;gt; /etc/systemd/system.conf
echo
echo "ulimit Increased."
echo
yum install wget -y
cd /tmp
wget -O splunk-7.0.2-03bbabbd5c0f-Linux-x86_64.tgz 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&amp;amp;platform=linux&amp;amp;version=7.0.2&amp;amp;product=splunk&amp;amp;filename=splunk-7.0.2-03bbabbd5c0f-Linux-x86_64.tgz&amp;amp;wget=true'
echo
echo "Splunk Downloaded."
echo
tar -xzvf /tmp/splunk-7.0.2-03bbabbd5c0f-Linux-x86_64.tgz -C /opt
rm -f /tmp/splunk-7.0.2-03bbabbd5c0f-Linux-x86_64.tgz
useradd splunk
echo splunk:$splunkPassword &amp;gt; /tmp/pwdfile
cat /tmp/pwdfile | chpasswd
rm -f /tmp/pwdfile
echo
echo "Splunk installed and splunk linux user created."
echo
echo "[settings]" &amp;gt; /opt/splunk/etc/system/local/web.conf
echo "enableSplunkWebSSL = true" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/web.conf
echo
echo "HTTPS enabled for Splunk Web using self-signed certificate."
echo
chown -R splunk:splunk /opt/splunk
afz=`firewall-cmd --get-active-zone | head -1`
firewall-cmd --zone=$afz --add-port=8000/tcp --permanent
firewall-cmd --zone=$afz --add-port=8065/tcp --permanent
firewall-cmd --zone=$afz --add-port=8089/tcp --permanent
firewall-cmd --zone=$afz --add-port=8191/tcp --permanent
firewall-cmd --zone=$afz --add-port=9997/tcp --permanent
firewall-cmd --zone=$afz --add-port=8080/tcp --permanent
firewall-cmd --zone=$afz --add-port=10514/udp --permanent
firewall-cmd --reload
echo
echo "Firewall ports used by Splunk opened."
echo "[splunktcp]" &amp;gt; /opt/splunk/etc/system/local/inputs.conf
echo "[splunktcp://9997]" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/inputs.conf
echo "index = main" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/inputs.conf
echo "disabled = 0" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/inputs.conf
echo "" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/inputs.conf
echo "[udp://10514]" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/inputs.conf
echo "index = main" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/inputs.conf
echo "disabled = 0" &amp;gt;&amp;gt; /opt/splunk/etc/system/local/inputs.conf
chown splunk:splunk /opt/splunk/etc/system/local/inputs.conf
echo
echo "Enabled Splunk TCP input over 9997 and UDP traffic input over 10514."
echo
runuser -l splunk -c '/opt/splunk/bin/splunk start --accept-license'
/opt/splunk/bin/splunk enable boot-start -user splunk
runuser -l splunk -c '/opt/splunk/bin/splunk stop'
chown root:splunk /opt/splunk/etc/splunk-launch.conf
chmod 644 /opt/splunk/etc/splunk-launch.conf
echo
echo "Splunk test start and stop complete. Enabled Splunk to start at boot. Also, adjusted splunk-launch.conf to mitigate privilege escalation attack."
echo
runuser -l splunk -c '/opt/splunk/bin/splunk start'
if [[ -f /opt/splunk/bin/splunk ]]
        then
                echo Splunk Enterprise
                cat /opt/splunk/etc/splunk.version | head -1
                echo "has been installed, configured, and started!"
                echo "Visit the Splunk server using &lt;A href="https://hostNameORip:8000" target="test_blank"&gt;https://hostNameORip:8000&lt;/A&gt; as mentioned above."
                echo
                echo
                echo "                        HAPPY SPLUNKING!!!"
                echo
                echo
                echo
        else
                echo Splunk Enterprise has FAILED install!
fi
#End of File
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Continued from above:&lt;BR /&gt;
4. Press "esc" key once. &lt;BR /&gt;
5. Hold "Shift" and press "z" twice to save. &lt;BR /&gt;
6. Run the following command to make the script executable: chmod 700 installSplunk702.sh&lt;BR /&gt;
7. Then run the script using: ./installSplunk702.sh&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Suggestions/Questions?&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 18:11:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346342#M12896</guid>
      <dc:creator>sd306</dc:creator>
      <dc:date>2018-03-12T18:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346343#M12897</link>
      <description>&lt;P&gt;Thanks self. Now how would I remove it automatically?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 18:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346343#M12897</guid>
      <dc:creator>sd306</dc:creator>
      <dc:date>2018-03-12T18:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346344#M12898</link>
      <description>&lt;P&gt;&lt;STRONG&gt;How-to:&lt;/STRONG&gt;&lt;BR /&gt;
1. Login as root&lt;BR /&gt;
2. Create a file called "removeSplunk702.sh" in your home directory using the command: vi removeSplunk702.sh&lt;BR /&gt;
3. Press "i" when you are in "vi" to insert text. Copy and paste the below script into the window:&lt;/P&gt;

&lt;HR /&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash
echo
echo '##############################################'
echo '#                                            #'
echo '# Welcome to the Splunk 7.0.2 auto-          #'
echo '# uninstaller for CentOS 7 x64.              #'
echo '# This should ONLY be used to remove Splunk  #'
echo '# 7.0.2 that was installed with the auto-    #'
echo '# installer.                                 #'
echo '# Last updated 03/12/2018.                   #'
echo '# Press enter TWICE to remove Splunk 7.0.2.  #'
echo '#                                            #'
echo '##############################################'
echo
read -p ""
read -p ""
if [[ ! -f /opt/splunk/bin/splunk ]] ; then
    echo Splunk is not installed, removal aborted.
    exit 1
fi
/opt/splunk/bin/splunk stop --accept-license
echo
echo Splunk stopped.
echo
/opt/splunk/bin/splunk disable boot-start
echo
echo Splunk boot-start disabled.
echo
runuser -l splunk -c 'ulimit -u 4096'
userdel -rf splunk
echo
echo Removed splunk linux user.
echo
rm -rf /opt/splunk
echo
echo Removed Splunk folders.
echo
systemctl stop disable-thp
systemctl disable disable-thp
rm -rf /etc/systemd/system/disable-thp.service
systemctl daemon-reload
echo "always" &amp;gt; /sys/kernel/mm/transparent_hugepage/enabled
echo "always" &amp;gt; /sys/kernel/mm/transparent_hugepage/defrag
echo
echo "Enabled Transparent Huges Pages (THP)."
echo
ulimit -n 1024
sed -i '/DefaultLimitFSIZE=-1/d' /etc/systemd/system.conf
sed -i '/DefaultLimitNOFILE=65535/d' /etc/systemd/system.conf
sed -i '/DefaultLimitNPROC=20480/d' /etc/systemd/system.conf
echo
echo Set ulimit settings to default.
echo
afz=`firewall-cmd --get-active-zone | head -1`
firewall-cmd --zone=$afz --remove-port=8000/tcp --permanent
firewall-cmd --zone=$afz --remove-port=8089/tcp --permanent
firewall-cmd --zone=$afz --remove-port=8191/tcp --permanent
firewall-cmd --zone=$afz --remove-port=9997/tcp --permanent
firewall-cmd --zone=$afz --remove-port=8080/tcp --permanent
firewall-cmd --zone=$afz --remove-port=10514/udp --permanent
firewall-cmd --reload
echo
echo "Firewall ports used by Splunk closed."
echo
if [[ ! -f /opt/splunk/bin/splunk ]]
    then
        echo Splunk Enterprise has been removed successfully.
        echo
    else
        echo Splunk Enterprise removal has FAILED!
        echo
fi
#End of File
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Continued from above:&lt;BR /&gt;
4. Press "esc" key once. &lt;BR /&gt;
5. Hold "Shift" and press "z" twice to save. &lt;BR /&gt;
6. Run the following command to make the script executable: chmod 700 removeSplunk702.sh&lt;BR /&gt;
7. Then run the script using: ./removeSplunk702.sh&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Suggestions/Questions?&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 19:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346344#M12898</guid>
      <dc:creator>sd306</dc:creator>
      <dc:date>2018-03-12T19:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346345#M12899</link>
      <description>&lt;P&gt;Hi @sd306,  This is very helpful for me. I love the way you wrote both the scripts (easily readable). &lt;BR /&gt;
What are the changes needed for RHEL 7-64?&lt;/P&gt;

&lt;P&gt;Thank you for the great work.&lt;BR /&gt;
Sandeep&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 16:35:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346345#M12899</guid>
      <dc:creator>sandeeprachuri</dc:creator>
      <dc:date>2018-07-09T16:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346346#M12900</link>
      <description>&lt;P&gt;Sandeeprachuri,&lt;/P&gt;

&lt;P&gt;You're welcome! I actually am working on some other simple scripts to create index clusters, etc. &lt;/P&gt;

&lt;P&gt;While I don't have a RHEL 7 system to test, I don't believe any change is needed. THP used to be located in different areas on CentOS and RHEL 6, but now I believe they are the same on CentOS and RHEL 7.&lt;/P&gt;

&lt;P&gt;Please test this on test RHEL 7 64 server and report back!&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
SD306&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 17:09:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346346#M12900</guid>
      <dc:creator>sd306</dc:creator>
      <dc:date>2018-07-09T17:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346347#M12901</link>
      <description>&lt;P&gt;Thanks you so much! Even not for automative install, but great simpiest guide for strong secure installation!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 13:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346347#M12901</guid>
      <dc:creator>stanislavmerzly</dc:creator>
      <dc:date>2019-02-27T13:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346348#M12902</link>
      <description>&lt;P&gt;You're welcome! I also created one for signing certs with your own CA, but may not post that until later. &lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 15:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346348#M12902</guid>
      <dc:creator>sd306</dc:creator>
      <dc:date>2019-02-27T15:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346349#M12903</link>
      <description>&lt;P&gt;Hello sd306 ,&lt;/P&gt;

&lt;P&gt;Could you please post here the changes required with the script for Amazon Linux AIM 64 , It would be great if you suggest the modifications required.&lt;/P&gt;

&lt;P&gt;Thanks &lt;BR /&gt;
guru865&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 16:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/346349#M12903</guid>
      <dc:creator>guru865</dc:creator>
      <dc:date>2019-05-20T16:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script install Splunk 7.0.2 on CentOS 7 64 bit (THP, ulimit, permissions, ports, and inputs settings)?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/693411#M28368</link>
      <description>&lt;P&gt;Hello Splunkers!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can now easily install&amp;nbsp;Splunk Enterprise&amp;nbsp;and the&amp;nbsp;Universal Forwarder&amp;nbsp;using this handy script. It supports all available versions and can be installed on any Linux distribution. For detailed installation steps, please visit :&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/PraxisForge/Install_Splunk" target="_blank"&gt;https://github.com/PraxisForge/Install_Splunk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;U&gt;#Upgrade universal forwarder version (nix)&lt;/U&gt;&amp;nbsp;&lt;U&gt;#Splunk Enterprise(nix)&lt;/U&gt; &lt;U&gt;#Universal Forwarder(nix)&lt;/U&gt; &lt;U&gt;#Upgrade Splunk Enterprise version(nix)&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 01:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-do-I-script-install-Splunk-7-0-2-on-CentOS-7-64-bit-THP/m-p/693411#M28368</guid>
      <dc:creator>Pranav_Support</dc:creator>
      <dc:date>2024-07-16T01:25:42Z</dc:date>
    </item>
  </channel>
</rss>

