Documentation: Config details for connecting to external PostgreSQL MongoDB and RabbitMQ Clusters

howto
ha
(Ian) #1

This post is for you if you are using a separate PostgreSQL/RabbitMQ/MongoDB HA Cluster.

I went through some pain getting this to work, and I was asked to make a post to hopefully save the next person some of that pain.

In my build scripts i used crudini to manipulate configuration files.

MongoDB

/etc/st2/st2.conf

sudo crudini --set /etc/st2/st2.conf database host "mongodb://${mongo_node1},${mongo_node1}/?replicaSet=${replica_set}"
sudo crudini --set /etc/st2/st2.conf database port ${monogo_port}
sudo crudini --set /etc/st2/st2.conf database username ${monogo_user}
sudo crudini --set /etc/st2/st2.conf database password ${monogo_user}
sudo crudini --set /etc/st2/st2.conf database db_name ${monogo_db}

RabbitMQ

/etc/st2/st2.conf

crudini --set /etc/st2/st2.conf messaging cluster_urls "amqp://${rabbit_user}:${rabbit_pass}@${rabbit_node1}:5672/,amqp://${rabbit_user}:${rabbit_pass}@${rabbit_node2}:5672/"

/etc/mistral/mistral.conf

sudo crudini --set /etc/mistral/mistral.conf DEFAULT transport_url "rabbit://${rabbit_user}:${rabbit_pass}@${RABBITMQ_LOADBALANCER_ENDPOINT}:5672"

PostgreSQL

/etc/mistral/mistral.conf

sudo crudini --set /etc/mistral/mistral.conf database connection "postgresql+psycopg2://mistral:${postgres_pwd}@${POSTGRES_ENDPOINT}/mistral"

2 Likes