Run Atlas

Atlas can be started and stopped from the command line.

Start the server

To start Atlas, run the following commands:

  1. $ cd atlas-server (Replace atlas-server with the name of the directory in which you set up Atlas.)
  2. $ ./atlas.sh start
  3. Once Atlas starts, you will see the message Atlas is ready! Go to https://localhost:2999 or to your configured hostname and port.

    • The first time you do this, you may see a browser warning that your connection is insecure. If this happens, it is safe to dismiss the warning and click through to the page.
  4. Log in to Atlas Studio with the username atlas-user and the password you set with the settings command.

When you sign in, you land on the Atlas account dashboard page. On this page, you will see a link to the Atlas instance of Mapbox Studio. You will also see your public Atlas access token, which you can copy and use in your apps.

Note

Although Atlas can be daemonized using systemd, we recommend using the native docker-compose restart policy that ships with Atlas, which we have found does a better job of monitoring individual Atlas services than a generic process manager like systemd does. This will ensure that all services are restarted in the event of failure and on system startup.

Stop the server

To stop Atlas, run the following commands:

  1. $ cd atlas-server (Replace atlas-server with the name of the directory in which you set up Atlas.)
  2. $ ./atlas.sh stop
  3. You will see a confirmation message once the Atlas server has stopped running.

Fix Redis THP and TCP warnings

There are a few system requirements that Redis requires to run efficiently. When you first start Atlas, you may see the following Redis log warnings during startup:

atlas-redis                | 1:C 26 Jun 18:00:13.553 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
atlas-redis                | 1:C 26 Jun 18:00:13.555 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
atlas-redis                | 1:C 26 Jun 18:00:13.555 # Configuration loaded
atlas-redis                | 1:M 26 Jun 18:00:13.556 * Running mode=standalone, port=6379.
atlas-redis                | 1:M 26 Jun 18:00:13.556 # Server initialized
atlas-redis                | 1:M 26 Jun 18:00:13.556 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
atlas-redis                | 1:M 26 Jun 18:00:13.557 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local to retain the setting after a reboot. Redis must be restarted after THP is disabled.
atlas-redis                | 1:M 26 Jun 18:00:13.557 * Ready to accept connections

You need to do these configurations on the Host level.

To mute the overcommit_memory warning message, run the following command:

$ sudo sysctl vm.overcommit_memory=1

To mute the THP warning message, run the following command:

# macOS environment
$ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
$ echo never > /sys/kernel/mm/transparent_hugepage/enabled
# Ctrl+A and Ctrl+D exits the screen

# Linux, Centos environment
$ echo never > /sys/kernel/mm/transparent_hugepage/enabled

Run Atlas behind a reverse proxy

A common configuration is to have Atlas served over HTTP and behind an HTTPS reverse proxy. Because some services within Atlas advertise URIs to the client, you will need to configure Atlas to advertise the correct URI. These environment variables populate those URIs within the services.

  1. Stop Atlas: ./atlas.sh stop
  2. Edit ./config/src/.env.settings
  3. Configure AtlasServerHostName, AtlasServerPort, and AtlasServerProtocol based on your application entry point. For example, https://atlas.us-east-1.elb.amazonaws.com would be configured to:

    AtlasServerHostName=atlas.us-east-1.elb.amazonaws.com
    AtlasServerPort=443
    AtlasServerProtocol=https
    

Atlas will continue to listen internally on the port and protocol specified by AtlasRouterPort and AtlasProtocol.

  1. Run the setup command again to propagate these settings to ./config/dist/: ./atlas.sh setup
  2. Start Atlas: ./atlas.sh start
Was this page helpful?