溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

如何添加Pool Member

發(fā)布時(shí)間:2021-11-19 15:15:22 來源:億速云 閱讀:191 作者:柒染 欄目:云計(jì)算

這篇文章給大家介紹如何添加Pool Member,內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對(duì)大家能有所幫助。

我們已經(jīng)有了 Load Balance Pool “web servers”和 VIP,接下來需要往 Pool 里添加 member 并學(xué)習(xí)如何使用 cloud image。 先準(zhǔn)備兩個(gè) instance: “Web1” 和 “Web2”。

使用 Ubuntu Cloud Image

由于 cirros 鏡像不能運(yùn)行 HTTP 服務(wù),我們將使用 Ubuntu Cloud Image。
下載地址為 http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img

與以前的 instance 不同,Web1 和 Web2 使用了命名為“cloud”的 Key Pair。
這是因?yàn)?Ubuntu Cloud Image 默認(rèn)用戶 “ubuntu” 的密碼是隨機(jī)生成的,通過 Key Pair 訪問是一個(gè)比較方便的方法。

下面是 Key Pair 的配置方法:

  1. 通過 ssh-keygen 生成 Key Pair。

    其中 cloud.key.pub 是公鑰,需要添加到 instance 的 ~/.ssh/authorized_keys 文件中。 cloud.key 是私鑰,用于訪問 instance。

  2. 將 Pair Key 導(dǎo)入 OpenStack 進(jìn)入 Project -> Compute -> Access & Security 菜單,點(diǎn)擊 Key Pairs 標(biāo)簽頁的 “Import Key Pair” 按鈕。

    復(fù)制 cloud.key.pub 的內(nèi)容。

    粘貼到 Public Key 輸入框中,給 Key Pair 命名為 “cloud”,并點(diǎn)擊 “Import Key Pair”。

    Key Pair “cloud” 成功導(dǎo)入。

  3. 使用 Key Pair “cloud”。 launch instance 的時(shí)候,在 Access & Security 標(biāo)簽頁中選擇 Key Pair “cloud”。 OpenStack 會(huì)自動(dòng)將公鑰添加進(jìn) instance 的  ~/.ssh/authorized_keys 文件。

  4. ssh instance。 用 -i cloud.key 指定私鑰,并以 ubuntu 用戶 ssh “Web1” 和 “Web2”。

    無需密碼直接登錄 instance。
    注:為了便于演示,這里我們是在 router 的 namespace 中執(zhí)行 ssh,主要目的是網(wǎng)絡(luò)可達(dá)。

“Web1” 和 “Web2” 準(zhǔn)備就緒了,可以添加到 Pool 中了。 在 Project -> Network -> Load Balancers 的 Members 標(biāo)簽頁中 點(diǎn)擊 “Add Member” 按鈕。

Pool 選擇 “web servers”。 Member(s) 中多選 “Web1” 和 “Web2”。 Protocol Port 設(shè)置為 “80”。

點(diǎn)擊 “Add”,member 添加成功。

Pool Member 有了,下一節(jié)我們將為 Pool 創(chuàng)建 Monitor,用于 Member 健康檢查。

關(guān)于如何添加Pool Member就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI