How to set up Moodle worker nodes
Follow these steps to configure a virtual machine scale set, or worker nodes, for Moodle.
Virtual machine scale set instances
A virtual machine scale set instance is assigned a private IP address. You can only access this IP address with a controller virtual machine that is in the same virtual network as the IP address. This article describes how to set up that IP address and then configure the Azure virtual machine scale set that your Moodle migration creates.
Access the virtual machine scale set
Follow these steps to access the virtual machine scale set:
Determine the private IP address that Azure uses for your virtual machine scale set instance:
Sign in to the Azure portal, and locate the resource group that deployment created.
Open the page for the virtual machine scale set resource.
In the left panel, select Instances.
Open the running instance. In the Overview section, copy the private IP address that is associated with that instance.
Enter these commands to sign in to the virtual machine scale set from the controller virtual machine:
sudo -s sudo ssh azureadmin@<private IP address>
In the command,
<private IP address>is the private IP address of the virtual machine scale set. For example, enter:
sudo -s sudo ssh email@example.com.X.X
Create a backup directory
An earlier step of the migration process extracted backup files to a directory named
storage directory contains the
moodledata directories, a configuration directory, and a database backup file. After signing in to your scale set virtual machine instance, enter these commands to create a backup directory for these files:
cd /home/azureadmin/ mkdir -p backup mkdir -p backup/moodle
Configure the PHP and web server
To configure the PHP and web server, take these steps:
Set the PHP version to a variable:
_PHPVER=`/usr/bin/php -r "echo PHP_VERSION;" | /usr/bin/cut -c 1,2,3` echo $_PHPVER
Create a backup of the PHP and web server configurations:
sudo mv /etc/nginx/sites-enabled/*.conf /home/azureadmin/backup/ sudo mv /etc/php/$_PHPVER/fpm/pool.d/www.conf /home/azureadmin/backup/www.conf
Copy the PHP and web server configuration files:
sudo cp /moodle/config/nginx/*.conf /etc/nginx/sites-enabled/ sudo cp /moodle/config/php/www.conf /etc/php/$_PHPVER/fpm/pool.d/
Install missing extensions
Take these steps to install missing extensions:
To obtain a list of PHP extensions that are installed on-premises, enter the following command on an on-premises virtual machine:
Use an Azure Resource Manager template to install the following PHP extensions:
If the on-premises Moodle application has any additional PHP extensions that aren't in the controller virtual machine, install them manually with this command:
sudo apt-get install -y php-<extension name>
Continue to How to follow up after a Moodle migration.