how can I find out the configuration of a cassandra cluster created using ccm - ccm

I have created two clusters locally using ccm.
.\ccm.py create test -v 3.11.1
.\ccm.py create test2 -v 2.1.2
I can list the different clusters using list argument in ccm but I am unable to find out which argument I should use to check which version of cassardra a cluster is using. Is there any such argument which I can pass to ccm?
I notice that ccm creates a cluster.conf file for each cluster which has the information about the version of cassandra the cluster uses but I am wondering if there is a cli command as well.

Related

Connect PostgreSQL to rabbitMQ

I'm trying to get RabbitMQ to monitor a postgresql database to create a message queue when database rows are updated. The eventual plan is to feed this message queue into an AWS EKS (Elastic Kubernetes Service) cluster as a job.
I've read many many approaches to this but they are still confusing as a newcomer to RabbitMQ and many seemed to be written more than 5 years ago so I'm not sure if they'll still work with current versions of postgres and rabbitmq.
I've followed this guide about installing the area51/notify-rabbit docker container which can connect the two via a node app, but when I ran the docker container it immediately stopped and didn't seem to do anything.
There is also this guide, which uses a go app to connect the two, but I'd rather not use Go ouside of a docker container.
Additionally, there is also this method, to install the pg_amqp extension from a repository which hasn't been updated in years, which allows for a direct connection from PostgreSQL to RabbitMQ. However, when I followed this and attempted to install pg_amqp on my Postgres db (postgresql 12), I was unable to connect using psql to the database, getting the classic error:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
My current set-up, is I have a rabbitMQ server installed in a docker container in an AWS EC2 instance which I can access via the internet. I ran the following to install and run it:
docker pull rabbitmq:3-management
docker run --rm -p 15672:15672 -p 5672:5672 rabbitmq:3-management
The postgresql database is running on a separate EC2 instance and both instances have the required ports open for accessing data from each server.
I have also looked into using Amazon SQS as well for this, but it didn't seem to have any info on linking Postgresql up to it. I haven't really seen any guides or Stack Overflow questions on this since 2017/18 so I'm wondering if this is still the best way to create a message broker for a kubernetes system? Any help/pointers on this much appreciated.
In the end, I decided the best thing to do was create some simple Python scripts to do the LISTEN/NOTIFY steps and route traffic from PostgreSQL to RabbitMQ based off the following code https://gist.github.com/kissgyorgy/beccba1291de962702ea9c237a900c79
I set it up inside Docker containers and set them to run in my Kubernetes cluster so they are within the automatic restarts if they fail.

How to see/install pg_activity for the crunchy data postgres operator?

I have setup an Rancher (RKE) (kuberbetes) for my application.
and application using the postgres so i have setup Crunchydata postgres operator and create postgres cluster using that.
everything fine but now i want to see the pg_activity for my postgresql.
how i can see the activity of whole postgres ?
you use the monitoring tools in rancher to monitor the Postgres.
apart from that you can SSH inside the respective pod of the database and use the cli command and check the output.
In rancher, you can also use the client tool to connect with the rancher and run the cli command to check the pg_activity.
Client docker image : https://hub.docker.com/r/jbergknoff/postgresql-client/
you can also deploy the GUI docker client on rancher and use it
GUI postgress client : https://hub.docker.com/r/dpage/pgadmin4/
GUI Example : https://dataedo.com/kb/query/postgresql/list-database-sessions#:~:text=Using%20pgAdmin,all%20connected%20sessions%20(3).

neo4j local cluster start failed

I am trying to set up a local cluster in neo4j and following this tutorial (https://neo4j.com/docs/operations-manual/current/tutorial/local-causal-cluster/#tutorial-local-cluster-configure-cores). I have downloaded the latest enterprise version 4.1.1 and have followed all the steps mentioned in the tutorial. However I am confused at one step where it is mentioned that we should move to bin directory and run command "neo4j start" . When I run this command it says neo4j service not found so I searched about it and found that I should install neo4j as a service first then the start command will start the service. When I install it the service will run for the core-01 instance, following the tutorial for core-02 and core-03 I am supposed to start neo4j also but again the start command will not work unless I install it.
Following this am I supposed to install 3 different services or it is supposed to be a single service for the whole cluster of 3 instances? If single then the neo4j service will always points to the core-01 instance.
Skipping start command If I run the command neo4j console in the bin directory of 3 instances then I get this error in all three consoles
How I am supposed to handle this?? Am I not setting neo4j service properly or there is some issue in configuration ?

Use jessie (Debian) for Kubernetes cluster

I want to set up gcsFUSE on my cluster. It's easier to do this in Debian jessie according to the gcsFUSE page.
The config-default.sh that kube-up.sh uses contains the following:
NODE_OS_DISTRIBUTION=${KUBE_NODE_OS_DISTRIBUTION:-${KUBE_OS_DISTRIBUTION:-debian}}
which sets up wheezy. What do I change this to to get jessie? I've tried replacing debian with the values debian-8 and jessie, without any luck:
$ cluster/kube-up.sh
Cannot operate on cluster using node os distro: jessie
from reading the cluster/gce/util.sh you can use KUBE_GCE_MASTER_IMAGE / KUBE_GCE_MASTER_PROJECT and KUBE_GCE_NODE_IMAGE / KUBE_GCE_NODE_PROJECT for that purpose.
E.g. with:
KUBE_GCE_MASTER_IMAGE=debian-8-jessie-v20170124
KUBE_GCE_MASTER_PROJECT=debian-8
KUBE_GCE_NODE_IMAGE=debian-8-jessie-v20170124
KUBE_GCE_NODE_PROJECT=debian-8
You can find the relevant images on the with:
gcloud compute images list --filter=debian
These environment variables are used to then create the instances with
gcloud compute instance-templates create ...
The related documentation has some further details.

How to connect to your Cloud SQL instance with a kubernetes service?

I'm creating a container with a connection to a cloudsql database, when I run the image with kubernetes It does not have an external IP that I can use to allow the new image to connect to the database. But as this is part of the init configuration I can't wait to know what is the public IP to add to the whitelist databases.
I know that are ways to connect a database through services in the same cluster, but I can't figure out how to connect with the cloudsql provided by google.
There are two ways to solve that:
The first option is to use a cloudsql proxy using the instructions available in: https://cloud.google.com/sql/docs/sql-proxy
In your docker image you need to ensure that fuse is available in your installation, in wasn't my case (using a ubuntu:trusty-20160119 as base image). If you need to able that, then use the following steps in your Dockerfile:
# install fusermount
# RUN apt-get install build-essential -y
# RUN wget https://github.com/libfuse/libfuse/releases/download/fuse_2_9_5/fuse-2.9.5.tar.gz
# RUN tar -xzvf fuse-2.9.5.tar.gz
# RUN cd fuse-2.9.5 && ./configure && make -j8 && make install
Then at the startup of your container you must create a script that open the socket as described in https://cloud.google.com/sql/docs/sql-proxy#example_proxy_invocations_and_connection_strings.
The second way is just to allow the ips from the nodes that support the kubernetes cluster in the whitelist for the cloudsql.
I prefer the first option, because it works in any machine I deploy the image and I don't need to care about to add or remove ips if I need to deliver more nodes in the kubernetes cluster.