This guide explains how to set up and configure a Redis server on a Google Cloud Platform (GCP) Linux VM. While not required for every migration, using a Redis server is recommended for large-scale or complex migrations to improve performance and stability. The Redis server acts as a centralized cache for migration data, which reduces the load on the primary server.
1. Prerequisites and VM Setup
This guide assumes you have a basic understanding of Google Cloud Platform (GCP) and can set up a virtual machine (VM).
-
Platform: Google Cloud Platform (GCP)
-
Operating System: Ubuntu 16.04+ (not a Pro version)
-
Disk Type: Standard or Balanced disk
-
VM Specifications: The number of CPUs, RAM, and disk size should be based on your migration's scale.
To create the VM instance:
-
Log in to the Google Cloud Console.
-
Create a new VM instance with Ubuntu 16.04+ in the same subnet as your CloudM Migrate servers. This is essential for proper communication.
-
Select a machine type and disk size that can handle the expected load.
Once created, connect to your VM via SSH using a terminal or the GCP console.
2. Install and Configure Redis
After connecting to your VM, you will install and configure the Redis server.
Install Redis
Run the following commands to install Redis on the Ubuntu VM:
sudo apt-get update
sudo apt-get install redis-server
sudo systemctl enable redis-server.service
Verify Installation
To ensure Redis is running, use the redis-cli tool. A successful response will be PONG.
redis-cli ping
PONG
Configure Redis Bindings and Security
By default, Redis runs in protected mode, only allowing connections from the local machine. To allow your CloudM Migrate server to connect, you must either set a password or disable protected mode.
-
Edit the Redis configuration file:
sudo nano /etc/redis/redis.conf
-
Locate the
bindconfiguration line and change it to0.0.0.0to allow external connections.-
From:
bind 127.0.0.1 -
To:
bind 0.0.0.0
-
-
Choose a security option:
-
Option A: Set a password (Recommended) 🔒
Locate the requirepass line, uncomment it, and set a strong password. This is the most secure method and is highly recommended for production environments.
Bashrequirepass your_strong_password -
Option B: Disable protected mode
Locate the protected-mode line and change the value to no. This is an alternative to setting a password, but it is not recommended as it leaves the server vulnerable to unauthenticated connections.
Bashprotected-mode no
-
-
Save and exit the editor by pressing
CTRL+X, thenY, and thenEnter.
Restart Redis
To apply the changes, restart the Redis service.
sudo service redis-server restart
If you encounter issues, you can view the logs for troubleshooting:
sudo tail -f /var/log/redis/redis-server.log
2. Install and Configure Redis
After connecting to your VM, you will install and configure the Redis server.
Install Redis
Run the following commands to install Redis on the Ubuntu VM:
sudo apt-get update
sudo apt-get install redis-server
sudo systemctl enable redis-server.service
Verify Installation
To ensure Redis is running, use the redis-cli tool. A successful response will be PONG.
redis-cli ping
PONG
Configure Redis Bindings and Security
By default, Redis runs in protected mode, only allowing connections from the local machine. To allow your CloudM Migrate server to connect, you must either set a password or disable protected mode.
-
Edit the Redis configuration file:
sudo nano /etc/redis/redis.conf
-
-
Locate the
bindconfiguration line and change it to0.0.0.0to allow external connections.-
From:
bind 127.0.0.1 -
To:
bind 0.0.0.0
-
-
Choose a security option:
-
Option A: Set a password (Recommended) 🔒 Locate the
requirepassline, uncomment it, and set a strong password. This is the most secure method and is highly recommended for production environments.
-
-
sudo service redis-server restart
If you encounter issues, you can view the logs for troubleshooting:
sudo tail -f /var/log/redis/redis-server.log
3. Configure CloudM Migrate
Finally, you must configure your CloudM Migrate installation to use the new Redis server.
-
On your primary migration server, disable the local Redis service to prevent conflicts.
-
Open the CloudM Migrate Service Manager.
-
In the Redis Server Location field, enter the internal IP address or hostname of the Redis server.
-
If you set a password, enter it in the Redis Password field.
-
Click Update Configuration to save the changes.
-
Restart the CloudM Migrate service to apply the new configuration.