Centos Install

The purpose of this document is to explain the standard procedure for installing CentOS.

Part 1: The OS install

    1. Download the x8664 net install ISO file: http://mirror.es.its.nyu.edu/centos/6.3/isos/x8664/CentOS-6.3-x86_64-netinstall.iso

    2. Mount it on the destination server by making a USB stick with unetbootin, burning the ISO image, or mounting the ISO with VMware.

    3. Give the boot network info and point to a nearby CentOS mirror server

    4. Use http://mirror.es.its.nyu.edu/centos/6.3/os/x86_64/

    5. Add the option "expert text" to the installer when you boot.

    6. Accept VNC suggestion and and assign a password. Access the console with UltraVNC Win32 Viewer portable. Don't forget to enter the port number (e.eg., 10.24.4.101:1).

    7. Create a partition table similar to the following:

# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 9.7G 426M 8.8G 5% / tmpfs 16G 0 16G 0% /dev/shm /dev/sda1 97M 44M 49M 48% /boot /dev/sda9 985M 18M 918M 2% /home /dev/sda8 2.5G 68M 2.3G 3% /opt/jgs /dev/sda7 4.9G 563M 4.1G 13% /usr /dev/sda6 9.7G 254M 8.9G 3% /var /dev/sda5 433G 199M 411G 1% /var/jgs /dev/sda10 985M 20M 915M 3% /var/log /dev/sda11 985M 18M 918M 2% /var/log/jgs # mount /dev/sda2 on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw) /dev/sda1 on /boot type ext4 (rw) /dev/sda9 on /home type ext4 (rw) /dev/sda8 on /opt/jgs type ext4 (rw) /dev/sda7 on /usr type ext4 (rw) /dev/sda6 on /var type ext4 (rw) /dev/sda5 on /var/jgs type ext4 (rw) /dev/sda10 on /var/log type ext4 (rw) /dev/sda11 on /var/log/jgs type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

Part 2: Configuring the basics

If you cloned the machine instead of installing it, you'll need to fix some networking things

ifconfig # Check if the eth0 entry shows up. If it does, skip this section. If it doesn't, continue. service network restart # If this fixes the problem and you now see eth0, skip the rest of this section. If it doesn't, continue. rm /etc/udev/rules.d/70-persistent-net.rules vi /etc/sysconfig/network-scripts/ifcfg-eth0 # Remove the MAC address or UUID entry shutdown -r now

Install wget and some other basics

yum -y install wget vim man mlocate unzip make openssh-clients bind-utils mailx yum -y groupinstall "Development Tools" vim /etc/yum/pluginconf.d/fastestmirror.conf # Disable it: enabled=0

RPM Forge - Centos 7 version (see here for details)

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm yum -y install htop dstat sysstat

RPM Forge - Centos 6 version

cd ~ && tmp_dir="/root/tmp/rpmforge" && mkdir -p ${tmp_dir} && cd ${tmp_dir} wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm && rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm cd ~ && rm -rf ${tmp_dir} yum -y install htop dstat sysstat

RPM Forge - Centos 5 version

# Note: this is just for CentOS 5 cd ~ && tmp_dir="/root/tmp/rpmforge" && mkdir -p ${tmp_dir} && cd ${tmp_dir} wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm cd ~ && rm -rf ${tmp_dir} yum -y install htop dstat sysstat

Disable security

service iptables stop chkconfig iptables off vim /etc/selinux/config

1 2 # This file controls the state of SELinux on the system. 3 # SELINUX= can take one of these three values: 4 # enforcing - SELinux security policy is enforced. 5 # permissive - SELinux prints warnings instead of enforcing. 6 # disabled - No SELinux policy is loaded. 7 SELINUX=disabled 8 # SELINUXTYPE= can take one of these two values: 9 # targeted - Targeted processes are protected, 10 # mls - Multi Level Security protection. 11 SELINUXTYPE=targeted 12 13

shutdown -r now

Install EPEL - Centos 7 version

yum -y install epel-release

Used to be this:

yum -y install http://mirrors.einstein.yu.edu/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Install EPEL - Centos 6 version

cd ~ && tmp_dir="/root/tmp/epel" && mkdir -p ${tmp_dir} && cd ${tmp_dir} wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm cd ~ && rm -rf ${tmp_dir} yum -y install ruby

Install and configure puppet

yum -y install puppet vim /etc/sysconfig/puppet

# The puppetmaster server PUPPET_SERVER=puppet01 # If you wish to specify the port to connect to do so here #PUPPET_PORT=8140 # Where to log to. Specify syslog to send log messages to the system log. PUPPET_LOG=/var/log/puppet.log # You may specify other parameters to the puppet client here #PUPPET_EXTRA_OPTS=--waitforcert=500

rm -rf /var/log/puppet/ chkconfig puppet on puppet agent --no-daemonize --onetime --logdest console --verbose # See solving puppet errors service puppet start tail -f -n 100 /var/log/puppet.log

Update everything and reboot

yum -y update shutdown -r now

Install VMware tools (must be done after every kernel upgrade, which often happens in a yum update)

(C.f., here) In ESXi * Right click VM * "Guest" [menu item] * "Install/Upgrade VMware Tools" [menu item] On the VM

cd ~ && tmp_dir="/root/tmp/vmware_tools" && mkdir -p ${tmp_dir} && cd ${tmp_dir} mkdir /mnt/cdrom && mount /dev/cdrom /mnt/cdrom cp /mnt/cdrom/VMwareTools-*.tar.gz ${tmp_dir}/ tar -zxf ${tmp_dir}/VMwareTools-*.tar.gz -C ${tmp_dir}/ ${tmp_dir}/vmware-tools-distrib/vmware-install.pl --default rm -rf ${tmp_dir} shutdown -r now

[Edit]