Previous Topic: BFC GlossaryNext Topic: change_host_properties


BFC Hostname and External IP Change Script

Script is attached. This lets you change the BFC's view of the hostname. You have to change the BFC's actual hostname yourself. You can also change the external IP as well, but not the backbone IP.

The following is the process of changing the BFC hostname. The BFC External IP change process is at the bottom.

Pre-change tasks

Change BFC name

  1. Copy aside the /root/.ssh/authorized_keys file as it will probably get wiped out in the process
  2. Copy the attached script to the BFC (I'll use /tmp here as that's the way I went through the process).
  3. I chose to move the replica aside and re-create an empty directory for the replica(/mnt/bfcbackup <-- for example), is the db replica location configured in BFC GUI. You may set your replica directory anywhere but /tmp and /opt)
    mv /mnt/bfcbackup /mnt/bfcbackup.save
    mkdir -m 777 /mnt/bfcbackup
    
  4. Change the permissions of the file to make it executable
    chmod a+x /tmp/change_host_properties
    
  5. Run the script as follows Insert the appropriate hostname if running elsewhere)

    su - bfcadmin -c "/tmp/change_host_properties --hostname=<new BFC name> --uname=<new BFC name>" A customer has to input FQDN name here if he/she need to modify Linux domain name? Yes

  6. You may choose to move /opt/bfc/applogic_versions/* to a temporary local directory to speed up the process of importing the images before uninstalling the BFC in step 7.
  7. Uninstall the BFC

    /opt/bfc/bin/uninstall –f The change_host_properties script updates the DB and creates its own version of the replica to restore from. This is the reason we want to have a previous version of the replica, just in case we want to revert to the original configuration.

  8. Change the hostname of the BFC (first notate the original hostname and uname in case you have to revert back later on)

    hostname sc8-bfc <-- for example

    export HOSTNAME=sc8-bfc

    edit /etc/hosts to make sure sc8-bfc is the first name next to either the loopback address (127.0.0.1) or the external IP

    edit /etc/sysconfig/network and update the hostname entry there as well

    also update any DNS records on your DNS servers as necessary

  9. Open up a separate terminal window and Re-install the BFC:
    /mnt/cdrom/fcinstall.sh -x <path to bfcext.iso>
    

    Do a regular install using the same inputs as when the machine was previously installed, I used 'n' for recover from replica, 'y' for enable replication, '/mnt/bfcbackup' for replica directory (ensuring this mount point is empty or the installation will not proceed past this step), the replica passphrase and the admin password, the backbone ip and the external ip. A customer has to use exact same replica passphrase , admin password, backbone ip and external ip as previous install, is that correct? Yes, as long as the the external IP is not being modified… if it is then we will need to add few more steps to this process.

  10. If you moved the applogic_versions subdirectories aside earlier, move it back at this point (from another window)
  11. Run the script with the --restore option

    su - bfcadmin -c "/tmp/change_host_properties --restore=/tmp/mnesia.backup" It is my understanding is this step is to overwrite the DB replica with DB backup(mnesia.backup) which has new name, right? Yes, this step is restoring from the mnesia backup that the script created in step 5. Once the service is started and the replication kicks off, it will repopulate the replica directory.

  12. Restart the BFC service as noted in the output from above:
    service bfc restart
    
  13. Move the applogic_versions subdirectories aside again
  14. Not quite there yet, now you need to again uninstall the BFC again to pick up the uname change. This time DON'T delete the replica directory as you will be restoring from the new replica that was created during step 11 and 12.
    /opt/bfc/bin/uninstall -f
    
  15. Re-install the BFC but this time use the recover from replica option
    /mnt/cdrom/fcinstall.sh -x <path to bfcext.iso>
    

    Answer 'y' when asked if you want to recover from a replica, and '/mnt/bfcbackup' for the replica directory. Type in the original passphrase when prompted. This step is like a normal recovery from replica. The replica DB that was created back on steps 11 and 12 will be used to recover the BFC on the server and the uname change will be placed within the new DB… the replica will be updated with this as well once the BFC service is fully started and the replication kicks off again.

  16. If you moved the applogic_verssions subdirectories aside earlier, move it back at this point (from another window)
  17. Restore any missing SSH keys that you saved at the start
  18. When the recovery install finishes, log into the Web UI and verify that everything is as expected and that all the users can login. If your users other than admin are unable to login then the passphrase that was entered was not correct.

    I know this seems like quite a few steps in order to change the hostname but if you follow the output from the scripts (as above) you should be OK. If anything goes wrong, you will have the copy of the replica directory to fall back to by stopping the bfc, uninstalling the bfc, changing the hostname and uname back to 'bfc' (or what it was originally) and then re-installing the bfc using the recover from replica directory pointing at your copy.

    BFC hostname and IP change script attached: change_host_properties

    BFC check passphrase script: check_passphrase

BFC External IP Change Process

Pre-change tasks

  1. Notate following BFC configuration

    BFC name

    BFC private/public ip address

    BFC replica passphrase This passphrase is what the LDAP DB is encrypted with. If the customer is unsure of what the passphrase is, they should test this with our check_passphrase script (Attached. Run it as bfcadmin on the BFC. It takes 1 argument, the passphrase, and it will let you know if you guess correctly or incorrectly.) Replication must be enabled and they should store a copy of the replica on their local machine as well as the /tmp or /mnt directory on their server.

    BFC admin password

    BFC installation files

Change BFC External IP

  1. Copy aside the /root/.ssh/authorized_keys file as in pre-3.7 versions it will get wiped out during this process
  2. Change the external IP of the BFC on the physical server (first notate the original IP in case you have to revert back later on)

    Perform steps necessary to update all entries on server of the new External IP address in /etc/hosts, /etc/network-scripts/ifcfg-ethX

    Update any DNS records on your DNS servers as necessary

    Restart networking or reboot server: service network restart

  3. Start the BFC service as it may stop with the network restart
    service bfc start
    
  4. Copy the attached script to the BFC (I'll use /tmp here as that's the way I went through the process).

    Change the permissions of the file to make it executable

    chmod a+x /tmp/change_host_properties

  5. Run the script as follows (Insert the new external/public IP)
    su - bfcadmin -c "/tmp/change_host_properties --ip=<new External IP address>"
    
  6. Stop the BFC service (may have automatically stopped with script):
    service bfc stop
    

    Verify it is completely stopped:

    service bfc status
    
  7. Start the bfc service... give it some time get to running state as it is updating the replica DB.

    Once the BFC is fully up and running, prepare for a recovery from the updated replica.

  8. You may choose to move /opt/bfc/applogic_versions/* to a temporary local directory to speed up the process of importing the images before uninstalling the BFC.
    mv /opt/bfc/applogic_versions /var/
    
  9. service bfc stop - to verify all actions are completed before uninstall
  10. Uninstall the BFC
    /opt/bfc/bin/uninstall -f 
    
  11. Open up a separate terminal window and Re-install the BFC:
    /mnt/cdrom/fcinstall.sh -x <path to bfcext.iso>
    
  12. Recover from replica – y (yes)
  13. Press <enter> on the replica directory as it should retain the original mounted location.

    The original replica passphrase must be used here.

  14. If you moved the applogic_versions subdirectories aside earlier, move it back at this point (quickly from another window)
    mv /var/applogic_versions /opt/bfc/
    
  15. Restore any missing SSH keys that you saved at the start (this seems to be automated in 3.7)
  16. When the recovery install finishes, log into the Web UI and verify that everything is as expected and that all the users can login. If your users other than admin are unable to login then the passphrase that was entered was not correct.

These instructions worked better in our lab tests:

BFC server OS domain name is modified(hostname is unchanged).

<Pre-change tasks>

Notate following BFC configuration. They will be used when reinstall BFC in recovery mode after changing BFC OS domain name. All setting of new BFC must be exact same as the current BFC installation except the BFC OS domain name

It's recommended to put BFC installation ISO image to BFC before going further.

Besides, script change_host_properties and check_passphrase will be used to update BFC and verify DB passphrase in the following process. They will be sent to you when you are ready to modify domain name.

<Change BFC domain name>
  1. Copy the check_passphrase script to the BFC ,e.g, to /tmp, then change the permissions of the file to make it executable
    chmod a+x /tmp/check_passphrase
    
  2. Run script as below to verify BFC DB passphrase is correct.
    su - bfcadmin -c "/tmp/check_passphrase <BFC DB passphrase>"
    
  3. Copy aside the /root/.ssh/authorized_keys file as it will probably get wiped out in the process
  4. Stop BFC DB replica process
    su - bfcadmin -c "/opt/bfc/bin/stop_replication"
    
  5. Save a copy of DB replica directory. You may use tar or cp to achieve it
  6. Copy the change_host_properties script to the BFC ,e.g, to /tmp, then change the permissions of the file to make it executable
    chmod a+x /tmp/change_host_properties
    
  7. Run the script as follows and pass the new FQDN name.
    su - bfcadmin -c "/tmp/change_host_properties --uname=<new FQDN name>" .e.g. new FQDN name can be mybfc.newdomain.com
    
  8. You may choose to move /opt/bfc/applogic_versions/* to a temporary local directory to speed up the process of importing the images before uninstalling the BFC.
  9. Uninstall the BFC
    /opt/bfc/bin/uninstall -f
    
  10. Set new BFC domain name in CentOS OS

    Set new FQDN name in /etc/host,e.g. "<ip> mybfc.newdomain.com mybfc"

    Set HOSTNAME=<new FQDN name> in /etc/sysconfig/network, e.g. "HOSTNAME=mybfc.newdomain.com"

    Execute "hostname --fqdn" and "hostname -i", make sure they finish without error

  11. Re-install the BFC and use the recover from the DB replica.
    /mnt/cdrom/fcinstall.sh -x <path to bfcext.iso>
    

    Answer 'y' when asked if you want to recover from a replica, and <DB replica directory> for the replica directory.Type in the original passphrase when prompted. DB replica directory and passphrase must be exactly same as original BFC.

  12. If you moved the applogic_verssions subdirectories aside earlier, move it back at this point (from another ssh session)
  13. Restore any missing SSH keys that you saved at the start
  14. When the recovery install finishes, log into the Web UI and verify that everything is as expected and that all the users can login. If your users other than admin are unable to login then the passphrase that was entered was not correct.