This demo uses docker-compose to start two SQL Server containers; one that acts as the publisher and distributor, and the other as the subscriber in a push snapshot configuration.
- Run the following command in this directory:
docker-compose up
note: this will take approx. 2 min.
In your terminal, you should see something like this
db1 | Job 'DB1-Sales-SnapshotRepl-1' started successfully.
db1 | Creating Snapshot...
db1 | Job 'db1-Sales-SnapshotRepl-DB2-1' started successfully.
-
Connect to the subscriber listening on localhost,2600 and see that the Sales Database has a Customer table with data in it. note: credentials are listed in the docker-compose.yml
-
when you are done, clean up by running the following command
docker-compose down
- Both SQL Server containers start with the environment variables specified in the docker-compose file. In this example, db1 is the publisher/distributor and db2 is the subscriber.
- db1/db-init.sh and db2/db-init.sh waits for SQL Server to start up and run the db-init.sql scripts
- db1/db-init.sql creates a Sales Database with Customer table and sample data, and proceeds by setting up snapshot replication.
- db2/db-init.sql creates a Sales Database.
- db1 starts replication jobs to push the snapshot to db2