centos6.6 Kickstart无人值守安装(三):配置篇 B

centos6.6 Kickstart无人值守安装(二):配置篇 A 中,试验成功的你会发现:只不过是自动的到达了安装界面的,还要自己选择语言,时区,等等交互界面,为了不进行交互界面。
所以才有了 centos6.6 Kickstart无人值守安装(三):配置篇 B kickstart上场。

我们这里用到的是kickstart的配置文本——ks.cfg,手写的,更自由,但是也难,细节很多。kickstart也有界面版的,通过界面配置ks.cfg ,最终还是生成一个ks.cfg文件,只不过界面简单。

界面配置方式:

可参照 这篇文章

文字配置方式:

完完全全写一个ks.cfg文件很麻烦,易出错。其实在我们安装好一个完整的linux操作系统后,系统会自动生成一个ks.cfg文件,该文件位于/root/anaconda-ks.cfg 我们可以将其复制到我们需要的地方,顺便贴一下我的ks.cfg

lang en_US.UTF-8
chmod 777 /mnt/install/ks.cfg
[root@localhost ~]# cat /mnt/install/ks.cfg
# Kickstart file automatically generated by anaconda.

#version=DEVEL
install
nfs --server=172.100.11.231 --dir=/mnt/install
lang en_US.UTF-8
zerombr yes
key --skip
keyboard us
network --device eth0 --bootproto dhcp --onboot on
rootpw bocom123

firewall --enabled --port=22:tcp

authconfig --enableshadow --enablemd5

selinux --disabled

timezone Asia/Shanghai

bootloader --location=mbr --driveorder=sda


clearpart --all --initlabel

part / --bytes-per-inode=4096 --fstype="ext3" --size=2048

part /boot --bytes-per-inode=4096 --fstype="ext3" --size=128

part swap --bytes-per-inode=4096 --fstype="swap" --size=500

part /data --bytes-per-inode=4096 --fstype="ext3" --grow --size=1

reboot

%packages


expect

@base

@core

@dialup

@editors

@text-internet

keyutils

trousers

fipscheck

device-mapper-multipath

%post



hwclock --systohc





service sshd restart


chkconfig acpid off

chkconfig atd off

chkconfig autofs off

chkconfig bluetooth off

chkconfig cpuspeed off

chkconfig firstboot off

chkconfig gpm off

chkconfig haldaemon off

chkconfig hidd off

chkconfig ip6tables off

chkconfig isdn off

chkconfig messagebus off

chkconfig nfslock off

chkconfig pcscd off

chkconfig portmap off

chkconfig rpcgssd off

chkconfig rpcidmapd off

chkconfig yum-updatesd off

chkconfig sendmail off

#.........

chkconfig crond on

chkconfig kudzu on

chkconfig network on

chkconfig readahead_early on

chkconfig sshd on

chkconfig syslog on

#....Ctrl+Alt+Del........


#......

echo -e "ulimit -c unlimited" >> /etc/profile

echo -e "ulimit -s unlimited" >> /etc/profile

echo -e "ulimit -SHn 65535" >> /etc/profile

source /etc/profile

sed -i "s/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g" '/etc/sysctl.conf'

echo -e "net.core.somaxconn = 262144" >> /etc/sysctl.conf

echo -e "net.core.netdev_max_backlog = 262144" >> /etc/sysctl.conf

echo -e "net.core.wmem_default = 8388608" >> /etc/sysctl.conf

echo -e "net.core.rmem_default = 8388608" >> /etc/sysctl.conf

echo -e "net.core.rmem_max = 16777216" >> /etc/sysctl.conf

echo -e "net.core.wmem_max = 16777216" >> /etc/sysctl.conf

echo -e "net.ipv4.netfilter.ip_conntrack_max = 131072" >> /etc/sysctl.conf

echo -e "net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 180" >> /etc/sysctl.conf

echo -e "net.ipv4.route.gc_timeout = 20" >> /etc/sysctl.conf

echo -e "net.ipv4.ip_conntrack_max = 819200" >> /etc/sysctl.conf

echo -e "net.ipv4.ip_local_port_range = 10024 65535" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_retries2 = 5" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_fin_timeout = 30" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_syn_retries = 1" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_synack_retries = 1" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_timestamps = 0" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_tw_recycle = 1" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_tw_len = 1" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_tw_reuse = 1" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_keepalive_time = 120" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_keepalive_probes = 3" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_keepalive_intvl = 15" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_max_tw_buckets = 36000" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_max_orphans = 3276800" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_max_syn_backlog = 262144" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_wmem = 8192 131072 16777216" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_rmem = 32768 131072 16777216" >> /etc/sysctl.conf

echo -e "net.ipv4.tcp_mem = 94500000 915000000 927000000" >> /etc/sysctl.conf

好了 ,现在是全自动安装了。不会弹出界面了。不截图了。
中途可能会遇到麻烦,细心,先看清报错信息,尝试看懂更改,实在不懂去google。

你可能感兴趣的:(centos6.6 Kickstart无人值守安装(三):配置篇 B)