关于主机服务器(用于构建的服务器)

关于主机服务器(用于构建的服务器)

我尝试使用 apt-mirror 通过网络以 PXE 方式启动并使用“Ubuntu 12.04 Server”映像完全重建新服务器,但在安装过程中出现多个错误。我能够使用物理 CDROM(使用“ubuntu-12.04.2-server-amd64.iso”映像中的相同文件创建)成功重建同一台服务器,没有任何问题,但我通过网络进行构建时遇到问题,因为它在对磁盘进行分区并开始最后一次大文件传输后立即提供以下错误消息。因此,我无法使用我公司的内部网络(使用外部存储库有效)成功构建服务器 PXE。

错误 1:

!! 安装基础系统

解除引导警告

警告:无法下载软件包弹出(ver 2.1.5+deb1+cvs20081104-9 arc amd64)

错误 2:

!! 安装基础系统

解除引导警告

警告:无法下载软件包 liblzma5(ver 5.1.1alpha+20110809-3 arc amd64)

错误 3:

!! 安装基础系统

解除引导警告

警告:无法下载软件包 libstdc++6 (ver 4.6.3-1ubuntu5 arc amd64)

出现了更多类似的错误,但为了简洁起见已被省略......

以下是/var/log/syslog

...
Jul 12 17:30:00 partman-lvm:   Logical volume "swap_1" successfully removed
Jul 12 17:30:00 udevd[24071]: inotify_add_watch(6, /dev/dm-1, 10) failed: No such file or directory
Jul 12 17:30:00 partman-lvm:   0 logical volume(s) in volume group "coolservername" now active
Jul 12 17:30:00 partman-lvm:   Volume group "coolservername" successfully removed
Jul 12 17:30:00 partman-lvm:   Labels on physical volume "/dev/sda3" successfully wiped
Jul 12 17:30:02 partman-lvm:   Physical volume "/dev/sda3" successfully created
Jul 12 17:30:02 partman-lvm:   Volume group "coolservername" successfully created
Jul 12 17:30:02 partman-lvm:   Logical volume "root" created
Jul 12 17:30:02 partman-lvm:   Logical volume "swap_1" created
Jul 12 17:30:06 kernel: [  184.508873] Adding 16695292k swap on /dev/mapper/coolservername-swap_1.  Priority:-1 extents:1 across:16695292k
Jul 12 17:30:07 partman: mke2fs 1.42 (29-Nov-2011)
Jul 12 17:30:21 kernel: [  199.286079] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: errors=remount-ro
Jul 12 17:30:22 apt-install: Queueing package e2fsprogs for later installation
Jul 12 17:30:22 main-menu[514]: (process:25003): /var/lib/partman/devices/=dev=sda
Jul 12 17:30:23 main-menu[514]: DEBUG: resolver (libnewt0.52): package doesn't exist (ignored)
Jul 12 17:30:23 main-menu[514]: DEBUG: resolver (ext2-modules): package doesn't exist (ignored)
Jul 12 17:30:23 main-menu[514]: INFO: Menu item 'bootstrap-base' selected
Jul 12 17:30:23 debconf-copydb: Cannot open question file /target/var/cache/debconf/config.dat: No such file or directory
Jul 12 17:30:23 debconf-copydb: Cannot open template file /target/var/cache/debconf/templates.dat: No such file or directory
Jul 12 17:30:23 base-installer: chroot: can't execute 'debconf-set-selections': No such file or directory
Jul 12 17:30:23 base-installer: warning: /usr/lib/base-installer.d/20console-setup returned error code 127
Jul 12 17:30:55 base-installer: error: exiting on error base-installer/debootstrap-failed
Jul 12 17:30:55 main-menu[514]: WARNING **: Configuring 'bootstrap-base' failed with error code 1
Jul 12 17:30:55 main-menu[514]: WARNING **: Menu item 'bootstrap-base' failed.
Jul 12 17:30:56 main-menu[514]: INFO: Modifying debconf priority limit from 'high' to 'medium'
Jul 12 17:30:56 debconf: Setting debconf/priority to medium
Jul 12 17:30:57 main-menu[514]: DEBUG: resolver (libnewt0.52): package doesn't exist (ignored)
Jul 12 17:30:57 main-menu[514]: DEBUG: resolver (ext2-modules): package doesn't exist (ignored)
Jul 12 17:30:59 main-menu[514]: INFO: Menu item 'save-logs' selected

