安装LINUX系统对于好多运维人员来说都是很繁琐耗时的事情,如果将繁琐耗时的工作做成一键安装部署,那将会大大提高运维人员的工作效率,下边就给大家演示下如何实现一键部署安装的详细步骤。
要实现网络一键部署,目前有两种方法,一是运用传统方法用LINUX本身自带的传统服务部署安装,二是运用cobbler软件部署安装,两种方法都需要用到服务dhcp,tfps,http,nfs,还要用到syslinux软件,两个方法大体原理相同,不过相对来说cobbler软件会更加简单点。
部署前的准备工作:
1 准备安装包
1 cp -r /misc/cd /home/mylinux-6 #复制光盘文件到你指定的安装源路径位置
2 rm -rf /home/mylinux-6/repodata/*
3 cp /misc/cd/repodata/43d8fd068164b0f042845474d6a22262798b9f0d1f49ad1bf9f95b953089777d-c6-x86_64-comps.xml /app/mylinux/repodata/
4 cd /home/mylinux
5 createrepo -g repodata/43d8fd068164b0f042845474d6a22262798b9f0d1f49ad1bf9f95b953089777d-c6-x86_64-comps.xml ./ #生成私有YUM源
6 find /home/mylinux -name TRANS.TBL -exec rm {} \; #删除所有TBL结尾的文件
2 修改配置文件
1 mv /root/anaconda-ks.cfg ks6.cfg #复制自动应答文件到制作光盘的目录
2 vim ks6.cfg #编辑此文件
1 #version=DEVEL
2 install
3 cdrom
4 lang en_US.UTF-8
5 keyboard us
6 network –onboot yes –device eth0 –bootproto dhcp –noipv6
7 rootpw –iscrypted 61441QemIUsmp2Czv$Nig3zS6LS0.E6656.P27/6fEdrQIpYifWbFWs0ugpsbX0tmUOxPFurJ.I0cQ.iz44A6OPzRIXVuArVF7PIv2f.
8 firewall –service=ssh
9 authconfig –enableshadow –passalgo=sha512
10 selinux –disable
11 timezone –utc Asia/Shanghai
12 bootloader –location=mbr –driveorder=sda –append=”crashkernel=auto rhgb quiet”
13 # The following is the partition information you requested
14 # Note that any partitions you deleted are not expressed
15 # here so unless you clear all partitions first, this is
16 # not guaranteed to work
17 zerombr #清除分区表
18 clearpart –all #清除所有磁盘分区信息
19 text
20 reboot
21 #分区信息
22 part /boot –fstype=ext4 –size=200
23 part / –fstype=ext4 –size=100000
24 part /home –fstype=ext4 –size=50000
25 part swap –size=2048
26 #repo –name=”CentOS” –baseurl=cdrom:sr0 –cost=100 #这项删除或者注释掉
27 %packages
28 @base
29 @core
30 @debugging
31 @basic-desktop
32 @desktop-debugging
33 @desktop-platform
34 @directory-client
35 @fonts
36 @general-desktop
37 @graphical-admin-tools
38 @input-methods
39 @internet-applications
40 @internet-browser
41 @java-platform
42 @legacy-x
43 @network-file-system-client
44 @network-tools
45 @office-suite
46 @print-client
47 @remote-desktop-clients
48 @server-platform
49 @server-policy
50 @workstation-policy
51 @x11
52 mtools
53 pax
54 python-dmidecode
55 oddjob
56 wodim
57 sgpio
58 genisoimage
59 device-mapper-persistent-data
60 abrt-gui
61 samba-winbind
62 certmonger
63 pam_krb5
64 krb5-workstation
65 libXmu
66 lksctp-tools
67 %end
68 %post #可在此区域添加自定义脚本
69 rm -rf /etc/yum.repos.d/*
70 cat > /etc/yum.repos.d/base.repo <
本文介绍了一种提高运维效率的方法,即通过一键部署的方式安装LINUX系统。文章详细阐述了两种部署方式:使用LINUX自带的传统服务进行部署及利用cobbler软件进行部署,并提供了具体的配置步骤。

785

被折叠的 条评论
为什么被折叠?



