码迷,mamicode.com
首页 > 其他好文 > 详细

Kickstart 安装

时间:2015-05-15 18:01:35      阅读:340      评论:0      收藏:0      [点我收藏+]

标签:软件

软件


配置Yum 源

cd /etc/yum.repos.d/
  1. vim local.repo

  2. [epel]

  3. name=Extra Packages for Enterprise Linux 6 - $basearch

  4. baseurl=http://dl.fedoraproject.org/pub/epel/6/$basearch

  5. failovermethod=priority

  6. enabled=1

  7. gpgcheck=1

  8. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6


  9. [epel-debuginfo]

  10. name=Extra Packages for Enterprise Linux 6 - $basearch - Debug

  11. baseurl=http://dl.fedoraproject.org/pub/epel/6/$basearch/debug


  12. failovermethod=priority

  13. enabled=0

  14. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

  15. gpgcheck=1


  16. [epel-source]

  17. name=Extra Packages for Enterprise Linux 6 - $basearch - Source

  18. baseurl=http://dl.fedoraproject.org/pub/epel/6/SRPMS


  19. failovermethod=priority

  20. enabled=0

  21. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

  22. gpgcheck=1

  1. vim rhel-source.repo

  2. [base]

  3. name=CentOS-6 - Base - 163.com

  4. baseurl=http://mirrors.163.com/centos/6/os/$basearch/

  5. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

  6. gpgcheck=1

  7. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


  8. #released updates

  9. [updates]

  10. name=CentOS-6 - Updates - 163.com

  11. baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

  12. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

  13. gpgcheck=1

  14. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


  15. #additional packages that may be useful

  16. [extras]

  17. name=CentOS-6 - Extras - 163.com

  18. baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

  19. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

  20. gpgcheck=1

  21. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


  22. #additional packages that extend functionality of existing packages

  23. [centosplus]

  24. name=CentOS-6 - Plus - 163.com

  25. baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

  26. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

  27. gpgcheck=1

  28. enabled=0

  29. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


  30. #contrib - packages by Centos Users

  31. [contrib]

  32. name=CentOS-6 - Contrib - 163.com

  33. baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

  34. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

  35. gpgcheck=1

  36. enabled=0

  37. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


安装dhcp

