2

I am working on the docker environment, and executed docker exec -it mycassandra cqlsh. Then, I am inserting the data, and it is occurring the following error:

WriteTimeout - Error from server: code=1100

By this, it tells me that I need to find out the cassandra.yaml document and amend the write-time, but I can not find that on my MAC.

Could you tell me how can I find it and how to amend the document? Thanks.

Hong
  • 365
  • 4
  • 14

5 Answers5

4

for those who have installed it as brew install cassandra, yaml file will located in usr/local/etc/cassandra

RAVI SINGH
  • 379
  • 2
  • 7
3

If you are running the official cassandra image then cassandra.yaml may be found at /etc/cassandra/cassandra.yaml in the container. If you want to create a custom cassandra.yaml file then you may try to overwrite it in your Dockerfile or docker-compose.yml file. For example, in my docker-compose.yml file I have something like:

services:
  cassandra:
    image: cassandra:3.11.4
    volumes:
    - ./cassandra.yaml:/etc/cassandra/cassandra.yaml

which causes the cassandra.yaml file in the container to be overwritten by my local cassandra.yaml.

I hope this helps.

craigpastro
  • 795
  • 5
  • 14
0

From the provided example, it seems that the database is executed from inside a container. So the cassandra.yaml that you're looking for will be created on the fly when the container is started up, based on the configuration that you provided.

We have set Cassandra Containers with Kubernetes, and execute them in docker, based on the instructions found here, and been able to modify the settings of the cassandra.yaml file in the configuration of the statefulset, updating the variables in env for the spec of the container.

For example, to modify the seeds list, the cluster name, and the rack of the C* cluster named c-test-qa:

apiVersion: apps/v1
kind: StatefulSet
...
spec:
  serviceName: c-test-qa
  replicas: 1
  selector:
    matchLabels:
      app: c-test-qa
  template:
    metadata:
      labels:
        app: c-test-qa
    spec:
      containers:
        - name: c-test-qa
          image: cassandra:3.11
          imagePullPolicy: IfNotPresent
...
          env:
            - name: CASSANDRA_SEEDS
              value: c-test-qa-0.c-test-qa.qa.svc.cluster.local
            - name: CASSANDRA_CLUSTER_NAME
              value: "testqa"
            - name: CASSANDRA_RACK
              value: "DC1"
            - name: CASSANDRA_RACK
              value: "CustomRack1"
...
Carlos Monroy Nieblas
  • 2,225
  • 2
  • 16
  • 27
0

On MacOS :

It will be found in either of the below locations:

  1. Cassandra package installations: /etc/cassandra

  2. Cassandra tarball installations: install_location/conf

  3. DataStax Enterprise package installations: /etc/dse/cassandra

  4. DataStax Enterprise tarball installations: install_location/resources/cassandra/conf

M.K
  • 1,464
  • 2
  • 24
  • 46
  • do we have packages for Mac? ;-) Also the question is about location of file in the Docker image... – Alex Ott Feb 27 '20 at 08:15
0

if you have installed Cassandra from the home-brew then you can find the cassandra.yaml file in the below path.

/opt/homebrew/etc/cassandra

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 11 '23 at 00:34