Skip to content

Docker

EPSIO PRIVATE PREVIEW

At this time, Epsio running in "standalone docker mode" is only available in private preview.
To get early access, contact us at support@epsio.io

This guide will walk you through the process of deploying Epsio.

Before you begin

Before proceeding with the deployment guide, ensure that you have the following:

  • A Linux/Macbook machine to run epsio on with:
    • Network access to your MySQL instance.
    • docker installed on it
  • A MySQL Database with version 5.7+.

1. Prepare your database for Epsio

Open a connection to your database and follow the steps below.

Create a database for Epsio's metadata:

CREATE DATABASE epsio;

Create a database user for Epsio's exclusive use:

CREATE USER epsio_user IDENTIFIED BY '<password>';

Grant new user permissions to the Epsio database

GRANT ALL PRIVILEGES ON epsio.* TO epsio_user;

Grant replication permissions to the Epsio user

GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO epsio_user;

Grant permission to create result tables and populate existing data

GRANT SELECT, CREATE, SHOW VIEW, CREATE VIEW, ALTER, INSERT, LOCK TABLES, DELETE, DROP ON *.* TO epsio_user;

If you wish to limit access to only specific tables / databases, replace the *.* pattern with the relevant database names and table names you intend on using.


2. Configure Replication

2.1 Check if replication is configured correctly

Run the following command to check if your instance is already configured correctly:

-- Required configuration: ON
SHOW VARIABLES LIKE 'log_bin';

-- Required configuration: ROW
SHOW VARIABLES LIKE 'binlog_format';

-- Required configuration: ON
SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
If all the above are configured correctly, skip to finish the deployment.

2.2 Enable replication

Enable binlog:

Edit your mysql conf file and add the following configurations:

server-id = 223344
log_bin = mysql-bin
binlog_format = ROW
binlog_row_image = FULL
binlog_expire_logs_seconds  = 864000
For the above changes to take effect, you must restart your mysql server.

Enable log_bin_trust_function_creators: Run the following command;

SET PERSIST log_bin_trust_function_creators = 1;

Validate configuration: Verify that all the new configurations are enabled by running the following commands:

-- Required configuration: ON
SHOW VARIABLES LIKE 'log_bin';

-- Required configuration: ROW
SHOW VARIABLES LIKE 'binlog_format';

-- Required configuration: ON
SHOW VARIABLES LIKE 'log_bin_trust_function_creators';

3. Run Epsio docker

Once finished, run the following command to run the standalone Epsio docker.

docker run --name epsio \
  -v <data_directory>:/var/lib/epsio \
  -e ACCOUNT_TOKEN='<ACCOUNT_TOKEN>' \
  -e DB_HOST='<DB_HOST>' \
  -e DB_NAME='<DB_NAME>' \
  -e DB_PASSWORD='<EPSIO_USER_PASSWORD>' \
  -e DB_PORT=<DB_PORT> \
  -e SOURCE_DATABASE_TYPE='mysql' \
   public.ecr.aws/w9q2d1k1/epsio:<EPSIO_VERSION>

Congratulations! You've successfully enabled replication in your database.


You are set to go and can create your first view. Visit the create_view for further details.

Troubleshooting

To troubleshoot, first check the docker logs:

docker logs epsio

If the above don't prove helpful, Run the following commands:

docker exec -it epsio dump-logs -o /tmp/diagnostic_dump
docker cp epsio:/tmp/diagnostic_dump <output file path>

And send the outputed file to Epsio support