yum install dhcp -y
vim /etc/dhcp/dhcpd.confddns-update-style interim;ignore client-updates;subnet 192.168.50.0 netmask 255.255.255.0 {# --- default gateway        option routers                  192.168.50.2;        option subnet-mask              255.255.255.0;        option domain-name              "dns.youshop.com";        option domain-name-servers      10.5.1.200;        option time-offset              -18000; # Eastern Standard Time        range dynamic-bootp 192.168.50.11 192.168.50.253;        default-lease-time 21600;        max-lease-time 43200;        filename "pxelinux.0";        next-server 192.168.50.165;        }
/etc/init.d/dhcpd restart
chkconfig dhcpd on

测试

新建虚拟机查看是否可以获取dhcp地址


安装tftp

yum install tftp -yyum install tftp-server -y
disable yes改为no
vim /etc/xinetd.d/tftpservice tftp{        socket_type             = dgram        protocol                = udp        wait                    = yes        user                    = root        server                  = /usr/sbin/in.tftpd        server_args             = -s /var/lib/tftpboot        disable                 = no        per_source              = 11        cps                     = 100 2        flags                   = IPv4}
/etc/init.d/xinetd restartchkconfig xinetd on

安装syslinux

yum install syslinux -ycd /usr/share/syslinux/find . -name pxelinux.0
cp pxelinux.0 /var/lib/tftpboot//etc/init.d/xinetd restart

挂载镜像

yum install lrzsz -y
rz -e rhel-server-6.4-x86_64-dvd.iso
mount -o loop rhel-server-6.4-x86_64-dvd.iso /mnt/ll /mnt

导入镜像及文件

mkdir /var/lib/tftpboot/pxelinux.cfgcd /mnt/isolinux/cp vesamenu.c32 boot.msg splash.jpg /var/lib/tftpboot/cp isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
mkdir -p /var/lib/tftpboot/vmlinuz/rhel-6.4-x86_64mkdir -p /var/lib/tftpboot/initrd/rhel-6.4-x86_64cp initrd.img /var/lib/tftpboot/initrd/rhel-6.4-x86_64/cp vmlinuz /var/lib/tftpboot/vmlinuz/rhel-6.4-x86_64/
  1. vim /var/lib/tftpboot/pxelinux.cfg/default

  2. default vesamenu.c32

  3. #prompt 1

  4. timeout 600


  5. display boot.msg


  6. menu background splash.jpg

  7. menu title Welcome to Red Hat Enterprise Linux 6.4!

  8. menu color border 0 #ffffffff #00000000

  9. menu color sel 7 #ffffffff #ff000000

  10. menu color title 0 #ffffffff #00000000

  11. menu color tabmsg 0 #ffffffff #00000000

  12. menu color unsel 0 #ffffffff #00000000

  13. menu color hotsel 0 #ff000000 #ffffffff

  14. menu color hotkey 7 #ffffffff #ff000000

  15. menu color scrollbar 0 #ffffffff #00000000


  16. label rhel-6.4-x86_64

  17.   menu label ^Install Rhel-6.4-x86_64

  18.   kernel vmlinuz/rhel-6.4-x86_64/vmlinuz

  19.   append initrd=initrd/rhel-6.4-x86_64/initrd.img

虚拟机重启测试

可以到choose a language界面


安装nginx

vim /etc/nginx/nginx.conf
yum install --nogpgcheck nginx -y
mkdir -p /data/server/install/{ks,imgs}/rhel-6.4-x86_64cp -rp /mnt/* /data/server/install/imgs/rhel-6.4-x86_64/
  1.    worker_connections  1024;

  2. }

  3. http {

  4.    include       /etc/nginx/mime.types;

  5.    default_type  application/octet-stream;


  6.    log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘

  7.                      ‘$status $body_bytes_sent "$http_referer" ‘

  8.                      ‘"$http_user_agent" "$http_x_forwarded_for"‘;

  9.    access_log  /var/log/nginx/access.log  main;

  10.    sendfile        on;

  11.    keepalive_timeout  65;

  12.    gzip  on;


  13.   server {

  14.        autoindex on;

  15.        autoindex_exact_size off;

  16.        autoindex_localtime on;

  17.        listen       80;

  18.        server_name  _;

  19.        root  /data/server/install;

  20.    }

  21. }

/etc/init.d/nginx restartchkconfig nginx on

修改ks文件

cd /data/server/install/ks/
  1. vim rhel-6.4-x86_64.ks

  2. # System authorization information

  3. authconfig --enableshadow --passalgo=sha512

  4. # System bootloader configuration

  5. key --skip

  6. bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb rhgb quiet quiet"

  7. # Partition clearing information

  8. clearpart --all --initlabel

  9. # Use graphical install

  10. #graphical

  11. text

  12. # Firewall configuration

  13. firewall --disabled

  14. # Run the Setup Agent on first boot

  15. firstboot --disable

  16. # System keyboard

  17. keyboard us

  18. #Reboot after installation

  19. reboot

  20. # System language

  21. lang en_US.UTF-8

  22. # Installation logging level

  23. logging --level=info

  24. url --url=http://192.168.50.160/imgs/rhel-6.4-x86_64

  25. network --bootproto=dhcp --device=eth0 --onboot=on

  26. #Root password

  27. rootpw 123

  28. # SELinux configuration

  29. selinux --disabled

  30. # System timezone

  31. timezone  Asia/Shanghai

  32. # Install OS instead of upgrade

  33. install

  34. # X Window System configuration information

  35. skipx

  36. #xconfig  --defaultdesktop=GNOME --depth=8 --resolution=640x480 --startxonboot

  37. clearpart --none --initlabel

  38. zerombr


  39. part / --fstype=ext4 --size=20480 --ondisk=sda

  40. part /usr --fstype=ext4 --size=20480 --ondisk=sda

  41. part /var --fstype=ext4 --size=20480 --ondisk=sda

  42. part swap --size=10240 --ondisk=sda

  43. part /data --fstype=ext4 --size 1 --grow --ondisk=sda

  44. #part / --fstype=ext4 --size=20480

  45. #part /usr --fstype=ext4 --size=20480

  46. #part /var --fstype=ext4 --size=20480

  47. #part swap --size=10240

  48. #part /data --fstype=ext4 --size 1 --grow


  49. %pre

  50. /usr/sbin/parted -s /dev/sda mklabel gpt


  51. %packages

  52. @additional-devel

  53. @base

  54. @chinese-support

  55. @client-mgmt-tools

  56. @console-internet

  57. @core

  58. @debugging

  59. @development

  60. @directory-client

  61. @hardware-monitoring

  62. @large-systems

  63. @legacy-unix

  64. @network-file-system-client

  65. @network-tools

  66. @performance

  67. @perl-runtime

  68. @server-platform

  69. @server-platform-devel

  70. @server-policy

  71. libXinerama-devel

  72. xorg-x11-proto-devel

  73. startup-notification-devel

  74. libgnomeui-devel

  75. libbonobo-devel

  76. libXau-devel

  77. libgcrypt-devel

  78. popt-devel

  79. libXrandr-devel

  80. libxslt-devel

  81. libglade2-devel

  82. gnutls-devel

  83. mtools

  84. pax

  85. python-dmidecode

  86. oddjob

  87. sgpio

  88. jpackage-utils

  89. certmonger

  90. pam_krb5

  91. krb5-workstation

  92. tcp_wrappers

  93. perl-DBD-SQLite

  94. telnet

  95. expect

  96. lrzsz

  97. libaio-devel

  98. %end


  99. %post --nochroot

  100. echo "*       soft    core    unlimited" >> /mnt/sysimage/etc/security/limits.conf

  101. echo "*       hard    core    unlimited" >> /mnt/sysimage/etc/security/limits.conf

  102. echo "*       soft    nofile  65535" >> /mnt/sysimage/etc/security/limits.conf

  103. echo "*       hard    nofile  65535" >> /mnt/sysimage/etc/security/limits.conf

  104. echo "*       soft    nproc   32000" >> /mnt/sysimage/etc/security/limits.conf

  105. echo "*       hard    nproc   32000" >> /mnt/sysimage/etc/security/limits.conf

  106. echo "*       soft    nproc   32000" > /mnt/sysimage/etc/security/limits.d/90-nproc.conf

  107. echo "net.ipv4.tcp_fin_timeout = 5" >> /mnt/sysimage/etc/sysctl.conf

  108. echo "net.ipv4.tcp_keepalive_time = 300" >> /mnt/sysimage/etc/sysctl.conf

  109. echo "net.ipv4.tcp_syncookies = 1" >> /mnt/sysimage/etc/sysctl.conf

  110. echo "net.ipv4.tcp_tw_reuse = 1" >> /mnt/sysimage/etc/sysctl.conf

  111. echo "net.ipv4.tcp_tw_recycle = 0" >> /mnt/sysimage/etc/sysctl.conf

  112. echo "net.ipv4.ip_local_port_range = 5000 65000" >> /mnt/sysimage/etc/sysctl.conf

  113. echo "net.core.rmem_max = 16777216" >> /mnt/sysimage/etc/sysctl.conf

  114. echo "net.core.wmem_max = 16777216" >> /mnt/sysimage/etc/sysctl.conf

  115. echo "net.ipv4.tcp_rmem = 4096 87380 16777216" >> /mnt/sysimage/etc/sysctl.conf

  116. echo "kernel.core_uses_pid = 0"  >> /mnt/sysimage/etc/sysctl.conf

  117. echo "net.ipv4.tcp_wmem = 4096 65536 16777216" >> /mnt/sysimage/etc/sysctl.conf

  118. echo "*/5 * * * * /usr/sbin/ntpdate idc01-ms-ns-01 >/dev/null 2>&1" >> /mnt/sysimage/var/spool/cron/root


  119. %post

  120. echo "TMOUT=43200" >> /etc/profile.d/tmout.sh

  121. echo "export  TMOUT"  >> /etc/profile.d/tmout.sh

  122. echo ‘export HISTTIMEFORMAT="%F %T $(whoami) "‘ >> /etc/profile

  123. cat > /etc/yum.repos.d/local.repo <<eof

  124. [Server]

  125. name=Server

  126. baseurl=http://10.1.15.82:8080/cobbler/ks_mirror/rhel6.5-x86_64-x86_64/

  127. gpgcheck=1

  128. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

  129. eof


  130. CHK_LIST=`/sbin/chkconfig --list | sed -n ‘1,/^$/p‘ | /bin/awk ‘$0!~/^$|3:off|crond|network|sshd|rsyslog/{print $1}‘`

  131. for i in $CHK_LIST; do

  132.    /sbin/chkconfig $i off

  133. done

  134. mkdir -p /usr/local/webserver

  135. cd /tmp

  136. groupadd -g 2012 zabbix;

  137. useradd -s /sbin/nologin -u 2014 -g 2012 -M zabbix >& /dev/null

  138. rpm -e mysql

  139. rpm -Uvh http://192.168.50.160/imgs/other/bash-4.1.2-15.el6_5.2.x86_64.rpm

  140. rpm -ivh http://192.168.50.160/imgs/other/MegaCli-8.05.71-1.noarch.rpm

  141. wget http://192.168.50.160/imgs/other/dell-dset-lx64-3.7.0.219.bin

  142. wget http://192.168.50.160/imgs/other/zabbix-2.2.3.tar.gz

  143. tar -zxf zabbix-2.2.3.tar.gz  -C /usr/local/webserver/

  144. mv /usr/local/webserver/zabbix/zabbix_agentd /etc/init.d

  145. chkconfig zabbix_agentd on

  146. echo "zabbix_agent    10050/tcp" >>/etc/services

  147. echo "zabbix_trap     10051/tcp" >>/etc/services

  148. /etc/init.d/zabbix_agentd restart >&/dev/null

  149. cat > /etc/resolv.conf <<eof

  150. #options timeout:1

  151. search dns.koudai.com

  152. nameserver 10.2.1.200

  153. nameserver 10.2.1.201

  154. eof

  155. rm -f /root/anaconda-ks.cfg

  156. wget http://192.168.50.160/imgs/other/dnsmasq_install.tar.gz

  157. tar xf dnsmasq_install.tar.gz -C /tmp

  158. /bin/bash /tmp/dnsmasq_install.sh > /tmp/dnsmasq.log 2>&1

  159. %end

mkdir /data/server/install/imgs/other/ && cd /data/server/install/imgs/other/ll /data/server/install/imgs/other/total 35264-rw-r--r-- 1 root root   926900 Oct 14  2014 bash-4.1.2-15.el6_5.2.x86_64.rpm-rw-r--r-- 1 root root 32376292 Dec 10 04:14 dell-dset-lx64-3.7.0.219.bin-rw-r--r-- 1 root root   406594 May 14 15:01 dnsmasq_install.tar.gz-rw-r--r-- 1 root root  1598937 May 14 15:01 MegaCli-8.05.71-1.noarch.rpm-rw-r--r-- 1 root root   786607 Feb  9 15:19 zabbix-2.2.3.tar.gz
  1. vim /var/lib/tftpboot/pxelinux.cfg/default

  2. default vesamenu.c32

  3. #prompt 1

  4. timeout 600


  5. display boot.msg


  6. menu background splash.jpg

  7. menu title Welcome to Red Hat Enterprise Linux 6.4!

  8. menu color border 0 #ffffffff #00000000

  9. menu color sel 7 #ffffffff #ff000000

  10. menu color title 0 #ffffffff #00000000

  11. menu color tabmsg 0 #ffffffff #00000000

  12. menu color unsel 0 #ffffffff #00000000

  13. menu color hotsel 0 #ff000000 #ffffffff

  14. menu color hotkey 7 #ffffffff #ff000000

  15. menu color scrollbar 0 #ffffffff #00000000


  16. label rhel-6.4-x86_64

  17.  menu label ^Install Rhel-6.4-x86_64

  18.  kernel vmlinuz/rhel-6.4-x86_64/vmlinuz

  19.  append initrd=initrd/rhel-6.4-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://192.168.50.165/ks/rhel

  20. -6.4-x86_64.ks


安装redhat 6.5

挂载镜像拷贝文件

umount  /mntrz -e rhel-server-6.5-x86_64-dvd.isomount -o loop rhel-server-6.5-x86_64-dvd.iso /mnt
cd /mnt/isolinux/mkdir /var/lib/tftpboot/initrd/rhel-6.5-x86_64/mkdir /var/lib/tftpboot/vmlinuz/rhel-6.5-x86_64/cp initrd.img /var/lib/tftpboot/initrd/rhel-6.5-x86_64/cp vmlinuz /var/lib/tftpboot/vmlinuz/rhel-6.5-x86_64/
mkdir /data/server/install/imgs/rhel-6.5-x86_64/cp -rp /mnt/* /data/server/install/imgs/rhel-6.5-x86_64/ &

修改default配置文件

  1. vim /var/lib/tftpboot/pxelinux.cfg/default

  2. display boot.msg

  3. menu background splash.jpg

  4. menu title Welcome to Red Hat Enterprise Linux 6.4!

  5. menu color border 0 #ffffffff #00000000

  6. menu color sel 7 #ffffffff #ff000000

  7. menu color title 0 #ffffffff #00000000

  8. menu color tabmsg 0 #ffffffff #00000000

  9. menu color unsel 0 #ffffffff #00000000

  10. menu color hotsel 0 #ff000000 #ffffffff

  11. menu color hotkey 7 #ffffffff #ff000000

  12. menu color scrollbar 0 #ffffffff #00000000


  13. label rhel-6.4-x86_64

  14.  menu label ^Install Rhel-6.4-x86_64

  15.  kernel vmlinuz/rhel-6.4-x86_64/vmlinuz

  16.  append initrd=initrd/rhel-6.4-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://192.168.50.165/ks/rhel

  17. -6.4-x86_64.ks

  18. label rhel-6.5-x86_64

  19.  menu label ^Install Rhel-6.5-x86_64

  20.  kernel vmlinuz/rhel-6.5-x86_64/vmlinuz

  21.  append initrd=initrd/rhel-6.5-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://192.168.50.165/ks/rhel

  22. -6.5-x86_64.ks

  1. ###修改ks配置文件

  2. vim /data/server/install/ks/rhel-6.5-x86_64.ks

  3. # System authorization information

  4. authconfig --enableshadow --passalgo=sha512

  5. # System bootloader configuration

  6. key --skip

  7. bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb rhgb quiet quiet"

  8. # Partition clearing information

  9. clearpart --all --initlabel

  10. # Use graphical install

  11. #graphical

  12. text

  13. # Firewall configuration

  14. firewall --disabled

  15. # Run the Setup Agent on first boot

  16. firstboot --disable

  17. # System keyboard

  18. keyboard us

  19. #Reboot after installation

  20. reboot

  21. # System language

  22. lang en_US.UTF-8

  23. # Installation logging level

  24. logging --level=info

  25. url --url=http://192.168.50.160/imgs/rhel-6.5-x86_64

  26. network --bootproto=dhcp --device=eth0 --onboot=on

  27. #Root password

  28. rootpw 123

  29. # SELinux configuration

  30. selinux --disabled

  31. # System timezone

  32. timezone  Asia/Shanghai

  33. # Install OS instead of upgrade

  34. install

  35. # X Window System configuration information

  36. skipx

  37. #xconfig  --defaultdesktop=GNOME --depth=8 --resolution=640x480 --startxonboot

  38. clearpart --none --initlabel

  39. zerombr


  40. part / --fstype=ext4 --size=20480 --ondisk=sda

  41. part /usr --fstype=ext4 --size=20480 --ondisk=sda

  42. part /var --fstype=ext4 --size=20480 --ondisk=sda

  43. part swap --size=10240 --ondisk=sda

  44. part /data --fstype=ext4 --size 1 --grow --ondisk=sda

  45. #part / --fstype=ext4 --size=20480

  46. #part /usr --fstype=ext4 --size=20480

  47. #part /var --fstype=ext4 --size=20480

  48. #part swap --size=10240

  49. #part /data --fstype=ext4 --size 1 --grow


  50. %pre

  51. /usr/sbin/parted -s /dev/sda mklabel gpt


  52. %packages

  53. @additional-devel

  54. @base

  55. @chinese-support

  56. @client-mgmt-tools

  57. @console-internet

  58. @core

  59. @debugging

  60. @development

  61. @directory-client

  62. @hardware-monitoring

  63. @large-systems

  64. @legacy-unix

  65. @network-file-system-client

  66. @network-tools

  67. @performance

  68. @perl-runtime

  69. @server-platform

  70. @server-platform-devel

  71. @server-policy

  72. libXinerama-devel

  73. xorg-x11-proto-devel

  74. startup-notification-devel

  75. libgnomeui-devel

  76. libbonobo-devel

  77. libXau-devel

  78. libgcrypt-devel

  79. popt-devel

  80. libXrandr-devel

  81. libxslt-devel

  82. libglade2-devel

  83. gnutls-devel

  84. mtools

  85. pax

  86. python-dmidecode

  87. oddjob

  88. sgpio

  89. jpackage-utils

  90. certmonger

  91. pam_krb5

  92. krb5-workstation

  93. tcp_wrappers

  94. perl-DBD-SQLite

  95. telnet

  96. expect

  97. lrzsz

  98. libaio-devel

  99. %end


  100. %post --nochroot

  101. echo "*       soft    core    unlimited" >> /mnt/sysimage/etc/security/limits.conf

  102. echo "*       hard    core    unlimited" >> /mnt/sysimage/etc/security/limits.conf

  103. echo "*       soft    nofile  65535" >> /mnt/sysimage/etc/security/limits.conf

  104. echo "*       hard    nofile  65535" >> /mnt/sysimage/etc/security/limits.conf

  105. echo "*       soft    nproc   32000" >> /mnt/sysimage/etc/security/limits.conf

  106. echo "*       hard    nproc   32000" >> /mnt/sysimage/etc/security/limits.conf

  107. echo "*       soft    nproc   32000" > /mnt/sysimage/etc/security/limits.d/90-nproc.conf

  108. echo "net.ipv4.tcp_fin_timeout = 5" >> /mnt/sysimage/etc/sysctl.conf

  109. echo "net.ipv4.tcp_keepalive_time = 300" >> /mnt/sysimage/etc/sysctl.conf

  110. echo "net.ipv4.tcp_syncookies = 1" >> /mnt/sysimage/etc/sysctl.conf

  111. echo "net.ipv4.tcp_tw_reuse = 1" >> /mnt/sysimage/etc/sysctl.conf

  112. echo "net.ipv4.tcp_tw_recycle = 0" >> /mnt/sysimage/etc/sysctl.conf

  113. echo "net.ipv4.ip_local_port_range = 5000 65000" >> /mnt/sysimage/etc/sysctl.conf

  114. echo "net.core.rmem_max = 16777216" >> /mnt/sysimage/etc/sysctl.conf

  115. echo "net.core.wmem_max = 16777216" >> /mnt/sysimage/etc/sysctl.conf

  116. echo "net.ipv4.tcp_rmem = 4096 87380 16777216" >> /mnt/sysimage/etc/sysctl.conf

  117. echo "kernel.core_uses_pid = 0"  >> /mnt/sysimage/etc/sysctl.conf

  118. echo "net.ipv4.tcp_wmem = 4096 65536 16777216" >> /mnt/sysimage/etc/sysctl.conf

  119. echo "*/5 * * * * /usr/sbin/ntpdate idc01-ms-ns-01 >/dev/null 2>&1" >> /mnt/sysimage/var/spool/cron/root


  120. %post

  121. echo "TMOUT=43200" >> /etc/profile.d/tmout.sh

  122. echo "export  TMOUT"  >> /etc/profile.d/tmout.sh

  123. echo ‘export HISTTIMEFORMAT="%F %T $(whoami) "‘ >> /etc/profile

  124. cat > /etc/yum.repos.d/local.repo <<eof

  125. [Server]

  126. name=Server

  127. baseurl=http://10.1.15.82:8080/cobbler/ks_mirror/rhel6.5-x86_64-x86_64/

  128. gpgcheck=1

  129. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

  130. eof


  131. CHK_LIST=`/sbin/chkconfig --list | sed -n ‘1,/^$/p‘ | /bin/awk ‘$0!~/^$|3:off|crond|network|sshd|rsyslog/{print $1}‘`

  132. for i in $CHK_LIST; do

  133.    /sbin/chkconfig $i off

  134. done

  135. mkdir -p /usr/local/webserver

  136. cd /tmp

  137. groupadd -g 2012 zabbix;

  138. useradd -s /sbin/nologin -u 2014 -g 2012 -M zabbix >& /dev/null

  139. rpm -e mysql

  140. rpm -Uvh http://192.168.50.160/imgs/other/bash-4.1.2-15.el6_5.2.x86_64.rpm

  141. rpm -ivh http://192.168.50.160/imgs/other/MegaCli-8.05.71-1.noarch.rpm

  142. wget http://192.168.50.160/imgs/other/dell-dset-lx64-3.7.0.219.bin

  143. wget http://192.168.50.160/imgs/other/zabbix-2.2.3.tar.gz

  144. tar -zxf zabbix-2.2.3.tar.gz  -C /usr/local/webserver/

  145. mv /usr/local/webserver/zabbix/zabbix_agentd /etc/init.d

  146. chkconfig zabbix_agentd on

  147. echo "zabbix_agent    10050/tcp" >>/etc/services

  148. echo "zabbix_trap     10051/tcp" >>/etc/services

  149. /etc/init.d/zabbix_agentd restart >&/dev/null

  150. cat > /etc/resolv.conf <<eof

  151. #options timeout:1

  152. search dns.koudai.com

  153. nameserver 10.2.1.200

  154. nameserver 10.2.1.201

  155. eof

  156. rm -f /root/anaconda-ks.cfg

  157. wget http://192.168.50.160/imgs/other/dnsmasq_install.tar.gz

  158. tar xf dnsmasq_install.tar.gz -C /tmp

  159. /bin/bash /tmp/dnsmasq_install.sh > /tmp/dnsmasq.log 2>&1

  160. %end

重起xinted

/etc/init.d/xinetd restart


End

本文出自 “天道酬勤的空间” 博客,转载请与作者联系!

Kickstart 安装

标签:软件

原文地址:http://rancho.blog.51cto.com/8661004/1651678

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!