Differences between revisions 3 and 4
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
    1. Setup RAID disk mirroring      1. Setup RAID disk mirroring
Line 35: Line 35:
    1. Select: ''64-bit (recommended)'' - This is called ''amd64'', with is appropriate for Interl and AMD 64-bit processors      1. Select: ''64-bit (recommended)'' - This is called ''amd64'', with is appropriate for Interl and AMD 64-bit processors
Line 37: Line 37:
    1. See instructions at:      1. See instructions at:
Line 61: Line 61:
 1. Time zone: Accept ''Europe/Zurich''    1. Time zone: Accept ''Europe/Zurich''
Line 94: Line 94:
Setup RAID-1 based mirrored disks Setup RAID-1 based mirrored disks

==
Device Names ==
Line 102: Line 104:
Procedure:

 1. Partition and format hard disks with 'ext4'' filesystems
== Procedure ==

 1. Partition and format hard disks with ''ext4'' filesystems
Line 130: Line 132:


 1. Partition and format
 1. Setup RAID-1 set:
    1. Create mount point:
       {{{
mkdir /v01
       }}}
    1. Create multi-disk array for RAID set:
       {{{
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
       }}}
 1. Show information about the RAID set:
       {{{
  mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Tue Nov 19 16:12:03 2013
     Raid Level : raid1
     Array Size : 1953381248 (1862.89 GiB 2000.26 GB)
  Used Dev Size : 1953381248 (1862.89 GiB 2000.26 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Thu Nov 21 16:48:44 2013
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : odin:0 (local to host odin)
           UUID : 7289ef81:334df27d:389e9383:c225b4f5
         Events : 160

    Number Major Minor RaidDevice State
       0 8 17 0 active sync /dev/sdb1
       1 8 33 1 active sync /dev/sdc1

mdadm --detail --scan
ARRAY /dev/md/0 metadata=1.2 name=odin:0 UUID=7289ef81:334df27d:389e9383:c225b4f5

blkid /dev/md0
/dev/md0: UUID="21f4f1a5-7f60-4f89-986d-84cfd6de49b4" TYPE="ext4"
       }}}
 1. Format the RAID set:
    {{{
mkfs -t ext4 /dev/md0
    }}}
 1. Update ''/etc/mdadm/mdadm.conf'' to contain: (Note use of the ''UUID'', obtained from the '''''mdadm --detail --scan''''' command):
    {{{
# 2 x 2TB mirrored hard drives:
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 UUID=7289ef81:334df27d:389e9383:c225b4f5
    }}}
 1. Update ''/etc/fstab'' to contain: (Note use of the ''UUID'', obtained from the '''''blkid /dev/md0''''' command):
    {{{
# 2 x 2TB mirrod disks
UUID=21f4f1a5-7f60-4f89-986d-84cfd6de49b4 /v01 ext4 defaults 0 2
    }}}
 1. Update ''/etc/initramfs-tools/conf.d/mdadm'' to contain: (This allow the server to reboot when the RAID set is degraded. If this is not set, when the RAID set is degraded, which is the apparently case while the RAID is initially being built, the system will not boot, except through the ''rescue'' menu entry of the systems boot menu).
    {{{
BOOT_DEGRADED=true
    }}}
 1. Test mount and umount the RAID set:
    {{{
mount /v01
df -h
...should list /dev/md0 with the expected disk capacity
umount /v01
    }}}
 1. Reboot system to make sure it boots and that the ''/v01'' file system is present:
    {{{
reboot now
    }}}

= Additional System Configuration =

== NTP Configuration ==

 1. Install NTP daemon
    {{{
apt-get install ntp
    }}}
 1. Edit ''/etc/ntp.conf'' to contain the following:
    {{{
server ntp1.softxs.ch
server ntp2.softxs.ch
server ntp3.softxs.ch
server ntp4.softxs.ch
    }}}
 1. Start NTP daemon:
    {{{
service ntp restart
    }}}
 1. Check damon running and able to connect with time servers: (You should see output like the following):
    {{{
ntpq -p
     remote refid st t when poll reach delay offset jitter
==============================================================================
 caledonia.dataw 129.69.1.153 2 u 7 64 1 19.662 54.345 0.000
 ntp0.as34288.ne .MRS. 1 u 6 64 1 27.857 14.460 0.000
 arthur.testserv 162.23.41.56 2 u 5 64 1 23.029 12.674 0.000
 ms21.snowflakeh 81.94.123.17 2 u 4 64 1 35.802 19.073 0.000
 europium.canoni 193.79.237.14 2 u 3 64 1 40.978 9.453 0.000
    }}}

V2 Server Setup

V2Master

Introduction

  1. A Linux server capable of hosting multiple virtual machines (VMs)
  2. Basic setup performed by hand:
    1. OS installation
    2. Install development tools
    3. Setup RAID disk mirroring
  3. Further provisioning automated by use of Puppet:

    1. VirtualBox and Vagrant installation

    2. Rinetd setup on host system
    3. Reverse proxy gateway in VM
    4. Internal DNS server in VM

Basic Platform

  1. Hardware:
    1. Multi-core Intel architecture with 64-bit processor(s)
    2. 1 x SSD drive for the root, swap and main applications
    3. 2 x identical hard disks for backups
  2. Software:
    1. VirtualBox - Virtualization software

    2. Bagrant - Ruby-based command line front for VirtualBox

    3. Other standard Linux packages (Bind, Apache, MySQL, Rails, etc.) as needed

Operating System Installation

  1. Download Ubuntu 12.04.3 LTS Server

    1. Available from: http://www.ubuntu.com/download/server

    2. Select: 64-bit (recommended) - This is called amd64, with is appropriate for Interl and AMD 64-bit processors

  2. Prepare a bootable memory stick
    1. See instructions at:
      1. On an Ubuntu system: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-ubuntu

Ubuntu Installation

  1. Boot system from memory stick containing Ubuntu 12.04.3 LTS server

  2. Select language: English

  3. Selection option: Install Ubuntu Server

  4. Select system language: English

  5. Select location: other --> Europe --> Switzerland

  6. Select locale: en_US.UTF-8

  7. Configure network:
    1. DHCP configuration will start, enter cancel

    2. Select primary network interface - This question does not appear for systems with a single ethernet port

    3. Select: Configure manually

    4. IP address: enter systems's IP address'

    5. Gate IP address: enter system's gateway address

    6. Nameserver address(es): enter system's primary DNS IP address(es)'

    7. Hostname: enter system's hostname

  8. Create initial user
    1. Full name:
    2. User name:
    3. Enter & re-enter password

    4. Encrypt home directory: no

  9. Time zone: Accept Europe/Zurich

  10. Partition disks:
    1. Select entry for SSD drive
    2. Select Automatically partition and use LVM

    3. Select entire disk
    4. Accept proposed partition and accept writing partition table to disk
  11. Installs base operating system

  12. Enter proxy information: Enter return (e.g. no proxy required)

  13. Software selection: Select SSHD server, and nothing else

  14. Installs and configures more software

  15. Install GRUB boot loader: Yes

  16. Installation complete. Remove memory stick a reboot

Initial Configuration

  1. Login as the user defined during the installation
  2. Set the root password:
    • sudo bash
      passwd
  3. Update system:
    • apt-get update
      apt-get -y dist-upgrade
  4. Install development tools, required for VirtualBox installation

    • apt-get -y install build-essential autoconf libtool pkg-config

Setup Mirrored Disks

Setup RAID-1 based mirrored disks

Device Names

In a typical installation, the SSD and two hard disks have device names assigned as follows:

  1. SSD: /dev/sda

  2. Hard disk 1: /dev/sdb

  3. Hard disk 2: /dev/sdc

Procedure

  1. Partition and format hard disks with ext4 filesystems

    1. Partition: Perform this procedure once for heach hard dick, typically for /dev/sdb and /dev/sdc. Enter the following commands:

      • fdisk /dev/sdb
          p  # Print partition table
          d  # Delete all existing partitions. May need to use this command multiple times
          n  # Create a new partition, accept defaults, which are for a primary partition using all availa disk space
          w  # Write partition table to disk and exit
    2. Example:
      • Command (m for help): p
          ..prints partition table (which will be empty for a new disk)..
        Command (m for help): n
        Partition type:
          p   primary (0 primary, 0 extended, 4 free)
          e   extended
        Select (default p):
        Partition number (1-4, default 1):
        Using default value 1
        
        Command (m for help): w
        The partition table has been altered!
        Calling ioctl() to re-read partition table.
  2. Setup RAID-1 set:
    1. Create mount point:
      • mkdir /v01
    2. Create multi-disk array for RAID set:
      • mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
  3. Show information about the RAID set:
    •   mdadm --detail /dev/md0
      /dev/md0:
              Version : 1.2
        Creation Time : Tue Nov 19 16:12:03 2013
           Raid Level : raid1
           Array Size : 1953381248 (1862.89 GiB 2000.26 GB)
        Used Dev Size : 1953381248 (1862.89 GiB 2000.26 GB)
         Raid Devices : 2
        Total Devices : 2
          Persistence : Superblock is persistent
      
          Update Time : Thu Nov 21 16:48:44 2013
                State : active
       Active Devices : 2
      Working Devices : 2
       Failed Devices : 0
        Spare Devices : 0
      
                 Name : odin:0  (local to host odin)
                 UUID : 7289ef81:334df27d:389e9383:c225b4f5
               Events : 160
      
          Number   Major   Minor   RaidDevice State
             0       8       17        0      active sync   /dev/sdb1
             1       8       33        1      active sync   /dev/sdc1
      
      mdadm --detail --scan
      ARRAY /dev/md/0 metadata=1.2 name=odin:0 UUID=7289ef81:334df27d:389e9383:c225b4f5
      
      blkid /dev/md0
      /dev/md0: UUID="21f4f1a5-7f60-4f89-986d-84cfd6de49b4" TYPE="ext4"
  4. Format the RAID set:
    • mkfs -t ext4 /dev/md0
  5. Update /etc/mdadm/mdadm.conf to contain: (Note use of the UUID, obtained from the mdadm --detail --scan command):

    • # 2 x 2TB mirrored hard drives:
      ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 UUID=7289ef81:334df27d:389e9383:c225b4f5
  6. Update /etc/fstab to contain: (Note use of the UUID, obtained from the blkid /dev/md0 command):

    • # 2 x 2TB mirrod disks
      UUID=21f4f1a5-7f60-4f89-986d-84cfd6de49b4 /v01 ext4 defaults 0 2
  7. Update /etc/initramfs-tools/conf.d/mdadm to contain: (This allow the server to reboot when the RAID set is degraded. If this is not set, when the RAID set is degraded, which is the apparently case while the RAID is initially being built, the system will not boot, except through the rescue menu entry of the systems boot menu).

    • BOOT_DEGRADED=true
  8. Test mount and umount the RAID set:
    • mount /v01
      df -h
      ...should list /dev/md0 with the expected disk capacity
      umount /v01
  9. Reboot system to make sure it boots and that the /v01 file system is present:

    • reboot now

Additional System Configuration

NTP Configuration

  1. Install NTP daemon
    • apt-get install ntp
  2. Edit /etc/ntp.conf to contain the following:

    • server ntp1.softxs.ch
      server ntp2.softxs.ch
      server ntp3.softxs.ch
      server ntp4.softxs.ch
  3. Start NTP daemon:
    • service ntp restart
  4. Check damon running and able to connect with time servers: (You should see output like the following):
    • ntpq -p
           remote           refid      st t when poll reach   delay   offset  jitter
      ==============================================================================
       caledonia.dataw 129.69.1.153     2 u    7   64    1   19.662   54.345   0.000
       ntp0.as34288.ne .MRS.            1 u    6   64    1   27.857   14.460   0.000
       arthur.testserv 162.23.41.56     2 u    5   64    1   23.029   12.674   0.000
       ms21.snowflakeh 81.94.123.17     2 u    4   64    1   35.802   19.073   0.000
       europium.canoni 193.79.237.14    2 u    3   64    1   40.978    9.453   0.000

V2ServerSetup (last edited 2017-05-24 13:11:26 by TiborNagy)

Copyright 2008-2014, SoftXS GmbH, Switzerland