Illustration Image

How do I enable materialized views in Cassandra running in a Docker container?

Please someone help me how to enable materialized view in cassandra docker image. I couldn't see any env variables available to enable it. I am having latest version (greater than 3.x) version which can run Materialized views. I tried below by adding CASSANDRA_MATERIALIZED_VIEWS_ENABLED as env which is not working

Dockercompose.yaml

  cassandra:
    image: cassandra:latest
    container_name: cassandra
    ports:
      - "9042:9042"
    environment:
      - CASSANDRA_USER=cassandra
      - CASSANDRA_PASSWORD=cassandra
      - CASSANDRA_MATERIALIZED_VIEWS_ENABLED=true
    volumes:
      - cassandra_data:/var/lib/cassandra
    healthcheck:
      test: [ "CMD", "cqlsh", "-e", "describe keyspaces" ]
      interval: 30s
      timeout: 10s
      retries: 5

Error

Cassandra detailed error SERVER_INVALID_QUERY: Materialized views are disabled.

Else guide me how better we can run the cassandra in docker with MV's enabled?

Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation. Sponsored by Anant Corporation and Datastax, and Developed by Anant Corporation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?