Giter VIP home page Giter VIP logo

docker-cqlsh's Introduction

docker-cqlsh

Docker Pulls license

Cqlsh in a container

Some reasons why you might be interested:

  • Run cql files to load data to cassandra when it starts
  • Execute remote commands without exec directly to cassandra

The default CMD command in the image will try to connect to cassandra using default env vars and execute each .cql file found in the container /scripts path.

Prerequisites

In order to run this container you'll need docker installed.

Usage

$ docker run -it nuvo/docker-cqlsh bash

Environment Variables

  • CQLVERSION - The native transport version to use (default: 3.4.4)
  • CQLSH_HOST - Cassandra host (default: cassandra)
  • CQLSH_PORT - Cassandra port (default: 9042)

Examples

Standalone instance

Run a cassandra container and connect to it

$ docker run -d -p 9042:9042 cassandra
$ docker run --rm -it -e CQLSH_HOST=localhost --net=host nuvo/docker-cqlsh bash
bash-4.4$ cqlsh -e "show host;"
Connected to Test Cluster at localhost:9042.
Kubernetes job
apiVersion: batch/v1
king: Job
metadata:
  name: load-cql-files
spec:
  backoffLimit: 5
  activeDeadlineSeconds: 100
  template:
    spec:
      containers:
      - name: cqlsh
        image: nuvo/docker-cqlsh
        env:
        - name: CQLSH_HOST
          value: cassandra-svc
        volumeMounts:
        - mountPath: /scripts
          name: scripts
      volumes:
      - name: scripts
        configMap:
          name: cql-files

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

About cqlsh

cqlsh is a Python-based command-line tool, and the most direct way to run simple CQL commands on a Cassandra cluster. This is a simple re-bundling of the open source tool that comes bundled with Cassandra to allow for cqlsh to be installed and run inside of virtual environments (source)

docker-cqlsh's People

Contributors

hagaibarel avatar

Watchers

 avatar

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.