centos遠程開機的操作

來源:互聯網
上載者:User

標籤:cte   WAD   level   -o   wakeonlan   linux   port   tis   資訊   

如果我們的伺服器沒有部署在本地(通常都會把伺服器託管到IDC機房),而且伺服器在機房中不止一台,其中一台被關閉時,則我們可以遠端連線一台沒有關機的伺服器上,然後進行遠程開機。

用yum命令安裝遠程開機需要的軟體:yum install wol

如何進行遠程開機?

第一步:首先要確定你的linux伺服器是否支援遠程開機?登入到目標伺服器,用ethtool這個命令列印出網卡的資訊

[[email protected] lhd]# ethtool eth0

Settings for eth0:

Supported ports: [ TP MII ]

Supported link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

Supports auto-negotiation: Yes

Advertised link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

Advertised auto-negotiation: Yes

Speed: 100Mb/s

Duplex: Full

Port: MII

PHYAD: 32

Transceiver: internal

Auto-negotiation: on

Supports Wake-on: pumbg

Wake-on: d

Current message level: 0x00000007 (7)

Link detected: yes

可以看到,ethtool把網卡的資訊全部列出,我們只關心其中的這兩項:

Supports Wake-on: pumbg

Wake-on: d

如果 wake-on 一項值為 d,表示禁用wake on lan

值為 g,表示啟用 wake on lan

因為此機器禁用了 wake on lan,所以用下面的命令來啟用它:

[[email protected] lhd]# ethtool -s eth0 wol g

再用 ethtool命令進行查看,會發現:

Wake-on: g

OK,目標機器的網卡已經支援了遠程開機,下面我們得到它的本地MAC地址:

[[email protected] lhd]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:03:0D:1D:1F:97

inet addr:192.168.6.101 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:34470 errors:0 dropped:0 overruns:0 frame:0

TX packets:35377 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:31559763 (30.0 MiB) TX bytes:5340032 (5.0 MiB)

Interrupt:5 Base address:0x2c00

把HWaddr 00:03:0D:1D:1F:97這一項記錄下來即可,現在你可以試著把目標機器關閉。

第二步:開機

現在我們需要登入到已安裝了wakeonlan軟體的機器上,在上面執行開機命令:

wol 00:03:0D:1D:1F:97

稍後就會發現,目標機器已開機可以登入了。

centos遠程開機的操作

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.