Fork me on GitHub

Make mothership instance

First we will use your local pc to starting a Fedora 8 mothership instance on Amazon ec2, and creat an AMI image.

  1. Use the Amazon aws console to start en ami-86db39ef ( amazon/fedora-8-x86_64-v1.14-std ) in zone us-east-1a
  2. Create 15+ gb volume by uing the Amazon command line tools. For example 40 gb
    	ec2-create-volume -s 40 -z us-east-1a
  3. Attach your newly created volume to your instanse
    	ec2-attach-volume vol-a0c985cf -i i-93a448f5 -d /dev/sdh1

Make image

Log into your mothership machine with ssh.

Use a script

You probobly don't want to do this manualy! Insted use the provided script.

  1. Download and run

↓ Then skip down to export image ↓

Manual method

  1. Format your partition(s) and mount them into /mnt. For me that was done with the following:
    mkfs.ext3 /dev/sdh1
    mount /dev/sdh1 /mnt
  2. Make necessary system folders
    mkdir /mnt/dev
    mkdir /mnt/proc
    mkdir /mnt/etc
  3. Make proc system
    mount -t proc none /mnt/proc
  4. Create a base device setup for the new instance:

    for i in console null zero ; do /sbin/MAKEDEV -d /mnt/dev -x $i ; done
  5. Create a base fstab file in /mnt/etc/fstab.
    cat <> /mnt/etc/fstab
    /dev/sda1               /                       ext3    defaults 1 1
    none                    /dev/pts                devpts  gid=5,mode=620 0 0
    none                    /dev/shm                tmpfs   defaults 0 0
    none                    /proc                   proc    defaults 0 0
    none                    /sys                    sysfs   defaults 0 0
    /dev/sdc1               /mnt                    ext3    defaults 0 0
    /dev/sdc2               swap                    swap    defaults 0 0
  6. Use Yum to install the base of Fedora 8 into /mnt
    yum -c --installroot=/mnt -y groupinstall Base
    yum -c --installroot=/mnt -y remove kernel.x86_64
    yum -c --installroot=/mnt -y remove autofs
    yum -c --installroot=/mnt -y remove NetworkManager-glib.x86_64 NetworkManager.x86_64
    yum -c --installroot=/mnt -y remove NetworkManager.i386 NetworkManager-glib.i386
  7. Instal the awskeys deamon
    yum -c --installroot=/mnt -y install awskeys
  8. Instal aws tools
    yum -c --installroot=/mnt -y install ec2-ami-tools
  9. Clean the yum cache
    yum -c --installroot=/mnt -y clean packages
  10. Modify the boot script to randomaise root's password:
    cat <> /mnt/etc/rc.local
    # Randomizing the root password
    if [ -f "/root/firstrun" ] ; then
      dd if=/dev/urandom count=50|md5sum|passwd --stdin root
      rm -f /root/firstrun
      echo "* Firstrun *" && touch /root/firstrun
  11. Set sshd to allow remote root connections and not hang on DNS problems
    cat <> /mnt/etc/ssh/sshd_config
    UseDNS no
    PermitRootLogin without-password
  12. Create the networking scripts
    cat < /mnt/etc/sysconfig/network
  13. Setup eth0
    cat < /mnt/etc/sysconfig/network-scripts/ifcfg-eth0
  14. Setup init startup services
    chroot /mnt chkconfig --level 2345 avahi-daemon off
    chroot /mnt chkconfig --level 2345 network on
    chroot /mnt chkconfig --level 2345 awskeys on
    # haldaemon is not needed, and may take a long time to start
    chroot /mnt chkconfig --level 2345 haldaemon off
    # Dont need printing support
    chroot /mnt chkconfig --level 2345 cups off
    # Don't start Kudzu since for some reason it messes up your network settings on first startup of the image.
    chroot /mnt chkconfig --level 2345 kudzu off
    # Driver/reader for SCard interface and som cryptografic cards
    chroot /mnt chkconfig --level 2345 pcscd off
    # slow to resonde. And not needed because we dont have a console
    chroot /mnt chkconfig --level 2345 ConsoleKit off
    # Mouse sopport
    chroot /mnt chkconfig --level 2345 gpm off
    chroot /mnt chkconfig --level 2345 bluetooth off
  15. Create the missing hostfile
    echo ' localhost.localdomain localhost' > /mnt/etc/hosts
  16. Setop correct modprobe
    mkdir /tmp/ec2-modules
    cd /tmp/ec2-modules
    wget ""
    tar -zxf "ec2-modules-2.6.18-xenU-ec2-v1.2-x86_64.tgz"
    cp -r ./lib/modules/2.6.18-xenU-ec2-v1.2 /mnt/lib/modules/
    rm -f "ec2-modules-2.6.18-xenU-ec2-v1.2-x86_64.tgz"
    rm -rf /tmp/ec2-modules
    cd -
    chroot /mnt depmod -a
  17. Make sure everything is written to disk and unmount the volume.
    umount /mnt/proc
    umount /mnt

Export image

Go back to local pc to export image

  1. Make a snapshot of the volume you just installed to, you will need to volume ID that came from step 1
    ec2-create-snapshot -d "Searchdaimon ES 2.5 build" vol-id
  2. Use the snapshot from the step abow along with the ec2-register command to register your instance
    ec2-register -n "Searchdaimon ES 2.5 build" -d "Searchdaimon Enterprise search appliance. Please see" --block-device-mapping "/dev/sdc=ephemeral0" --architecture x86_64 --kernel aki-e5c1218c --ramdisk ari-e3c1218a --snapshot snap-id

Get it runing

  1. Launch it
  2. ssh into it

Searchdaimon ES software

  1. Install the Searchdaimon ES software


That shuold be it. Start it, and follow the instructions on Run ES on Amazon EC2.

Copyright © Searchdaimon AS. All rights reserved.