Overview
This article will review how to deploy Lighthouse in AWS
Deploying an instance to generate a Lighthouse AMI
- Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
- From the console dashboard, click Launch Instance.
- In the Launch an instance wizard you will select the following options
- Name and tags: Supply a name for this instance
- Application and OS Images (Amazon Machine Image)
Search for Amazon Linux 2 AMI and choose the x86 option - Instance type: t2 or t3 large or greater (2vCPU and 8GB RAM or more)
- Key pair: You can generate a new key pair or use an existing key pair for ssh access to the instance
NOTE: Don't select Proceed without a key pair otherwise you will not be able to connect to the instance. - Network settings: Make sure you have ssh access (TCP port 22) for a cli session
- Configure storage: 20GB gp2 EBS volume
- Review the Summary section on the right hand side and select Launch instance
- Go back to view your list of EC2 instances. Once the instance state is ready and status checks have passed you will need to get the IP address of your instance for a ssh session
- Access your instance via ssh as the ec2-user
- Make the following directory to hold the lighthouse files
mkdir -p /lighthouse/
- If your instance has internet access with working DNS you can use the below commands to download the required files.
# Run these from your ec2 instance
If your instance does not have working DNS or internet access, you will need to download the two files to your local machine and transfer them using scp.
curl -kL https://ftp.opengear.com/download/lighthouse_software/current/lighthouse/aws/lighthouse-23.04.0.aws.raw.tar -o /lighthouse/lighthouse-23.04.0.aws.raw.tar
curl -kL https://ftp.opengear.com/download/lighthouse_software/current/lighthouse/aws/lighthouse-aws-bootstrap.sh -o /lighthouse/lighthouse-aws-bootstrap.sh# Run these from your local machine
scp -i "aws_ssh_key" '/local/path/to/lighthouse-23.04.0.aws.raw.tar' ec2-user@1.1.1.1:/tmp/lighthouse-23.04.0.aws.raw.tar
scp -i "aws_ssh_key" '/local/path/to/lighthouse-aws-bootstrap.sh' ec2-user@1.1.1.1:/tmp/lighthouse-aws-bootstrap.sh
# Once this is done, you will need to access your ec2 instance via ssh and move the files
mv /tmp/lighthouse* /lighthouse/ - Run aws configure, supplying access keys that have at a minimum sufficient permissions to create, attach, delete, and snapshot EBS volumes as well as create an Amazon Machine Image (AMI), set the output to json
aws configure
- Change to the lighthouse directory and extract the archive
cd /lighthouse
tar xzvf ./lighthouse-23.04.0.aws.raw.tar - Elevate the session to root
sudo -s
- Run the following lighthouse-aws-bootstrap.sh script with the appropriate parameters to start generating the AMI. This can be run with sh -x to provide verbose output that is helpful if you are experiencing issues with the script. This process will take some time ~10-15min.
./lighthouse-aws-bootstrap.sh -f lighthouse-23.04.0.aws.raw -n 'Name of AMI'
NOTE: The lighthouse-aws-bootstrap.sh is what creates a Lighthouse AMI from the Lighthouse image which was extracted in step 9. This script has the following options:
-f FILENAME Use the specified local file to create the image
-r URI Download the image file from the specified URI
-d DEVICE Attach temporary disk images to the specified device (eg, xvde)
-n NAME The name to use for generated images (default: Lighthouse)
-h Display help message - When complete, you'll have a Lighthouse AMI added to your catalog. By default it will be called Lighthouse. You can now use this AMI to deploy a Lighthouse instance.
- You can terminate this base instance which was used to generate the AMI.
Deploying Lighthouse from your AMI
- From the EC2 dashboard, click Launch Instance.
- In the Launch an instance wizard you will select the following options
- Name and tags: Supply a name for your Lighthouse instance
- Application and OS Images (Amazon Machine Image)
Select My AMIs and choose the Lighthouse AMI - Instance type: t2 or t3 large or greater (minimum of 2vCPU and 8GB RAM)
- Key pair: You can generate a new key pair, use an existing key pair, or proceed with out one. If you proceed with out one, you will need to make sure you set the root user password in step 6.
Network settings: You will need to make sure that Lighthouse has bidirectional traffic on TCP 443 (HTTPS), UDP 1194 (OpenVPN), TCP 22 (SSH, optional) - Configure storage: This should default to a 50GiB gp2 EBS volume
- Advanced Details: Expand this section to add a root password using the userdata field in the format password=desired password goes here. If you are using ssh keys, this is optional, but will immediately allow access to the web UI.
NOTE: You may also specify a custom startup script in this section with script_uri=http://my.domain/my_script.sh. This script will be run once on the first boot. Different user options should be provided on separate lines. - Review the Summary section on the right hand side and select Launch instance
- Go back to view your list of EC2 instances. Once the instance state is ready and status checks have passed you can get the IP address for either HTTPS or SSH access.
- If you did not set the root user password in step 6 for web UI access, you will need to access the instance via ssh and either update the root user password, or make a new user using the following commands
# Update the root user with a strong password
ogpasswd -u root -p 'root user password goes here'# Add a new user with the admin group
ogadduser -u username -g admin -p password
Limitations
- All standard Lighthouse operations
- Running on the AWS platform
- Providing aws-cli tools for interaction with AWS
- Loading the provided SSH key for the root user
- Running custom scripts on startup (see above)
- Providing a root password via userdata (see above)
At this time we do not support:
- Using AWS's database services
- Using AWS's Redis services
- Using any of AWS's scalability functionality
Comments
0 comments
Article is closed for comments.