0

I'm using docker compose to create a docker network, where my Web App and ArangoDB containers are working together. My goal is to restore Arango's data with arangorestore cli-tool, but I need to invoke it from inside my Web App code (from a python code actually - I'm developing with Django framework) where I don't have ArangoDB installed (which means arangorestore command could not be found by bash). How can I make ArangoDB execute arangorestore from another container?

Obviously, I don't want to install arangodb inside my Web App container (that's why i've separated them in the first place, according to official docker's recomendation - 1 service per container). So, i need to somehow connect to ArangoDB container and invoke arangorestore from there. I can imagine doing that over ssh, but it means installing openssh and messing around with keys. May be there are other options for me?

Containers can communicate with each other via port-forwarding, so I thought I could use it, but I don't know how.

I would appreciate if someone could help me.

SOLUTION:

According to Nikita's answer - there is an HTTP API for ArangoDB Enterprise, which allows to restore the backup over an http request. Seems to be the right solution if you care about app's architcture, but it requires proprietary software, so i guess this option is not for all.

5
  • You need to install the ArangoDB client tools in your application container. You don't necessarily need a copy of the database running there, but you do need the arangorestore command available in the application image. There is no way for one container to run a command in another (without either the complexities of the ssh setup you describe or the gaping security issues of exposing the Docker socket to the container). Commented Jun 23, 2023 at 15:18
  • Please provide enough code so others can better understand or reproduce the problem. Commented Jun 23, 2023 at 15:26
  • @DavidMaze okay, I see. But wouldn't it be overloading the whole system having the same installed packages in 2 different containers? Bc that was the main reason why I decided to ask for a better solution in the first place. Commented Jun 23, 2023 at 15:26
  • Imagine installing the database on dedicated hardware (often a good idea in any case). How would you go about initiating your dump from the application, particularly if your system administrators won't give you login access to the server? You must install the client tools alongside your application in this case. The same logic applies to running things in containers. Commented Jun 23, 2023 at 20:46

1 Answer 1

0

If you are using Enterprise edition of ArangoDB, you can try to use HotBackups HTTP API: https://docs.arangodb.com/3.11/develop/http/hot-backups/

It allows to trigger dump and restore remotely, so you just will need to trigger an API from your app. Some drivers already support this API, e.g. go-driver: https://github.com/arangodb/go-driver/blob/master/client_admin_backup.go#L122

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your answer! It seems to be just what I was looking for. Unfortunately, we decided to switch to neo4j instead of ArangoDB, but this approach fits the idea of separating apps and it's dependencies in different docker containers. I will edit my question to mention your answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.