我首先使用 pxelinux 实现了 DHCP/TFTP 解决方案(https://help.ubuntu.com/community/PXEInstallServer),但后来转移到 syslinux 的 gpxelinux 以尝试使其工作(另外,使用 HTTP 似乎比 TFTP 等更快)。我尝试使用一个简单的 Kickstart 文件,但仍然没有成功:

install
url --url http://10.16.25.80:4040/ubuntu/repository/

...以及完整的apt-镜像存储库(如此处建议 ->无法使用 PXE 安装 12.10) 没有任何改善。我也尝试使用“ubuntu-12.04.2-alternate-amd64.iso”映像。

服务器硬件(我试图重新映像的硬件)

  • 戴尔 PowerEdge R320
  • 4 个物理硬盘配置为硬件 RAID 0,带有一个 4TB 虚拟驱动器。
  • 16GB 内存

关于主机服务器(用于构建的服务器)

托管服务器具有类似的硬件,之前已使用 Web UI 配置了 Ubuntu Server 12.04(precise)和 Chef 服务器 10.18.2,该 Web UI 使用 merb 提供 Web 服务(HTTP)。此服务器充当 DHCP/HTTP/TFTP/APT-MIRROR 主机。

已安装 DHCP

sudo apt-get install isc-dhcp-server

/etc/default/isc-dhcp 服务器

INTERFACES="eth0"

/etc/dhcp/dhcpd.conf

ddns-update-style none;
option domain-name "corp.com";
option domain-name-servers dns1.corp.com, dns2.corp.com;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 10.16.25.0 netmask 255.255.255.0 {
  range 10.16.25.195 10.16.25.199;
  option domain-name "corp.com";
  option domain-name-servers 10.10.10.200, 10.10.10.201;
  option routers 10.16.25.1;
  option broadcast-address 10.16.25.254;
  option ntp-servers 10.10.10.203;
  default-lease-time 600;
  max-lease-time 7200;
  filename "gpxelinux.0";
}

安装的 TFTP

sudo apt-get install tftpd-hpa

在/etc/default/tftpd-hpa中

RUN_DAEMON=”yes”
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

已安装 SysLinux

sudo apt-get install syslinux

/var/lib/tftpboot/pxelinux.cfg/默认

...
LABEL Server (Preseed/HTTP)
    KERNEL http://10.16.25.80:4040/pxe/ubuntu/12.04/alternate-amd64/install/netboot/ubuntu-installer/amd64/linux
    APPEND auto=true interface=eth0 hostname=coolservername url=http://10.16.25.80:4040/pxe/preseed/coolservername.seed initrd=http://10.16.25.80:4040/pxe/ubuntu/12.04/alternate-amd64/install/netboot/ubuntu-installer/amd64/initrd.gz --    

配置预置文件

种子文件位于http://10.16.25.80:4040/pxe/preseed/coolservername.seed

# Language:
d-i debian-installer/language string en
# Country:
d-i debian-installer/country string US
# Detect keyboard layout?
d-i console-setup/ask_detect boolean false
# Country of origin for the keyboard:
d-i keyboard-configuration/layout select English (US)
# Keyboard layout:
d-i keyboard-configuration/variant select English (US)
# Domain name:
d-i netcfg/get_domain string corp.com
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# Configure the application repository mirror
d-i mirror/protocol string http
d-i mirror/country string manual
d-i mirror/http/hostname string 10.16.25.80:4040
d-i mirror/http/directory string /pxe/ubuntu/repository/
#d-i mirror/http/directory string /pxe/ubuntu/12.04/server-amd64/
#d-i mirror/http/directory string /pxe/ubuntu/12.04/alternate-amd64/
d-i mirror/http/proxy string
d-i mirror/suite string precise
# Create a normal user account
d-i passwd/user-fullname string A really cool default user
d-i passwd/username string coolusername
# Normal user's encrypted password (using an MD5 hash)
d-i passwd/user-password-crypted password 12345678901234567890123456789012
# Set to true to encrypt the first user's home directory
d-i user-setup/encrypt-home boolean false
# Only ask the UTC question if there are other operating systems installed.
d-i clock-setup/utc-auto boolean true
# Controls whether or not the hardware clock is set to UTC
d-i clock-setup/utc boolean true
# Time zone setup
d-i time/zone string US/Pacific
# Configure disk storage and partitions
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:   separate /home partition
# - multi:  separate /home, /usr, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# By default the installer requires that repositories be authenticated
# using a known gpg key. This setting can be used to disable that
# authentication. Warning: Insecure, not recommended.
d-i debian-installer/allow_unauthenticated boolean true
# Package selection - run this grep (from existing) to see list of available options
# "grep Task /usr/share/tasksel/ubuntu-tasks.desc"
tasksel tasksel/first multiselect server, standard
# Individual additional packages to install
d-i pkgsel/include string openssh-server
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade select full-upgrade
# Policy for applying updates. May be "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
d-i pkgsel/update-policy select none
# By default, the system's locate database will be updated after the
# installer has finished installing most packages. This may take a while, so
# if you don't want it, you can set this to "false" to turn it off.
d-i pkgsel/updatedb boolean true
# Only install basic language packs. Let tasksel ask about tasks.
d-i pkgsel/language-pack-patterns string
# No language support packages.
d-i pkgsel/install-language-support boolean false
# Verbose output and no boot splash screen.
d-i debian-installer/quiet boolean false
d-i debian-installer/splash boolean false
# This is fairly safe to set, it makes grub install automatically to the MBR
# if no other operating system is detected on the machine.
d-i grub-installer/only_debian boolean true
# This one makes grub-installer install to the MBR if it also finds some other
# OS, which is less safe as it might not be able to boot that other OS.
d-i grub-installer/with_other_os boolean true
# Wait for two seconds in grub
d-i grub-installer/timeout string 2
# This will prevent the installer from ejecting the CD during the reboot.
d-i cdrom-detect/eject boolean false
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# Overwrite the server's network configuration file (/etc/network/interfaces)
d-i preseed/run string coolservername.sh

安装 apt-mirror

sudo apt-get install apt-mirror

/etc/apt/mirror.list

set nthreads     20
set _tilde 0
deb http://us.archive.ubuntu.com/ubuntu precise main main/debian-installer restricted restricted/debian-installer universe universe/debian-installer multiverse multiverse/debian-installer
deb-amd64 http://us.archive.ubuntu.com/ubuntu precise main main/debian-installer restricted restricted/debian-installer universe universe/debian-installer multiverse multiverse/debian-installer
deb-i386 http://us.archive.ubuntu.com/ubuntu precise main main/debian-installer restricted restricted/debian-installer universe universe/debian-installer multiverse multiverse/debian-installer
deb http://us.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu

http://10.16.25.80:4040/pxe/ubuntu/repository是指向“/var/spool/apt-mirror/mirror/us.archive.ubuntu.com/ubuntu/”镜像文件的符号链接。

任何帮助都将不胜感激,帮助解决这些错误并成功帮助重新映像/重建该服务器,因为我花了很多时间调查和搜索,但没有成功......

提前谢谢了!!

相关内容