Tuesday, August 21, 2012

Linux VM Provisioning


cat ~/.ssh/id_dsa.pub
vi ~/.ssh/authorized_keys
echo pass\&w0rd | passwd root --stdin
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -b 2048

lvresize -L +2G /dev/mapper/rootvg-varlv; resize2fs /dev/mapper/rootvg-varlv
lvresize -L +2G /dev/mapper/rootvg-tmplv; resize2fs /dev/mapper/rootvg-tmplv

 fdisk /dev/sdc < /home/aniu01/LinuxProvisioning/newdisk.sh

n
p
1
t
8e
w
echo - - - > /sys/class/scsi_host/host0/scan

fdisk -l
fdisk /dev/sdb
pvcreate /dev/sdb1
vgcreate APPVG /dev/sdb1
lvcreate -l 100%FREE -n APPLV APPVG
mkfs.ext3 /dev/APPVG/APPLV
fdisk /dev/sdd
fdisk -l
pvcreate /dev/sdd1
vgcreate MIDWAREVG /dev/sdd1
lvcreate -l 100%FREE -n  MIDWARELV  MIDWAREVG
mkfs.ext3 /dev/MIDWAREVG/MIDWARELV
mkfs -t ext3 /dev/MIDWAREVG/MIDWARELV
fdisk /dev/sdc
fdisk -l
pvcreate /dev/sdc1
vgcreate APPLOGVG /dev/sdc1
lvcreate -l 100%FREE -n  APPLOGLV APPLOGVG
mkfs -t ext3 /dev/APPLOGVG/APPLOGLV
fdisk /dev/sdc
fdisk -l
pvcreate /dev/sdc1
vgcreate DATAVG /dev/sdc1
lvcreate -l 100%FREE -n  DATALV DATAVG
mkfs -t ext3 /dev/DATAVG/DATALV

chkconfig portmap on;chkconfig ypbind on;chkconfig autofs on
nisdomainname ts.bo.com; domainname ts.bo.com
echo NISDOMAIN=goweekend.ca >> /etc/sysconfig/network
cd /etc; mv auto.home auto.home.orig
cd LinuxProvisioning/; scp auto.* yp.conf resolv.conf nsswitch.conf root@cmsfbccluacog01:/etc; cd ..
cd LinuxProvisioning/; scp auto.* yp.conf resolv.conf nsswitch.conf root@cmsfbccluaapp02:/etc; cd ..
cd LinuxProvisioning/; scp auto.* yp.conf resolv.conf nsswitch.conf root@cmsfbccluaweb01:/etc; cd ..
cd LinuxProvisioning/; scp auto.* yp.conf resolv.conf nsswitch.conf root@cmsfbccluaweb02:/etc; cd ..

  systool -c fc_host -v
lspci
dmidecode -t system

============================================================================================
Oracle requirements
groupadd dba; useradd -d /export/home/oracle -g dba oracle; echo dba4client |passwd oracle --stdin
echo dba4client | passwd oracle --stdin
cd /opt; mkdir oracle oraInventory; chown -R oracle:dba oracle oraInventory

yum install binutils* compat-libstdc++* elfutils-libelf* gcc-* glibc* ksh* libaio* libgcc* libgomp* libstdc* make* sysstat* unixODBC-2.2.11 unixODBC-devel-2.2.11 -y


echo "kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.shmmni = 4096
kernel.sem = 250 32000 100 1024
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range =9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
" >> /etc/sysctl.conf
sysctl -p
unzip /net/todnfs03/vol/archive/sw_archive/Oracle_Client/linux.x64_11gR2_client.zip
./runInstaller
runInstaller -silent -responseFile /tmp/oracle-admin.rsp
32 bits client
tar -xf /net/todnfs03/vol/archive/sw_archive/Oracle_Client/Oracle_Client_Linux_32bits_11g202.tar
./runInstaller -silent -nowelcome -responsefile /home/aniu01/cmsf/oracle_client.rsp
Oracle base: /opt/oracle
Software Locatioin: /opt/oracle/product/11.2.0.2/client
============================================================================================
sendmail
vi /etc/mail/sendmail.cf
# "Smart" relay host (may be null)
DSmailhost.goweekend.ca

echo "Let me know if you have got this email" |mailx -s "test from `hostname`" arthur.niu@gmail.com

/opt/quest/bin/vastool -u adm-ytan03 join -c "OU=CTD CM & RMG UNIX,OU=UnixServers,OU=Servers,DC=adroot,DC=goweekend,DC=ca" -n `hostname`  office.goweekend.ca

No comments:

Post a Comment