Updating EBSes created for Fedora to support Amazon Linux

このページの内容

With Bamboo 3.2, we are shipping the new Amazon Linux-based EC2 images by default (along with the old ones to ease the transition period). The Fedora release used up to now was a pretty old distribution, so despite the fact that the distributions have common roots (Fedora: RedHat, AmazonLinux: CentOS/RedHat), some changes are needed.

The idea is to keep the most popular gotchas on this page to keep the transition as smooth as possible.

Ephemeral storage

Ephemeral storage used to be mounted directly on /mnt, which is not a mount point according to FHS. The new mount point for the primary ephemeral storage is /media/ephemeral0 on all instance types. In case you customized your Bamboo working directory location, you should move it there. Changing bamboo-agent.cfg.xml to the following should do the trick.


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configuration>
	<buildWorkingDirectory>/media/ephemeral0/bamboo-working-dir</buildWorkingDirectory>
</configuration>

Grepping your EBS for bamboo-working-dir (or even /mnt) is a very good idea.

Using packages from 3rd party sources

If needed, you should use the packages prepared for CentOS 5.x, which is binary compatible with Amazon Linux . The recipe for doing this is given in the Selenium paragraph.

Oracle

There are two issues with Using Oracle on Amazon Linux: "double tap setup technique" and swap.

Running Oracle Setup

There's a weird bug plaguing yum-based distros that causes the Oracle setup to fail the first time it's run. The solution is simple:


oracleRpm=$LOC/oracle-xe-univ-10.2.0.1-1.0.i386.rpm

yum -y localinstall --nogpgcheck $oracleRpm || yum -y localinstall --nogpgcheck $oracleRpm

Adding swap space

Oracle Express Edition (possibly others) require at least 1GB of swap space, regardless of how much RAM you have. Amazon Linux has ~800 MB swap by default. The easiest way of adding more swap is:


swapFile=/media/ephemeral0/swapfile
dd if=/dev/zero of=${swapFile} bs=1M count=1K && mkswap -f ${swapFile} && chmod 600 ${swapFile} && swapon -p -2 ${swapFile}

You don't need to add 1GB, like in the example - 200MB should be enough.

PostgreSQL

No special instructions. In case you've been using 3rd party RPMs to install a recent version of PostgreSQL, make sure you switch to the one distributed with Amazon Linux.

MySQL

No special instructions. In case you've been using 3rd party RPMs to install a recent version of MySQL, make sure you switch to the one distributed with Amazon Linux.

Selenium

In case you've been using 3rd party RPMs to install a recent version of packages needed for Selenium usage, make sure you switch to the one distributed with Amazon Linux.

Note that Firefox is not distributed with Amazon Linux. To install it, you have to add Centos 5 repositories, which are binary compatible with our Amazon Linux version. Only the packages not distributed with Amazon Linux will be pulled from the CentOS repository.

The complete script used to setup Selenium is given below.


#!/bin/sh

centosMajorVersion=5
centosVersion=${centosMajorVersion}

cat >/etc/yum.repos.d/centos-$centosVersion.repo <<EOF
[centos-base]
name=CentOS - Base
mirrorlist=http://mirrorlist.centos.org/?release=${centosVersion}&arch=\$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-${centosMajorVersion}
enabled=0

[centos-update]
name=CentOS - Updates
mirrorlist=http://mirrorlist.centos.org/?release=${centosVersion}&arch=\$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-${centosMajorVersion}
enabled=0

EOF

yum -y --enablerepo=centos-* install firefox

yum -y install xorg-x11-server-Xvfb xterm xorg-x11-server-utils xorg-x11-fonts-ISO8859-1-75dpi xorg-x11-fonts-Type1

/usr/bin/killall Xvfb

#Start virtual screen
Xvfb :100 -ac -screen 0 1024x768x24 &

echo "export DISPLAY=:100.0" >> /home/bamboo/.bashrc
最終更新日 2016 年 5 月 26 日

この翻訳に満足しましたか?

はい
いいえ
この記事についてのフィードバックを送信する

Not finding the help you need?

コミュニティへの質問

Powered by Confluence and Scroll Viewport.