Page tree
Skip to end of metadata
Go to start of metadata

THIS PAGE IS DUPLICATED ON DRIVE HERE.

This page contains all the information necessary to maintain and support the OEM website as well as confluence

You can view the overview presentation here.

Website & Domain

In January of 2020, the website was moved away from Squarespace to be hosted on Github pages for free. This was done primarily as a cost-savings effort, in turn saving the team $144 per year. The website repository is found on the OEM Github here. It is hosted in the standard way according to Github Pages as outlined here. The custom domain (olineletricmotorsports.com) is purchased and maintained through Google Domains. Just login with the olinformula gmail account credentials and you should be able to manage it. 

Warning:  don't mess with the settings on  Google Domains unless you really know what you're doing!

The domain costs $12+tax per year and expires on December 4th each year. Look out for renewal emails about a month in advance of that date. From the Google Domains dashboard, you have full control over the Domain Name System (DNS) settings including the resource records and registered hosts. This domain is also currently setup to map Confluence's "docs." subdomain to the IP address of the server hosting the service. 

Both the website and domain shouldn't need much maintenance besides updating each year with relevant content. The website is just regular 'ol HTML which pretty much anyone should be able to edit maybe with the help of some Google searches.

Confluence

Architecture

  1. A user navigates to docs.olinelectricmotorsports.com
  2. A DNS lookup reveals our Google Domain record where we route taffic to our server’s IP address, 34.74.96.168.
  3. Traffic hits our server’s IP but gets intercepted by NGINX which listens on ports 80 (HTTP) and 443 (HTTPS). It’s currently configured to reject unencrypted traffic (HTTP), and will automatically redirect to use HTTPS.
  4. NGINX then performs a reverse proxy to our Confluence server running at localhost:8090
  5. Traffic reaches the confluence server!

Important Information

Confluence root: /opt/atlassian/confluence

Confluence home directory: /var/atlassian/application-data/confluence

NGINX root: /etc/nginx

NGIX Config File: /etc/nginx/conf.d/docs.olinelectricmotorsports.com.conf

Setup NGINX

Configure Confluence to run with NGINX

Updating Licensing

Each year the confluence license needs to be renewed. Log into https://my.atlassian.com/products/index and renew the license tilted “Confluence (Server) Unlimited Users: Community License”

Updating Server

At least every year (ideally more like every 1-2 months), the server instance will need to get its packages updated and upgraded. These updates include security fixes, performance upgrades, and such. This does, however require a server restart. The whole process should be done in ~30 minutes.

  1. Connect to the instance
  2. Stop confluence
  3. Stop NGINX
  4. Update packages

    sudo apt update

  5. Upgrade packages

    sudo apt upgrade

  6. Stop server instance from the gCloud console
  7. Restart server instance from the gCloud console
  8. Connect to the instance
  9. Start confluence
  10. Start NGINX

Starting & Stopping Confluence

Sometimes when you attempt to start confluence you might run into a Tomcat Catalina error along the lines of `Existing PID file found during start. Tomcat appears to still be running with PID 1574. Start aborted.` This can be solved by stopping confluence and starting it again. You might have to try this a few times. It seems to be a well known issue with catalina, so there are lots of Stackoverflow articles on it as well.

$ sudo /etc/init.d/confluence start

$ sudo /etc/init.d/confluence stop

$ sudo /etc/init.d/confluence restart

Starting and Stopping NGINX

When you restart Confluence, NGINX will often get confused and will need a restart. Additionally, you’ll need to stop and start NGINX when updating.

sudo systemctl start nginx

sudo systemctl stop nginx

You can check the status of NGINX by running this command. Check for a “Active: active (running)” line near the top of the response.

systemctl status nginx

Troubleshooting Tips

If you are having trouble loading Confluence these tips might help you.

  • 504 NGIX error
    • This means that NGINX is working correctly, however what it has in its registry for the route isn’t returning a valid server call. This could be because confluence is off or has crashed.
  • How can I tell if confluence is working?
    • You can connect to the server instance and can run `curl localhost:8090` and after a few seconds should receive a massive HTML file response. Try to parse this response and see if it looks like the confluence homepage. It it doesn’t, it will probably explain the error. If you get a valid response, but still can’t see confluence from the web, you might have a problem with NGINX. Try restarting NGINX and see if that solves it.



[DEPRECATED] New Confluence Architecture

Deprecated!

We decided not to move forward with moving our Confluence to a local server. These resources can be used if this decision is changed later.

For this new architecture, a server will be built and hosted on the Olin network. It will be independently managed by the team and will just be a linux box with the server running. A few scripts will be created to ensure the server safely shuts down in case of power outages and will automatically start up again when power is regained. It will be on an uninterruptible power supply (UPS) to ensure that this power down process can be carried out safely. 

The process for moving the confluence server will be split into three stages:

Test the environment

  • A trial version of confluence will be installed on a spare Olin laptop which should have pretty similar hardware to the final server.
  • The trial version will not contain any OEM specific install of confluence, but will rather be used to stress test the capabilities of the hardware and the Olin network.
  • An alpha test will take place with ~10 people simultaneously using the trial version to edit a document and find any failure points.
  • If these tests are successful, we will move on.

Test the hardware

  • We will then purchase and build the server hardware.
  • We will once again install a trial version of confluence using this tutorial. This will later be thrown away.
  • We will write and test the necessary scripts for startup and shutdown of the server.
  • We will write the scripts necessary to maintain automated backups of the server to a remote destination using Backblaze.
  • We will simulate power outages and potential failure modes to ensure sufficient coverage has been achieved.
  • Once we are confident in our setup, we will remove the confluence trial using this tutorial.

Complete the move

  • For this stage, the current confluence traffic will need to temporarily halted for about 1 day.
  • The first step will be to dump the current database schema and data using this tutorial.
  • Then the data will need to be transferred from GCP to the new server using this tutorial.
  • Once the data has been transferred, we will test to make sure it was successful.
  • Once deemed a success, the necessary scripts will be started and tested.
  • The server will then be moved to its final location and started.
  • The server will then get assigned a static IP address using this tutorial.
  • An SSH server will be established on the machine using this tutorial.
  • Finally, the subdomain DNS will be updated to reflect the server's IP address. 


Useful Links:

https://confluence.atlassian.com/doc/production-backup-strategy-38797389.html

https://confluence.atlassian.com/doc/migrating-to-another-database-148867.html

https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html 


Useful commands:

https://stackoverflow.com/questions/44982313/how-to-copy-files-from-google-compute-engine-to-local-directory

https://confluence.atlassian.com/doc/database-setup-for-postgresql-173244522.html




  • No labels