设置 DHCP 服务器 - 无法启动/停止

设置 DHCP 服务器 - 无法启动/停止

我正在关注本指南。我对 Ubuntu 还很陌生,正在使用 14.04 LTS。

当我到达处理 Kerrighed 之前的最后一步(教程进行到一半)时,我尝试启动我的 DHCP 服务器,但失败了。

root@MASTER:~# /etc/init.d/tftpd-hpa restart
root@MASTER:~# /etc/init.d/isc-dhcp-server restart
 * Stopping ISC DHCP server dhcpd                                                 [fail] 
 * Starting ISC DHCP server dhcpd                                                         * check syslog for diagnostics.
                                                                                  [fail]
root@MASTER:~# /etc/init.d/nfs-kernel-server restart
 * Stopping NFS kernel daemon                                                     [ OK ] 
 * Unexporting directories for NFS kernel daemon...                               [ OK ] 
 * Exporting directories for NFS kernel daemon...                                 [ OK ] 
 * Starting NFS kernel daemon                                                     [ OK ] 
root@MASTER:~# 

这是我在 syslog 中输入 dmesg 得到的内容:

[18103.047124] nfsd: last server has exited, flushing export cache
[18104.195774] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[18104.195797] NFSD: starting 90-second grace period (net ffffffff81cda240)
root@MASTER:~# 

和系统日志:

Jul 17 17:16:11 MASTER dhcpd: Wrote 0 deleted host decls to leases file.
Jul 17 17:16:11 MASTER dhcpd: Wrote 0 new dynamic host decls to leases file.
Jul 17 17:16:11 MASTER dhcpd: Wrote 0 leases to leases file.
Jul 17 17:16:11 MASTER dhcpd: 
Jul 17 17:16:11 MASTER dhcpd: No subnet declaration for eth0 (no IPv4 addresses).
Jul 17 17:16:11 MASTER dhcpd: ** Ignoring requests on eth0.  If this is not what
Jul 17 17:16:11 MASTER dhcpd:    you want, please write a subnet declaration
Jul 17 17:16:11 MASTER dhcpd:    in your dhcpd.conf file for the network segment
Jul 17 17:16:11 MASTER dhcpd:    to which interface eth0 is attached. **
Jul 17 17:16:11 MASTER dhcpd: 
Jul 17 17:16:11 MASTER dhcpd: 
Jul 17 17:16:11 MASTER dhcpd: Not configured to listen on any interfaces!
Jul 17 17:16:17 MASTER rpc.mountd[24387]: Caught signal 15, un-registering and exiting.
Jul 17 17:16:17 MASTER kernel: [22896.481789] nfsd: last server has exited, flushing export cache
Jul 17 17:16:19 MASTER kernel: [22897.636160] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Jul 17 17:16:19 MASTER kernel: [22897.636192] NFSD: starting 90-second grace period (net ffffffff81cda240)
Jul 17 17:16:19 MASTER rpc.mountd[24820]: Version 1.2.8 starting

这是 /etc/dhcp/dhcp.config:

# General options
option dhcp-max-message-size 2048;
use-host-decl-names on;
deny unknown-clients; # This will stop any non-node machines from appearing on the cluster network.
deny bootp;

# DNS settings
option domain-name "kerrighed";          # Just an example name - call it whatever you want.
option domain-name-servers 192.168.1.1;  # The server's IP address, manually configured earlier.

# Information about the network setup
subnet 192.168.1.0 netmask 255.255.255.0 {
  option routers 192.168.1.1;              # Server IP as above.
  option broadcast-address 192.168.1.255;  # Broadcast address for your network.
}

# Declaring IP addresses for nodes and PXE info
group {
  filename "pxelinux.0";                 # PXE bootloader. Path is relative to /var/lib/tftpboot
  option root-path "192.168.1.1:/nfsroot/kerrighed";  # Location of the bootable filesystem on NFS server

  host M4500_1 {
        fixed-address 192.168.1.101;          # IP address for the first node, kerrighednode1 for example.
        hardware ethernet XX:XX:XX:XX:XX:XX;  # MAC address of the node's ethernet adapter
  }


  server-name "kerrighedserver"; # Name of the server. Call it whatever you like.
  next-server 192.168.1.1;       # Server IP, as above.
}

(文件中的 MAC 地址是正确的)

这是 etc/network/interfaces :

# The loopback interface:
auto lo
iface lo inet loopback

#auto eth0
# The primary network interface, manually configured to protect NFS:
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0

连接的从属计算机(用于集群)显示PXE-E51 : No DHCP or proxyDHCP offers were received。因此,DHCP 服务器似乎肯定没有运行。当我在终端中重新启动 Tftpd 时,它没有给出任何答案,但 nfs 看起来不错。

答案1

我会检查:

-> /etc/default/isc-dhcp-server 包含 INTERFACES="eth0"?

-> 确保您使用的是 /etc/dhcp3/dhcpd.conf,而不是 /etc/dhcp/dhcp.config(因为您使用的是 isc-dhcp-server)

->将组及其所包含的主机定义到子网{ }声明中

相关内容