I'm working with liquibase migration tool, it is working fine through terminal (update the table in scylla db).
Now I want to dockerize it, for this I do the following steps:
Create liquibase.properties file:
changeLogFile: changelog.sql
url: jdbc:cassandra://localhost:9041/mykeyspace
driver: com.simba.cassandra.jdbc42.Driver
defaultSchemaName: mykeyspace
My scylladb container is running at port 9041 with keyspace 'mykeyspace'
Create changelog.sql file:
--liquibase formatted sql --changeset liquibase:1 CREATE KEYSPACE IF NOT EXISTS studentkeyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': 3}; --changeset liquibase:2 CREATE TABLE IF NOT EXISTS studentkeyspace.studentData (name text, Id text PRIMARY KEY, email text)
Create docker compose file:
version: '3'
services:
liquibase:
image: liquibase/liquibase:4.1.1
container_name: liquibasecontainer
volumes:
- ./changelogs:/liquibase/changelogs
- ./liquibase.properties:/liquibase/liquibase.properties
- /home/asif/Liquibase/liquibase-4.1.1/lib:/liquibase/lib
command: ["--defaultsFile=/liquibase/liquibase.properties", "update"]
When I run command 'docker-compose -f docker-compose.yml up' It generate an error:
Unexpected error running Liquibase: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:cassandra://localhost:9041/mykeyspace with driver com.simba.cassandra.jdbc42.Driver. [Simba][CassandraJDBCDriver](500150) Error setting/closing connection: All host(s) tried for query failed (tried: localhost/127.0.0.1:9041 (com.simba.cassandra.shaded.datastax.driver.core.exceptions.TransportException: [localhost/127.0.0.1:9041] Cannot connect)).
liquibasecontainer | For more information, please use the --logLevel flag
liquibasecontainer exited with code 255
How can I remove this error ?