Coder Social home page Coder Social logo

Create schema about cassandra HOT 4 CLOSED

docker-library avatar docker-library commented on September 29, 2024 11
Create schema

from cassandra.

Comments (4)

shankarshastri avatar shankarshastri commented on September 29, 2024 1

@DavidRG13

cassandra:
    image: cassandra
    ports:
    - "9042:9042"
    - "9160:9160"
    hostname: cassandra
    container_name: cassandra
    volumes:
      - ./random_path/random.cql:/tmp/random.cql
    command: >
            bash -c "((sleep 20s && cqlsh < /tmp/random.cql &) 
            && (/docker-entrypoint.sh cassandra -f)"

I did it like this with docker-compose.yml
In case of normal docker, we may need to wait for cassandra to come up. And once it's up, then you may need to exec into the docker container using

docker cp /random_path/random.cql cassandra:/tmp/random.cql
docker exec -i cassandra bash -c "cqlsh < /tmp/random.cql"

Or you can mount the cql files before as shown above in docker-compose.yml file.
And then run exec commands.

from cassandra.

varadharajan avatar varadharajan commented on September 29, 2024

I came across MySQL entry point file and i would prefer something like that.

from cassandra.

awalterschulze avatar awalterschulze commented on September 29, 2024

We currently use this:
https://gist.github.com/awalterschulze/7732a15b555facdd9399b7f8ed9b88bf
I hope someone else can come up with something better using two phase build to build the populated schema database into the single docker.

from cassandra.

tianon avatar tianon commented on September 29, 2024

Duplicate of #31.

from cassandra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.