Hello,

I’ll soon start an e-commerce website for digital files based on WordPress and EDD and thought the ideal setup would be:

OpenLiteSpeed Wordpress (from the marketplace)
Managed MySQL
Managed Redis
Spaces for the files (~500mb-1gb each on average)

I had some doubts on how recovery would work if there’s a problem with the database however. From what I could find, if I interpret it correctly, the Managed MySQL backs up the database every 5 minutes (and full backup daily), so I should be able to go back to any point in time in 5 minute intervals should there be a problem?

Also, Redis doesn’t seem to have that but I’m not sure if that’s a problem as it should only be used for cache? Are there any steps I should follow if I recover the MySQL to a previous point in time to avoid any problems?

Thank you!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi there @PSNick,

This sounds like a solid setup, I like it! It also gives you the chance to, later on, scale up your webserver to multiple web servers and add a load balancer.

Regarding, the MySQL restore, I would recommend just following the steps from the official documentation on how to do that:

https://www.digitalocean.com/docs/databases/mysql/how-to/restore-from-backups/

Regarding Redis, yes you are absolutely right, as it is only for caching it should be all good.

Regards,
Bobby

  • Thank you for the reply Bobby!

    I’ve tried this setup but am running into an issue with the managed redis DB. LSCache (the bundled plugin with the marketplace droplet) can’t seem to connect to it. I’ve added the host, port, user, password and ensured they’re both on the same VPC but it doesn’t seem to be working.

    • Hi there @PSNick,

      What is the exact error that you are getting?

      Also note that with the managed Redis clusters, you need to use TLS otherwise the connection would fail.

      Regards,
      Bobby

      • Hi Bobby,

        Indeed it looks like redis-cli doesn’t support SSL, this is what I did and it seems to be working now:

        • sudo apt update
        • sudo apt install redis-tools stunnel4

        Then edit the stunnel4 file:

        • sudo nano /etc/default/stunnel4

        Add the following line:

        ENABLED=1
        

        Then edit the stunnel.conf file:

        • sudo nano /etc/stunnel/stunnel.conf

        Add the following lines changing the host and port:

        fips = no
        setuid = nobody
        setgid = nogroup
        pid = /redis/pids/stunnel.pid
        debug = 7
        delay = yes
        [redis-cli]
          client = yes
          accept = 127.0.0.1:8000
          connect = REDIS_HOST:REDIS_PORT
        

        After that run the following commands:

        • sudo mkdir /redis
        • cd /redis
        • sudo mkdir pids
        • sudo chown -R nobody:nogroup pids/
        • sudo systemctl restart stunnel4

        Testing if it worked:

        sudo redis-cli -h localhost -p 8000 -a PASSWORD
        ping
        
        edited by bobbyiliev
Submit an Answer