Oops! Something went wrong while submitting the form.
We use cookies to improve your browsing experience on our website, to show you personalised content and to analize our website traffic. By browsing our website, you consent to our use of cookies. Read privacy policy.
Why Do We Use External Persistent Storage for Redis Mesos Containers?
Since Redis is an in-memory database, an instance/service restart will result in loss of data. To counter this, it is always advisable to snapshot the Redis in-memory database from time to time.
This helps Redis instance to recover from the point in time failure.
In DCOS, Redis is deployed as a stateless service. To make it a stateful and persistent data, we can configure local volumes or external volumes.
The disadvantage of having a local volume mapped to Mesos containers is when a slave node goes down, your local volume becomes unavailable, and the data loss occurs.
However, with external persistent volumes, as they are available on each node of the DCOS cluster, a slave node failure does not impact the data availability.
Rex-Ray
REX-Ray is an open source, storage management solution designed to support container runtimes such as Docker and Mesos.
REX-Ray enables stateful applications such as databases to persist and maintain its data after the life cycle of the container has ended. Built-in high availability enables orchestrators such as Docker Swarm, Kubernetes, and Mesos Frameworks like Marathon to automatically orchestrate storage tasks between hosts in a cluster.
Built on top of the libStorage framework, REX-Ray's simplified architecture consists of a single binary and runs as a stateless service on every host using a configuration file to orchestrate multiple storage platforms.
Objective: To create a Redis service in DC/OS environment with persistent storage.
Warning: The Persistent Volume feature is still in beta Phase for DC/OS Version 1.11.
Prerequisites:
Make sure the rexray service is running and is in a healthy state for the cluster.
Steps:
Click on the Add button in Services component of DC/OS GUI.
Click on JSON Configuration.
Note: For persistent storage, below code should be added in the normal Redis service configuration JSON file to mount external persistent volumes.
Make sure the service is up and in a running state:
If you look closely, the service was suspended and respawned on a different slave node. We populated the database with dummy data and saved the snapshot in the data directory.
When the service did come upon a different node 10.0.3.204, the data persisted and the volume was visible on the new node.
To connect with Redis service, use below host:port in your applications:
redis.marathon.l4lb.thisdcos.directory:6379
Conclusion
We learned about Standalone Redis Service deployment from DCOS catalog on DCOS. Also, we saw how to add Persistent storage to it using RexRay. We also learned how RexRay automatically manages volumes over AWS ebs and how to integrate them in DCOS apps/services. Finally, we saw how other applications can communicate with this Redis service.
Why Do We Use External Persistent Storage for Redis Mesos Containers?
Since Redis is an in-memory database, an instance/service restart will result in loss of data. To counter this, it is always advisable to snapshot the Redis in-memory database from time to time.
This helps Redis instance to recover from the point in time failure.
In DCOS, Redis is deployed as a stateless service. To make it a stateful and persistent data, we can configure local volumes or external volumes.
The disadvantage of having a local volume mapped to Mesos containers is when a slave node goes down, your local volume becomes unavailable, and the data loss occurs.
However, with external persistent volumes, as they are available on each node of the DCOS cluster, a slave node failure does not impact the data availability.
Rex-Ray
REX-Ray is an open source, storage management solution designed to support container runtimes such as Docker and Mesos.
REX-Ray enables stateful applications such as databases to persist and maintain its data after the life cycle of the container has ended. Built-in high availability enables orchestrators such as Docker Swarm, Kubernetes, and Mesos Frameworks like Marathon to automatically orchestrate storage tasks between hosts in a cluster.
Built on top of the libStorage framework, REX-Ray's simplified architecture consists of a single binary and runs as a stateless service on every host using a configuration file to orchestrate multiple storage platforms.
Objective: To create a Redis service in DC/OS environment with persistent storage.
Warning: The Persistent Volume feature is still in beta Phase for DC/OS Version 1.11.
Prerequisites:
Make sure the rexray service is running and is in a healthy state for the cluster.
Steps:
Click on the Add button in Services component of DC/OS GUI.
Click on JSON Configuration.
Note: For persistent storage, below code should be added in the normal Redis service configuration JSON file to mount external persistent volumes.
Make sure the service is up and in a running state:
If you look closely, the service was suspended and respawned on a different slave node. We populated the database with dummy data and saved the snapshot in the data directory.
When the service did come upon a different node 10.0.3.204, the data persisted and the volume was visible on the new node.
To connect with Redis service, use below host:port in your applications:
redis.marathon.l4lb.thisdcos.directory:6379
Conclusion
We learned about Standalone Redis Service deployment from DCOS catalog on DCOS. Also, we saw how to add Persistent storage to it using RexRay. We also learned how RexRay automatically manages volumes over AWS ebs and how to integrate them in DCOS apps/services. Finally, we saw how other applications can communicate with this Redis service.
Velotio Technologies is an outsourced software product development partner for top technology startups and enterprises. We partner with companies to design, develop, and scale their products. Our work has been featured on TechCrunch, Product Hunt and more.
We have partnered with our customers to built 90+ transformational products in areas of edge computing, customer data platforms, exascale storage, cloud-native platforms, chatbots, clinical trials, healthcare and investment banking.
Since our founding in 2016, our team has completed more than 90 projects with 220+ employees across the following areas:
Building web/mobile applications
Architecting Cloud infrastructure and Data analytics platforms