[DRBD-user] Changing Hostname

Ian Knight ian at 34sp.com
Fri May 16 19:30:55 CEST 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Lars Ellenberg wrote:
> On Fri, May 16, 2008 at 01:06:49PM +0100, Ian Knight wrote:
>   
>> Hi,
>>
>> We have a situation where we need to update the hostname of the machines  
>> that host a drbd system.
>>
>> I thought it would be a matter of update hostname, and then update the  
>> drbd.conf and restart drbd.
>>
>> Sadly this does not seem to be the case, as it seems drbd stores the  
>> hostnames in the meta-data - is there anyway to update this?
>>     
>
> no, it does not.
> what makes you think so?
>
> what does "uname -n" say?
>
>   
Basically i assigned when setting up the server an incorrect hostname - 
so once i noticed this i corrected it, and updated it in the drbd.conf 
but now drbd wont start due to errors:

DOMAIN/IPs replaced for security reasons.

(copied from pastebin done earlier hence the line numbers)

   1.
      [root at master ~]# service drbd status
   2.
      /etc/drbd.conf:43: in resource disk01, on master.CORRECTDOMAIN.com
      { ... } ... on slave.CORRECTDOMAIN.com { ... }:
   3.
              There are multiple host sections for the peer.
   4.
              Maybe misspelled local host name 'master.INCORRECTDOMAIN.com'?
   5.
      /etc/drbd.conf:43: in resource disk01, there is no host section
      for this host.
   6.
              Missing 'on master.INCORRECTDOMAIN.com {...}' ?
   7.
      drbd not loaded
   8.
       

Here is the actual conf file:

   1.
       
   2.
      [root at master ~]# cat /etc/drbd.conf
   3.
      global { usage-count no; }
   4.
       
   5.
      common { syncer { rate 10M; } }
   6.
       
   7.
      resource disk01 {
   8.
       protocol C;
   9.
       
  10.
       handlers {
  11.
        pri-on-incon-degr "echo o > /proc/sysrq-trigger";
  12.
        pri-lost-after-sb "echo o > /proc/sysrq-trigger";
  13.
        local-io-error "echo o > /proc/sysrq-trigger";
  14.
       }
  15.
       
  16.
      startup {
  17.
       degr-wfc-timeout 10;
  18.
       wfc-timeout 3;
  19.
      }
  20.
       
  21.
      syncer {
  22.
       rate 10M;
  23.
      }
  24.
       
  25.
      disk {
  26.
       on-io-error detach;
  27.
      }
  28.
       
  29.
      net {
  30.
       cram-hmac-alg sha1;
  31.
       shared-secret "replicate!";
  32.
       after-sb-0pri disconnect;
  33.
       after-sb-1pri disconnect;
  34.
       after-sb-2pri disconnect;
  35.
       rr-conflict disconnect;
  36.
      }
  37.
       
  38.
        on master.CORRECTDOMAIN.com {
  39.
          device     /dev/drbd0;
  40.
          disk       /dev/sda2;
  41.
          address    1.2.3.4:7788;
  42.
          meta-disk  internal;
  43.
        }
  44.
       
  45.
        on slave.CORRECTDOMAIN.com {
  46.
          device     /dev/drbd0;
  47.
          disk       /dev/hda3;
  48.
          address    1.2.3.5:7788;
  49.
          meta-disk  internal;
  50.
        }
  51.
       
  52.
      }


Uname -n would return the master.CORRECTDOMAIN.com


For the time being i have had to set the hostname back to 
master.INCORRECTDOMAIN.com - but ideally i would like to update it 
properly which means updating the hostname within the meta-data i would 
imagine.

--
Ian



More information about the drbd-user mailing list