You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When starting up tatanka in the docker-compose environment it is unable to successfully run due to the 'tatanka' keyspace not being present when attempting to connect:
$ docker-compose -f ./docker/docker-compose.yml run tatanka
2020/10/23 19:16:26 error: failed to connect to 172.20.0.2:9042 due to error: Keyspace 'tatanka' does not exist
2020/10/23 19:16:26 error: failed to connect to 172.20.0.2:9042 due to error: Keyspace 'tatanka' does not exist
error running program: unable to connect to cassandra cluster: no connections were made when creating the session
This is because the Cassandra container does not have the keyspace and trades table created. We need to have the keyspace and trade table create on startup. This can be circumvented by exec'ing onto the cassandra contain with cqlsh and creating the keyspace and table. i.e.
$ docker exec -it docker_cassandra_1 cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 4.0-beta2 | CQL spec 3.4.5 | Native protocol v4]
Use HELP for help.
cqlsh> CREATE KEYSPACE IF NOT EXISTS tatanka WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 1};
cqlsh> CREATE TABLE tatanka.trades ( id uuid PRIMARY KEY, selector text, trade_id text, price double, size double, time timestamp, side text );
Looking into this is appears that we can use a different docker image to get the keyspace and table to load by mounting a cql scripts into a directory: docker-library/cassandra#104
Or we can probably just manually build an image with cassandra and the keyspace and table loaded.
The text was updated successfully, but these errors were encountered:
When starting up tatanka in the docker-compose environment it is unable to successfully run due to the 'tatanka' keyspace not being present when attempting to connect:
This is because the Cassandra container does not have the keyspace and trades table created. We need to have the keyspace and trade table create on startup. This can be circumvented by exec'ing onto the cassandra contain with cqlsh and creating the keyspace and table. i.e.
Looking into this is appears that we can use a different docker image to get the keyspace and table to load by mounting a cql scripts into a directory: docker-library/cassandra#104
Or we can probably just manually build an image with cassandra and the keyspace and table loaded.
The text was updated successfully, but these errors were encountered: