温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何添加Pool Member

发布时间:2021-11-19 15:15:22 来源:亿速云 阅读:180 作者:柒染 栏目:云计算

这篇文章给大家介绍如何添加Pool Member,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

我们已经有了 Load Balance Pool “web servers”和 VIP,接下来需要往 Pool 里添加 member 并学习如何使用 cloud image。 先准备两个 instance: “Web1” 和 “Web2”。

使用 Ubuntu Cloud Image

由于 cirros 镜像不能运行 HTTP 服务,我们将使用 Ubuntu Cloud Image。
下载地址为 http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img

与以前的 instance 不同,Web1 和 Web2 使用了命名为“cloud”的 Key Pair。
这是因为 Ubuntu Cloud Image 默认用户 “ubuntu” 的密码是随机生成的,通过 Key Pair 访问是一个比较方便的方法。

下面是 Key Pair 的配置方法:

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

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

  2. 将 Pair Key 导入 OpenStack 进入 Project -> Compute -> Access & Security 菜单,点击 Key Pairs 标签页的 “Import Key Pair” 按钮。

    复制 cloud.key.pub 的内容。

    粘贴到 Public Key 输入框中,给 Key Pair 命名为 “cloud”,并点击 “Import Key Pair”。

    Key Pair “cloud” 成功导入。

  3. 使用 Key Pair “cloud”。 launch instance 的时候,在 Access & Security 标签页中选择 Key Pair “cloud”。 OpenStack 会自动将公钥添加进 instance 的  ~/.ssh/authorized_keys 文件。

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

    无需密码直接登录 instance。
    注:为了便于演示,这里我们是在 router 的 namespace 中执行 ssh,主要目的是网络可达。

“Web1” 和 “Web2” 准备就绪了,可以添加到 Pool 中了。 在 Project -> Network -> Load Balancers 的 Members 标签页中 点击 “Add Member” 按钮。

Pool 选择 “web servers”。 Member(s) 中多选 “Web1” 和 “Web2”。 Protocol Port 设置为 “80”。

点击 “Add”,member 添加成功。

Pool Member 有了,下一节我们将为 Pool 创建 Monitor,用于 Member 健康检查。

关于如何添加Pool Member就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI