2. Setup MySQL database server
Each assembly in an Ensembl site is stored in a separate MySQL database. GenomeHubs sites host these databases in a MySQL Docker container.
The EasyMirror container is used to configure users and password in the MySQL container and to mirror Ensembl databases from SQL dumps on the Ensembl/EnsemblGenomes ftp sites, making local copies ready to be hosted alongside newly imported data in a GenomeHubs site.
Create a MySQL container
Create a mysql/data
directory to allow the databases to be stored outside of the MySQL container:
Create a MySQL Docker container to host the Ensembl Databases for your GenomeHub:
See hub.docker.com for more information on the MySQL Docker image.
Docker sets up a default network bridge, but to
simplify connections between containers by using names rather than IP addresses, it is necessary to connect containers to the same named network bridge using
--network genomehubs-network
.MYSQL_ROOT_HOST='172.16.0.0/255.240.0.0'
will allow all other Docker containers on the same machine to connect to the mysql container as root, even if they are on a different Docker network. This is the simplest configuration as it does not matter which of the available subnets the Docker network has been created on, or which IP addresses are assigned to each of the containers. For more security you may wish to check the subnet of your bridge network and/or restrict access to the IP addresses of specific containers.
Log in to MySQL inside the container to increase max_allowed_packet
to allow import of large scaffolds:
Import Ensembl databases
Edit the database.ini
configuration file to set passwords for the database users:
the
DB_ROOT_PASSWORD
should match the value ofMYSQL_ROOT_PASSWORD
in thedocker run
command abovethe
DB_HOST
must match the value of--name
in thedocker run
command aboveto mirror existing Ensembl databases in your GenomeHub, add the appropriate database names to
SPECIES_DBS
as a space-separated list (a corresponding database dump must be available atSPECIES_DB_URL
)even if you do not wish to mirror any existing databases, at least one database must be specified in
SPECIES_DBS
for use as a template when importing new data.
Run the database.sh
script in a genomehubs/easy-mirror
Docker container:
this script will set up database users and import databases into your MySQL container based on the information in the
database.ini
configuration file.
Last updated