Setting up your Bamboo Cloud export while making use of the EC2 Wizard for Bamboo in AWS

Still need help?

The Atlassian Community is here for you.

Ask the community

This knowledge-base article is intended to be a quick cheatsheet to give you an example of the steps needed to get your Bamboo Cloud generated export set-up after using the Bamboo EC2 Wizard to setup a fresh instance. The steps are assuming that you have already used the Bamboo EC2 Wizard to successfully setup an instance.

  1. Transfer your cloud-export.zip from your local machine to the EC2 instance home directory for the ubuntu user using the private key generated in the directory you ran the EC2 Wizard. 

    Remember to replace the EC2 URL in the below commands with the URL of your EC2 instance as supplied by the Wizard.

    $ scp -i bambooserver.pk cloud-export.zip ubuntu@ec2-xx-xxx-xxx-xx.ap-southeast-2.compute.amazonaws.com:~/
  2. SSH into your EC2 instance and switch to the root user.

    $ ssh -i bambooserver.pk ubuntu@ec2-xx-xxx-xxx-xx.ap-southeast-2.compute.amazonaws.com
    $ sudo -s
  3. Unzip the cloud-export.zip into your home directory.

    $ cd ~
    $ apt install unzip
    $ unzip cloud-export.zip
  4. Stop the Bamboo service and monitor until the process comes down gracefully.

    $ service bamboo stop
    $ ps aux | grep bamboo
  5. Clear out existing <bamboo-home> directory contents that the EC2 Wizard setup, since you're then copying the contents of the extracted cloud-export.zip/bamboo-home here. Note the data folder in the path, not the installs folder.

    $ cd /media/atlassian-data/data/bamboo/current
    $ rm -rf *
    $ cp -r ~/bamboo-home/* .
  6. Fix ownership and permissions on newly copied bamboo-home for the user bamboo which runs the service.

    $ chown -R bamboo:bamboo .
  7. Enable password authentication for local PostgreSQL users / connections.

    $ vim /etc/postgresql/9.5/main/pg_hba.conf
    1. Change peer to md5 for local users / connections. It should look like this:

      # "local" is for Unix domain socket connections only
      local   all             all                                     md5

      For more information regarding PostgreSQL authentication methods, see the following documentation: PostgreSQL 9.5 - Authentication Methods

  8. Restart the PostgreSQL service:

    $ service postgresql restart
  9. Switch to the postgres user, open psql, execute SQL to create the Bamboo database user and database before then quitting psql.

    $ su - postgres
    $ psql
    > CREATE USER bamboo WITH PASSWORD 'bamboo';
    > CREATE DATABASE bamboo WITH OWNER bamboo ENCODING 'UTF8';
    > \q

    If you choose a different database password from the default bamboo, you will need to edit the value of <property name="hibernate.connection.password">bamboo</property> in /media/atlassian-data/data/bamboo/current/bamboo.cfg.xml

  10. Exit back to root user and import the database dump from the cloud-export.zip/database that you previously extracted to home.

    $ exit
    $ psql -U bamboo -d bamboo < ~/database/dbDump.dmp
    ### You'll be prompted to enter the database password you set previously here.
  11. Since the EC2 Wizard sets up an Apache reverse proxy in-front of Bamboo, you will need to configure additional proxy attributes on the Tomcat HTTP Connector.

    $ vim /media/atlassian-data/installs/bamboo/current/conf/server.xml
  12. Add the attributes proxyName, proxyPort, scheme and secure to the existing HTTP connector on port 8085. proxyName will need to contain the FQDN that you'll be accessing your Bamboo instance at, the other attributes will likely use the values in the example:

    <Connector
                protocol="HTTP/1.1"
                port="8085"
    
                maxThreads="150" minSpareThreads="25"
                connectionTimeout="20000"
                disableUploadTimeout="true"
                acceptCount="100"
    
                enableLookups="false"
                maxHttpHeaderSize="8192"
    
                useBodyEncodingForURI="true"
                URIEncoding="UTF-8"
    
                redirectPort="8443"
    
                secure="true"
                scheme="https"
                proxyName="ec2-xx-xxx-xxx-xx.ap-southeast-2.compute.amazonaws.com"
                proxyPort="443"
                />
  13. Change the Base URL of your Bamboo instance to the URL you'll be accessing the instance at.

    $ vim /media/atlassian-data/data/bamboo/current/xml-data/configuration/administration.xml 

    Example: 

    <myBaseUrl>https://ec2-xx-xxx-xxx-xx.ap-southeast-2.compute.amazonaws.com</myBaseUrl>
  14. Change the Broker Client URI  to the URI that will be accessible by your remote agents.

    $ vim /media/atlassian-data/data/bamboo/current/bamboo.cfg.xml

    Example:

    <property name="bamboo.jms.broker.client.uri">failover:(tcp://ip-xx-xx-xx-xx.ap-southeast-2.compute.internal:54663?wireFormat.maxInactivityDuration=300000)?maxReconnectAttempts=10&amp;initialReconnectDelay=15000</property>

    If you decide to expose the Broker URI endpoint and port to be publicly accessible, please see this documentation to secure the endpoint with SSL: Securing your Remote Agents

  15. Start the Bamboo service.

    $ service bamboo start

If for some reason you need to re-start the steps after starting Bamboo on the cloud-export.zip/database/dbDump.dmp - it's important to remember that if you re-load the database dump (Step 10), it's critical that you also follow the steps to restore the bamboo-home files from the cloud-export.zip/bamboo-home (Step 5) as well. This directory contains crucial configuration that tells the Bamboo Server instance what to do with a Cloud database. If these tasks aren't run, it can result in Bamboo failing to start or not functioning as expected.

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.