Amazon Elastic Compute Cloud Developer Guide Configure the Installed Operating System You now have a base installation in the image file you've created. The next steps are to configure the installation to operate inside Amazon EC2, and to customize the installation for your use. Configure the Installed Operating System The base operating system has now successfully been installed. You must now configure the networking and hard drives to work in the Amazon EC2 environment. Configure the Network Interface The Amazon EC2 environment provides a networking interface card that needs to be configured to provide external network access for the running instance. Edit (or create) the following file /mnt/ec2-fs/etc/sysconfig/network-scripts/ifcfg-eth0, making sure it contains at least the following information. DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes TYPE=Ethernet USERCTL=yes PEERDNS=yes IPV6INIT=no Note The Amazon EC2 DHCP server ignores hostname requests. If you set DHCP_HOSTNAME the local hostname will be set on the instance but not externally. In addition, this local hostname will be the same for all instances of the AMI, which may prove confusing. Enable Networking After configuring the network interface, you need to ensure that networking will come up when the system is started. To do this, ensure that (at least) the following appears in /mnt/ec2-fs/etc/sysconfig/network. NETWORKING=yes Set up Hard Drives in /etc/fstab Amazon EC2 provides the instance with additional local storage by way of a disk drive on /dev/sda2. In addition, swap space is provided on /dev/sda3. To ensure both these are mounted at system start up time, add the following lines to /mnt/ec2-fs/etc/fstab: /dev/sda2 /mnt ext3 defaults 1 2 /dev/sda3 swap swap defaults 0 0 Configure Additional Services Finally, make sure that all of your required services will be started at system start up time by allocating them to the appropriate system run levels. To enable the service my-service on multi-user and networked run levels, for example, execute: # chroot /mnt/ec2-fs /bin/sh # chkconfig --level 345 my-service on # exit API Version 2007-03-01 9
The new reader is still in beta!
(c) 2013 Tizra. All Rights reserved.
Powered by Tizra® Publisher | Terms of Service | Privacy | Contact Us