Code Monkey home page Code Monkey logo

sharded_cluster_crud_docker's Introduction

Sharded cluster with CRUD: Docker

Running

  1. Run Docker.

  2. Copy the Enterprise SDK archive (tarantool-enterprise-sdk-<version>.tar.gz) to the sdk folder next to Dockerfile.

  3. (Optional) If you use macOS aarch64, set the platform:

    $ export DOCKER_DEFAULT_PLATFORM=linux/amd64
  4. Build the image:

    $ docker build -t my-application .
  5. Execute docker compose up:

    $ docker compose up

    Wait until the cluster is run:

    tarantool-1  |    • Application was successfully built
    tarantool-1  |    • Starting an instance [sharded_cluster_tcm:storage-a-002]...
    tarantool-1  |    • Starting an instance [sharded_cluster_tcm:storage-b-001]...
    tarantool-1  |    • Starting an instance [sharded_cluster_tcm:storage-b-002]...
    tarantool-1  |    • Starting an instance [sharded_cluster_tcm:router-a-001]...
    tarantool-1  |    • Starting an instance [sharded_cluster_tcm:storage-a-001]...

TCM

  1. Open http://0.0.0.0:8080/.

  2. Log in using generated credentials, for example:

    WRN Generated super admin credentials login=admin password=tF1FAurUm5mQhsrmaeHNDUIb0LKvZQAv
    ...
    
  3. Open the router's console and perform the initial cluster bootstrap:

    sharded_cluster_crud:router-a-001> vshard.router.bootstrap()
    ---
    - true
    ...
  4. To insert sample data, call crud.insert_many() on the router:

    crud.insert_many('bands', {
        { 1, box.NULL, 'Roxette', 1986 },
        { 2, box.NULL, 'Scorpions', 1965 },
        { 3, box.NULL, 'Ace of Base', 1987 },
        { 4, box.NULL, 'The Beatles', 1960 },
        { 5, box.NULL, 'Pink Floyd', 1965 },
        { 6, box.NULL, 'The Rolling Stones', 1962 },
        { 7, box.NULL, 'The Doors', 1965 },
        { 8, box.NULL, 'Nirvana', 1987 },
        { 9, box.NULL, 'Led Zeppelin', 1968 },
        { 10, box.NULL, 'Queen', 1970 }
    })

sharded_cluster_crud_docker's People

Contributors

andreyaksenov 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.