Redash tasks#
Create a Redash server#
Configure PostgreSQL and Docker apps in the server’s Pillar file
Configure an external firewall, opening SSH, ICMP, HTTP and HTTPS.
Note
Our Docker Compose file is based on the official setup repository, with these changes:
Use Apache for SSL termination
Update the PostgreSQL version and run it on the host
Update the Redis version and add a health check
Update the Redash version
Dump the old server’s database#
Connect to the old server. For example:
curl --silent --connect-timeout 1 ocp08.open-contracting.org:8255 || true ssh root@ocp08.open-contracting.org
Create the database dump. (If PostgreSQL is running in Docker, you might need to expose its ports first.) For example:
pg_dump -h localhost -U postgres -f redash.sql postgres
Change the database user to
redash
, if necessary. For example:sed -i 's/OWNER TO postgres/OWNER TO redash/g' redash.sql
Disconnect from the old server:
exit
Copy the database dump to your local machine. For example:
rsync -avz root@ocp08.open-contracting.org:~/redash.sql .
Copy the database dump to the new server. For example:
rsync -avz redash.sql root@ocp14.open-contracting.org:~/
Load the new server’s database#
Connect to the new server. For example:
ssh root@ocp14.open-contracting.org
Load the database dump into the
redash
database:sudo -u postgres psql -f redash.sql redash
Change to the non-root user and Redash directory:
su - deployer cd /data/deploy/redash
Start the containers:
docker-compose up -d
Upgrade the Redash service#
Update the
image
in the Docker Compose file to the latest tag. Read the release notes for any other updates to make.Connect to the server:
curl --silent --connect-timeout 1 ocp14.open-contracting.org:8255 || true ssh root@ocp14.open-contracting.org
Change to the non-root user and Redash directory:
su - deployer cd /data/deploy/redash
Pull the images:
docker-compose pull
Stop the Redash containers:
docker-compose stop server scheduler scheduled_worker adhoc_worker worker
Run database migrations, if required:
docker-compose run --rm server manage db upgrade
Start the Redash containers:
docker-compose up -d
Check that the new version is running by viewing the System Status page and reading the Version. You may need to log in to Redash to access this page.
Troubleshoot#
To troubleshoot docker-compose
commands, add the --verbose
option.