<commit_before>
#Modify Sudoers file to not require tty for shell script execution on CentOS
# sudo sed -i '/Defaults[[:space:]]\+requiretty/s/^/#/' /etc/sudoers

# Enable write access to the mongodb.repo and configure it for installation

#sudo chmod 777 /etc/yum.repos.d/mongodb.repo
touch /etc/yum.repos.d/mongodb-enterprise.repo 
echo "[mongodb-org-3.0]" >> /etc/yum.repos.d/mongodb-enterprise.repo 
echo "name=MongoDB Repository" >> /etc/yum.repos.d/mongodb-enterprise.repo 
echo "baseurl=https://repo.mongodb.com/yum/redhat/\$releasever/mongodb-enterprise/stable/\$basearch/" >> /etc/yum.repos.d/mongodb-enterprise.repo
echo "gpgcheck=1" >> /etc/yum.repos.d/mongodb-enterprise.repo
echo "enabled=1" >> /etc/yum.repos.d/mongodb-enterprise.repo
echo "gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc" >>  /etc/yum.repos.d/mongodb-enterprise.repo
# Install updates
yum -y update

#Install Mongo DB, xfs driver, & SELINUX management tools
yum install -y xfsprogs mongodb-enterprise policycoreutils-python

#enable access fo relevant ports for SELINUX
semanage port -a -t mongod_port_t -p tcp 27017

# Disable THP on a running system
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

# Disable THP upon reboot
cp -p /etc/rc.d/rc.local /etc/rc.d/rc.local.`date +%Y%m%d-%H:%M`
sed -i -e '$i \ if test -f /sys/kernel/mm/transparent_hugepage/enabled; then \
		 echo never > /sys/kernel/mm/transparent_hugepage/enabled \
	  fi \ \
	if test -f /sys/kernel/mm/transparent_hugepage/defrag; then \
	   echo never > /sys/kernel/mm/transparent_hugepage/defrag \
	fi \
	\n' /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local

#set soft rlimits
cp /etc/security/limits.d/90-nproc.conf /etc/security/limits.d/99-mongodb-nproc.conf
sed -i 's/1024/32000/g' /etc/security/limits.d/99-mongodb-nproc.conf

#start mongodb
service mongod start

#set mongo to start on reboot
chkconfig mongod on<commit_msg>Good to go for a single server instance. Now need to add external storage (Standard for now)<commit_after>
#Modify Sudoers file to not require tty for shell script execution on CentOS
# sudo sed -i '/Defaults[[:space:]]\+requiretty/s/^/#/' /etc/sudoers

# Enable write access to the mongodb.repo and configure it for installation

#sudo chmod 777 /etc/yum.repos.d/mongodb.repo
touch /etc/yum.repos.d/mongodb-enterprise.repo 
echo "[mongodb-enterprise]" >> /etc/yum.repos.d/mongodb-enterprise.repo 
echo "name=MongoDB Enterprise Repository" >> /etc/yum.repos.d/mongodb-enterprise.repo 
echo "baseurl=https://repo.mongodb.com/yum/redhat/\$releasever/mongodb-enterprise/stable/\$basearch/" >> /etc/yum.repos.d/mongodb-enterprise.repo
echo "gpgcheck=1" >> /etc/yum.repos.d/mongodb-enterprise.repo
echo "enabled=1" >> /etc/yum.repos.d/mongodb-enterprise.repo
echo "gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc" >>  /etc/yum.repos.d/mongodb-enterprise.repo
# Install updates
yum -y update

# Disable THP on a running system
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

# Disable THP upon reboot
cp -p /etc/rc.d/rc.local /etc/rc.d/rc.local.`date +%Y%m%d-%H:%M`
sed -i -e '$i \ if test -f /sys/kernel/mm/transparent_hugepage/enabled; then \
		 echo never > /sys/kernel/mm/transparent_hugepage/enabled \
	  fi \ \
	if test -f /sys/kernel/mm/transparent_hugepage/defrag; then \
	   echo never > /sys/kernel/mm/transparent_hugepage/defrag \
	fi \
	\n' /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local

#set soft rlimits
ulimit -u 32000

#set soft rlimits when sytem reboots
cp /etc/security/limits.d/90-nproc.conf /etc/security/limits.d/99-mongodb-nproc.conf
sed -i 's/1024/32000/g' /etc/security/limits.d/99-mongodb-nproc.conf

#Install Mongo DB, xfs driver, & SELINUX management tools
yum install -y xfsprogs mongodb-enterprise policycoreutils-python

#enable access fo relevant ports for SELINUX
semanage port -a -t mongod_port_t -p tcp 27017

#listen on all ports
sed -i 's/bindIp/#bindIp/g' /etc/mongod.conf

#start mongodb
service mongod start

#set mongo to start on reboot
chkconfig mongod on
{'fraction_non_alphanumeric': 0.13779718583212033, 'fraction_numerical': 0.014798641436196022, 'mean_word_length': 3.8620283018867925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '400294', 'n_tokens_mistral': 1670, 'n_tokens_neox': 1556, 'n_words': 355}