🎄 Happy Holidays! 🥳
Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.
Happy Holidays!
Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.
Docker and Configuration Files (Backup/Restore)
Hi all, Am semi-new to Solace but wanting to ensure it is solid and stable from the start, even during my early testing...
Have successfully deployed Solace within AWS using Autoscaling group (1 of 1) to an EC2 behind a load balancer - all pretty standard server items.
However i am struggling to find how to either launch the Docker using a pre-created configuration.
I believe i can login to the console manually... run the 'backup' command which exports the file to the jail folder. This then can be used to restore my config...
I am looking for an automated method to start the docker using a backed up config (so all queues etc are re-imported in event of failure).
Additionally on top of this, i have seen i can schedule a backup task to run the backup like a crontab task within Solace. Are there any auto methods for say backing upto S3 or will i be better of writing my own script to copy the backup files in the jail folder to s3 ?
Have tested the logic (since asking Q and the logic i am looking to apply works manually):
Log into Solace via 8080, create custom VPN
- docker exec -it <containerid> /usr/sw/loads/currentload/bin/cli -A
- enable
- backup
- exit, exit
- aws s3 cp /mnt/solace/jail/configs/backup s3://<s3bucket>/backup
- <Reboot the server, simulating ec2 crash>
- Ec2 Autostart initialises Docker and runs solace, SSM into EC2:
- aws s3 cp s3://<s3bucket>/backup /mnt/solace/jail/configs/backup
- docker exec -it <containerid> /usr/sw/loads/currentload/bin/cli -A
- enable
- reload config backup.solace (Click Yes)
- exit, exit
- Solace will load backup causing solace to stop the docker
- Relaunch the docker container: docker start solace
Check solace via 8080 and ensure custom VPN present, it was!
Thank you.
Answers
-
Added comment above ^^
0 -
Hi @Stu Shepherd,
there is currently no option to add a base configuration (neither from CLI script nor from binary backup) to a docker startup.
Most users today implement some kind of configuration automation with ansible or terraform (I even saw it with puppet) or with self-created SEMP calls.
Basically, it's all the same: after starting the broker, you just run your code to inject your configuration into that broker.
Uli
1 -
Hi @uherbst , That seems to be all i can find to go on... Could i ask what kind of docker commands can be run externally ? All the ones i see require login to the console before then typing the commands... i.e. Do you know how i can call the 'backup' function from script, outside of the docker?
Thanks in advance :)
0 -
Hi all again, have been looking into SEMP today and struggling to see where the API i can call commands post execute... i.e. backup or reload etc. Any clue on what i am missing? Thank you
0 -
Hi again all, @uherbst ,
Think i have found my solution from another post:
From the command line i can create a sh script to perform the backup:
#!/bin/bash sudo tee /mnt/solace/jail/cliscripts/script-backup.cli <<-EOF enable backup exit exit EOF docker exec -it solace /usr/sw/loads/currentload/bin/cli -A -s script-backup.cli aws s3 cp /mnt/solace/jail/configs/backup s3://<s3bucket>/backup
Question for the solace professionals.. any concerns / downsides to running this bash script?
Thanks
0