Multiple master nodes syncing images



  • I have two standalone fog nodes, each on a different site. I want to automatically sync images from node A to B. What is the best way to do this? Do i need the location plugin for this?

    I understand I have to export/import the Images list.
    I will only be creating images on node A.

    The reason i’m not using a storage node, is cause I want to be able to use fast deploy from both nodes.

    EDIT: i don’t want to have to register my hosts

    Thanks in advance !


  • Moderator

    On your (master) just add the remote FOG server as a storage node (in name only). You will need to add the remote fog server using the management id of fogproject with the management password found in the /opt/fog/.fogsettngs file on the remote FOG server.

    With that said this is a perfect use case of a storage node coupled with the location plugin if you are only concerned about fast deploy. The down side is that all of the remote computers with the fog client on it will have to connect to the master node to get their instructions and you can only capture images to the master node.


  • Senior Developer

    @Baessens In this special case I’d suggest you use basic Linux commands to export/import image definitions and sync the image files to your other node.

    • Optional: Create a sync user account on your main master node - otherwise you’d use the root account to do that but don’t use the fogproject account!
    • Setup SSH keys to be able to login using the sync (or root) account from node B to node A
    • Setup a cron job on your node B to do the DB and file sync
    • Make sure rsync is installed on both nodes.

    Here is just a quick outline of how you might do this (untested!):

    #!/bin/bash
    
    ssh syncuser@nodeA mysqldump -u root -pPassw0rd fog images >/tmp/images.sql
    mysql -u root  -pPassw0rd </tmp/images.sql
    rsync -ave ssh syncuser@nodeA:/images /images >>/var/log/fog/myimagesync.log 2>&1
    

    This will wipe the images table on your node B and import all the definitions you have on node A.


  • Moderator

    @Baessens Yes the storage node concept requires registration first so the target computer knows where to find the image. If you are using the load and go method (i.e. pxe boot and then select deploy image from the iPXE menu) you will need to use multiple normal mode FOG servers just as you outlined.



  • @george1421 As always, thanks for the quick reply. Another reason i don’t want to use a storage node with location plugin, is that I then have to register my host first, before i can deploy an image. Unless this is incorrect?


  • Moderator

    On your (master) just add the remote FOG server as a storage node (in name only). You will need to add the remote fog server using the management id of fogproject with the management password found in the /opt/fog/.fogsettngs file on the remote FOG server.

    With that said this is a perfect use case of a storage node coupled with the location plugin if you are only concerned about fast deploy. The down side is that all of the remote computers with the fog client on it will have to connect to the master node to get their instructions and you can only capture images to the master node.


Log in to reply
 

331
Online

7.4k
Users

14.5k
Topics

136.5k
Posts