canonical / cassandra-k8s-operator

Apache License 2.0
1 stars 4 forks source link

cassandra-k8s deployment is not working with vagrant #47

Closed Vaishalinicky closed 3 years ago

Vaishalinicky commented 3 years ago

official cassandra charm :- https://charmhub.io/cassandra-k8s

We are using command to deploy cassandra on vagrant

 juju deploy cassandra-k8s --channel edge

but after deploying Cassandra ,it is getting stuck in Waiting for Database , please find all the details as listed below.

Pods status

vagrant@microk8s1:~$ microk8s.kubectl get pods -n dev -w
NAME                            READY   STATUS    RESTARTS   AGE
modeloperator-c4c46f7f6-q8rxz   1/1     Running   0          55m
cassandra-k8s-0                 2/2     Running   0          54m

Juju status

Every 2.0s: juju status --color                                                                                           microk8s1: Thu Sep 30 07:31:32 2021

Model  Controller  Cloud/Region        Version  SLA          Timestamp
dev    micro       microk8s/localhost  2.9.11   unsupported  07:31:34Z

App            Version  Status   Scale  Charm          Store     Channel  Rev  OS          Address       Message
cassandra-k8s           waiting      1  cassandra-k8s  charmhub  edge       7  kubernetes  10.152.183.3  installing agent

Unit              Workload     Agent  Address      Ports  Message
cassandra-k8s/0*  maintenance  idle   10.1.222.57         Waiting for Database

Error details :-

unit-cassandra-k8s-0: 07:30:05 ERROR juju.worker.dependency "log-sender" manifold worker returned unexpected error: cannot send log message: write tcp 10.1.222.57:41290->10.152.183.187:17070: write: connection reset by peer
unit-cassandra-k8s-0: 07:30:05 INFO unit.cassandra-k8s/0.juju-log Caught exception <class 'cassandra.cluster.NoHostAvailable'>:('Unable to connect to any servers', {'10.1.222.57:9042': ConnectionRefusedError(111, "Tried connecting to [('10.1.222.57', 9042)]. Last error: Connection refused")}): deferring
unit-cassandra-k8s-0: 07:34:38 ERROR juju.worker.dependency "log-sender" manifold worker returned unexpected error: cannot send log message: write tcp 10.1.222.57:43930->10.152.183.187:17070: write: connection reset by peer

System Info

vagrant@microk8s1:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
vagrant@microk8s1:~$ sudo snap list
Name        Version     Rev    Tracking       Publisher   Notes
charm       2.8.2       609    latest/stable  canonical✓  classic
charmcraft  1.2.1       603    latest/stable  canonical✓  classic
core        16-2.51.7   11743  latest/stable  canonical✓  core
core18      20210722    2128   latest/stable  canonical✓  base
core20      20210702    1081   latest/stable  canonical✓  base
docker      20.10.8     1125   latest/stable  canonical✓  -
jq          1.5+dfsg-1  6      latest/stable  canonical✓  -
juju        2.9.15      17320  latest/stable  canonical✓  classic
lxd         4.18        21497  latest/stable  canonical✓  -
microk8s    v1.21.5     2487   1.21/stable    canonical✓  classic
snapd       2.51.7      13170  latest/stable  canonical✓  snapd
vagrant@microk8s1:~$
dstathis commented 3 years ago

Hello @Vaishalinicky

Currently Cassandra takes quite a while to start up. This is because if the database is not ready, it defers action until the next hook fires. I am working on a rather extensive change that should speed things up a bit, but there will still be some amount of waiting.

If you are concerned that the charm is actually stuck, I would recommend the following debugging: Run microk8s.kubectl exec cassandra-k8s-0 -c cassandra -- ps aux and make sure there is a java process running. If there is, you likely just need to wait. Run microk8s.kubectl logs cassandra-k8s-0 -c cassandra and look for any errors in the logs.

Let me know if this is helpful. If you still have issues, I can help you debug further.