EBS ボリュームを入力する

EBS を使用するようにエラスティック インスタンスを設定する

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

このページは、「EBS を使用するようにエラスティック インスタンスを設定する」の手順を補完するものです。スナップショットで利用するデータに応じて、EBS ボリュームの設定について、さまざまな方法が一覧表示されます。

Uploading Maven 2 repository data

You can upload Maven 2 repository data to your EBS volume, so that it does not have to be downloaded every time an elastic agent (running on an instance which uses the EBS volume) is started.

To populate your EBS snapshot with your Maven repository data, we recommend that you upload it via SCP (see step 5c of the 'Creating your first EBS snapshot' section in Configuring elastic instances to use the EBS). In most cases, you will have a modified settings.xml file if you are using Maven 2. This means that you will need to upload this file and Maven repository data to your EBS volume, rather than populating your volume by running a build.

 

Uploading Ant repository data

You can upload Ant repository data to your EBS volume, so that it does not have to be downloaded every time an elastic agent (running on an instance which uses the EBS volume) is started.

To populate your EBS snapshot with your Ant repository data, we recommend that you run a build on an elastic agent with a blank EBS volume attached to the elastic instance (see step 2 of the 'Updating your EBS snapshot' section in Configuring elastic instances to use the EBS). This is a faster and more reliable method of populating your volume, if you are using Ant.

 

Setting up PostgreSQL for elastic agents

You can upload scripts to your EBS volume so that the elastic agent started on any elastic instances which use this EBS volume, will have PostgreSQL automatically installed.
(info) These elastic instances must be started from an elastic image which is associated with an EBS snapshot derived from this EBS volume.

To set up the automatic installation of PostgreSQL on your EBS volume for elastic agents, you will need to create the following script:

setupPostgreSQL.sh

#!/bin/sh
yum install -y postgresql-server
service postgresql initdb
cat > /var/lib/pgsql/data/pg_hba.conf << EOF
local all all trust
host all all 127.0.0.1/32 trust
EOF
/etc/init.d/postgresql start

This script uses the package management tools provided by Fedora to install and configure PostgreSQL on the agent when its started.

  1. Uses yum to install the PostgreSQL server packages. Details on the yum tool can be found in the Fedora Software Management Guide.
  2. Initializes the PostgreSQL server environment by creating the database directories and default config files.
  3. Creates a new pg_hba.conf file which trusts all local connections and all connections coming from localhost.
  4. Starts PostgreSQL.

You then need to update the customise-extras.sh file on your EBS volume (see Important EBS Directories and Files) to invoke this script.

Finally, you need to add a custom capability (e.g. postgres=true) to the elastic agents with PostgreSQL installed. You can do this by updating the elastic image configuration that the agents inherit their capabilities from. Read Configuring elastic agent capabilities for detailed instructions.

Setting up Selenium on elastic agents

You can upload scripts to your EBS volume so that the elastic agent started on any elastic instances which use the EBS volume, will be able to run Selenium tests.
(info) These elastic instances must be started from an elastic image which is associated with an EBS snapshot derived from this EBS volume.

To set up elastic agents to support Selenium test, you will need to create the following script:

setupSelenium.sh

#!/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-base 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 &

このスクリプトは、Fedora の提供するパッケージ管理ツールを使用して、Mozilla Firefox をインストールし、VNC (仮想ネットワーク コンピューティング)サーバを動作させるのに十分な X をインストールします。

  1. Uses yum to install the following packages. Details on the yum tool can be found in the Fedora Software Management Guide.
    • vnc-server — the vnc server used by the selenium test server.
    • xorg-x11-server-Xvfb xterm xorg-x11-server-utils twm xorg-x11-fonts- — these packages cover the xorg dependencies to get Firefox to run.
  2. The script then copies some prepared VNC authentication files into the bamboo home directory and sets their permissions accordingly. These files are:
    • vncpasswd — this is the password file used by the VNC server (copied to /home/bamboo/.vnc/passwd)
    • vncxstartup — this is the script executed by the VNC server when a connection is made (copied to /home/bamboo/.vnc/xstartup)
  3. The last step of this script is to manually install Firefox into /opt/firefox (we manually install Firefox because the package that would be installed by the Fedora 8 package management appears to be outdated).
    • The tar is extracted to the appropriate directory
    • The .bashrc file is customized to include the Firefox directory when searching for libraries. This is so Firefox will be able to find its libraries.

You then need to update the customise-extras.sh file on your EBS volume (see Important EBS Directories and Files) to invoke this script.

Finally, you need to add a custom capability (e.g. selenium=true) to the elastic agents with PostgreSQL installed. You can do this by updating the elastic image configuration that the agents inherit their capabilities from. Read Configuring elastic agent capabilities for detailed instructions.

最終更新日 2016 年 5 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.