Skip to main content

Installing a separate Redis server (GCP)

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:

  1. Log in to the Google Cloud Console.

  2. Create a new VM instance with Ubuntu 16.04+ in the same subnet as your CloudM Migrate servers. This is essential for proper communication.

  3. 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:

Bash
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.

Bash
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.

  1. Edit the Redis configuration file:

Bash
sudo nano /etc/redis/redis.conf
  1. Locate the bind configuration line and change it to 0.0.0.0 to allow external connections.

    • From: bind 127.0.0.1

    • To: bind 0.0.0.0

  2. 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.

      Bash
      requirepass 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.

      Bash
      protected-mode no
      
  3. Save and exit the editor by pressing CTRL+X, then Y, and then Enter.

Restart Redis

To apply the changes, restart the Redis service.

Bash
sudo service redis-server restart

If you encounter issues, you can view the logs for troubleshooting:

Bash
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:

Bash
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.

Bash
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.

  1. Edit the Redis configuration file:

Bash
sudo nano /etc/redis/redis.conf
    • Locate the bind configuration line and change it to 0.0.0.0 to 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.

Bash
sudo service redis-server restart

If you encounter issues, you can view the logs for troubleshooting:

Bash
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.

  1. On your primary migration server, disable the local Redis service to prevent conflicts.

  2. Open the CloudM Migrate Service Manager.

  3. In the Redis Server Location field, enter the internal IP address or hostname of the Redis server.

  4. If you set a password, enter it in the Redis Password field.

  5. Click Update Configuration to save the changes.

  6. Restart the CloudM Migrate service to apply the new configuration.

Was this article helpful?
0 out of 0 found this helpful