• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using MariaDB on NetPi
#11
Quote:For arguments sake, If I were to have a container running on the NetPi with the local MariaDB server, if the NEtPi were to lose power and restart. When the NetPi restarted would this container lose all data in the MariaDB server?

I recommend to read this chapter https://docs.docker.com/v17.09/engine/us...ontainers/

Every container when it is started will be a copy of its image plus a write layer in the layered file system. This is where all file system changes are stored during a containers life. So even if netPI is repowered this layer still exists and once a container is configured to "restart automatially" all your mariadb data will be right there.

But if you would ask me ... is the data still there if I start another container instance then I have to say in this case the data is lost. But there is also a solution in Docker for this problem and are called Volumes. A Volume can be created in Docker and a Volume can be mapped to folders in a container. Supposing you would now create a volume and map it to exactly the folder where the mariadb is storing the database. In this case the the database is not stored in the containers layer but in the volume. If you now start a new container after you deleted the old one and map this volume to your new container the "old" database is still there and used by the new container. So it will survive even new container creations.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Messages In This Thread
Using MariaDB on NetPi - by philump - January-7th-2020, 05:52 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-7th-2020, 07:50 AM
RE: Using MariaDB on NetPi - by philump - January-7th-2020, 10:04 PM
RE: Using MariaDB on NetPi - by Armin@netPI - January-8th-2020, 07:42 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-8th-2020, 07:55 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-8th-2020, 08:06 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-8th-2020, 08:12 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-7th-2020, 08:29 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-7th-2020, 08:46 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-8th-2020, 07:27 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-8th-2020, 08:21 AM
RE: Using MariaDB on NetPi - by philump - January-8th-2020, 11:52 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-8th-2020, 12:14 PM
RE: Using MariaDB on NetPi - by philump - January-8th-2020, 09:41 PM
RE: Using MariaDB on NetPi - by philump - January-9th-2020, 12:01 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-9th-2020, 06:36 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-9th-2020, 06:39 AM
RE: Using MariaDB on NetPi - by philump - January-10th-2020, 07:17 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-10th-2020, 07:51 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-10th-2020, 07:57 AM
RE: Using MariaDB on NetPi - by philump - January-13th-2020, 02:55 AM
RE: Using MariaDB on NetPi - by Armin@netPI - January-13th-2020, 06:47 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)