上次我添加机器时,调试工作正常。现在,尝试调试的机器的控制台显示直流电源 IP: 127.0.1.1并且没有 TFTP 地址。自上次正常工作以来我看到的唯一变化是 MaaS 更新至 1.9.5+bzr4599-0ubuntu1~14.04.2(基于软件包的文件日期)。
正如您所料,调试失败,部署也失败
/etc/hosts 不包含命名服务器 IP 127.0.1.1
127.0.0.1 localhost
10.0.1.1 maasCtrl
resolv.conf 中的 base 和 head 也是空的,集群接口页面显示服务器 IP 为 10.0.1.1。
clusterd/conf 条目:
cluster_uuid: <cluster uid>
maas_url: http://10.0.1.1/MAAS
当我启动一种模式时,我在 mass.log 中看到活动,但在 clusterd.log 中没有看到。regiond.log 显示
017-10-27 23:33:23 [-] 127.0.0.1 - - [27/Oct/2017:23:33:23 +0000] "GET /MAAS/rpc/ HTTP/1.1" 200 464 "-" "provisioningserver.rpc.clusterservice.ClusterClientService"
当我告诉机器进行配置时。我记下了 127.0.0.1,但错误是 127.0.1.1。mac 地址的 syslog 显示
Oct 27 23:43:47 MaaSServer dhcpd: DHCPDISCOVER from 08:9e:01:bc:eb:e8 via eth0
Oct 27 23:43:48 MaaSServer dhcpd: DHCPOFFER on 10.0.2.109 to 08:9e:01:bc:eb:e8 via eth0
Oct 27 23:43:50 MaaSServer dhcpd: DHCPREQUEST for 10.0.2.109 (127.0.1.1) from 08:9e:01:bc:eb:e8 via eth0
Oct 27 23:43:50 MaaSServer dhcpd: DHCPACK on 10.0.2.109 to 08:9e:01:bc:eb:e8 via eth0
我查找了有关如何解释 DHCPREQUEST 行以理解 127.0.1.1 的文章,但没有找到任何解决括号部分的文章,而其余部分对我来说似乎很明显。使用 dhcping,我请求一个 IP,结果服务器标识符:127.0.1.1,这似乎表明 dhcp 正在将自己标识为 127.0.1.1
/var/lib/maas/dhcpd.conf 看起来像这样(删除了标题注释)
option arch code 93 = unsigned integer 16; # RFC4578
option path-prefix code 210 = text; #RFC5071
if option arch = 00:0E {
filename "pxelinux.0";
option path-prefix "ppc64el/";
} elsif option arch = 00:07 {
filename "bootx64.efi";
} elsif option arch = 00:0B {
filename "grubaa64.efi";
} elsif option arch = 00:0C {
filename "bootppc64.bin";
} else {
filename "pxelinux.0";
}
class "PXE" {
match if substring (option vendor-class-identifier, 0, 3) = "PXE";
default-lease-time 30;
max-lease-time 30;
}
subnet 10.0.0.0 netmask 255.255.0.0 {
interface "eth0";
ignore-client-uids true;
option subnet-mask 255.255.0.0;
option broadcast-address 10.0.255.255;
option domain-name-servers 10.0.1.1;
option domain-name "maas";
option routers 10.0.1.1;
option ntp-servers 10.0.1.1;
range dynamic-bootp 10.0.1.100 10.0.32.220;
}
omapi-port 7911;
key omapi_key {
algorithm HMAC-MD5;
secret "<deleted>";
};
omapi-key omapi_key;
我看不到 127.0.1.1、系统名称或 localhost
答案1
dhcpd.conf.template 已更改为不再提供“next-server”选项。
dhcpd.conf 没有说明下一个服务器 IP。
我不确定为什么这会导致 dhcpd 将 IP 报告为 127.0.1.1,而不是不提供 IP。
我一般不碰模板文件,所以这肯定是更新的结果。如果有机会,我会使用虚拟机来验证更新是否是导致此问题的原因。
答案附录。下面是dhcpd.conf.template
我拥有的,产生了dhcpd.conf
没有的next-server
。通过添加
next-server {{dhcp_subnet['router_ip']}};
第 25 行之后
option domain-name {{dhcp_subnet['domain_name']}}";
一切恢复正常
# WARNING: Do not edit /var/lib/maas/dhcpd.conf yourself. MAAS will overwrite any
# changes made there.
#
# Instead, edit /etc/maas/templates/dhcp/dhcpd.conf.template and your changes
# will be present whenever MAAS rewrites the DHCP configuration. Update and save
# the cluster's configuration in MAAS to trigger an update to this file.
option arch code 93 = unsigned integer 16; # RFC4578
option path-prefix code 210 = text; #RFC5071
{{bootloader}}
class "PXE" {
match if substring (option vendor-class-identifier, 0, 3) = "PXE";
default-lease-time 30;
max-lease-time 30;
}
{{for dhcp_subnet in dhcp_subnets}}
subnet {{dhcp_subnet['subnet']}} netmask {{dhcp_subnet['subnet_mask']}} {
interface "{{dhcp_subnet['interface']}}";
ignore-client-uids true;
option subnet-mask {{dhcp_subnet['subnet_mask']}};
option broadcast-address {{dhcp_subnet['broadcast_ip']}};
{{if dhcp_subnet.get('dns_servers')}}
option domain-name-servers {{dhcp_subnet['dns_servers']}};
{{endif}}
option domain-name "{{dhcp_subnet['domain_name']}}";
{{if dhcp_subnet['router_ip'] }}
option routers {{dhcp_subnet['router_ip']}};
{{endif}}
{{if dhcp_subnet.get('ntp_server')}}
option ntp-servers {{dhcp_subnet['ntp_server']}};
{{endif}}
range dynamic-bootp {{dhcp_subnet['ip_range_low']}} {{dhcp_subnet['ip_range_high']}};
}
{{endfor}}
omapi-port 7911;
key omapi_key {
algorithm HMAC-MD5;
secret "{{omapi_key}}";
};
omapi-key omapi_key;