Storlets 安装

背景

Storlets 的安装(和构建)假定已经存在一个可以与 Keystone 协同工作的 Swift 集群。安装包括以下组件

  1. 一套用于协助 Storlets 管理员的脚本。该管理员代表提供者,负责启用 Storlet 的账户及其镜像管理。这些脚本使用私有 Docker 注册表以及用于维护 Storlet 管理相关状态的指定账户和容器。

  2. 安装在所有代理和对象节点上的 Docker 引擎。

  3. 安装在所有代理和对象节点上的 Swift storlet 中间件和网关。

  4. 一个基本的、启用了 storlets 的 Docker 镜像,添加到私有 Docker 注册表中。

  5. 一个默认账户,已启用 Storlets,并在所有代理和对象节点上部署了默认镜像。该镜像基于基本的、启用了 storlets 的镜像。

安装脚本需要两个输入文件

  1. 一个 ‘hosts’ 文件,描述安装发生的节点。这是一个标准的 Ansible hosts 文件,需要包含以下部分(下面给出了一个示例)。

    1. docker。要安装私有 Docker 注册表的节点

    2. storlet-mgmt。要安装 Storlet 管理脚本的节点

    3. storlet-proxy。Swift 集群代理的列表

    4. storlet-storage。Swift 集群对象服务器的列表

    5. root 或 sudoer 凭据,Ansible 可以使用它来 ssh 连接到机器。在下面的示例中,我们假设所有节点都具有相同的凭据。

  2. 一个 Ansible var 文件,包含各种输入,例如 Keystone IP 和凭据、Storlet 管理账户信息等。该文件位于 install/storlets/common.yml 中,我们将在下面给出需要编辑的条目。

从高层来看,安装包括以下步骤

  1. 在所有节点上安装 Docker。

  2. 在 Swift 的每个节点(代理和存储节点)上安装 storlets 中间件。

  3. 创建一个启用 storlets 的租户(假定 Keystone)。

  4. 为上述租户部署一个默认 Docker 镜像。

  5. 安装一套 storlets 管理脚本。在具有 storlet 管理角色的指定节点上完成。

hosts 文件示例

192.168.33.2 ansible_ssh_user=root ansible_ssh_pass=passw0rd
192.168.33.3 ansible_ssh_user=root ansible_ssh_pass=passw0rd
192.168.33.4 ansible_ssh_user=root ansible_ssh_pass=passw0rd
192.168.33.5 ansible_ssh_user=root ansible_ssh_pass=passw0rd

[docker]
192.168.33.5

[storlet-mgmt]
192.168.33.5

[storlet-proxy]
192.168.33.2

[storlet-storage]
192.168.33.3
192.168.33.4

一些注意事项

  1. 对于“一体化”类型的安装,可以在所有部分中指定 127.0.0.1。

  2. 如果所有主机具有相同的 ssh 用户名和密码,可以使用 ansible 的 group_vars/all

  3. 当前,keystoneclient 应该安装在所有 swift 节点上,但此限制将在未来解决。

  4. 建议代理服务器上的 memcache 服务器可以从存储节点访问。

common.yml

以下是 common.yml 中感兴趣的条目

应特别注意 swift 用户和组 ID。确保它们在所有主机上都相同,并且与 common.yml 文件中定义的内容匹配。条目 ‘storlet_execute_on_proxy_only’ 控制是否仅在代理服务器上调用 storlets,或者也在对象服务器上调用。此选项允许使用 EC 和加密的 storlets。有效值为 true / false

# A cross nodes directory for Storlets internal usage. Must exist with the same name in all proxy and storage nodes.
docker_device: /var/lib/storlets

# A pointer to this repo
storlet_source_dir: <need to point to the repo root>

# Swift Access information. The below IP should be an IP of one of the proxies.
swift_endpoint_host: 127.0.0.1
swift_public_url: http://{{ swift_endpoint_host }}:80/v1

# Keystone access information
keystone_endpoint_host: 127.0.0.1
keystone_admin_url: http://{{ keystone_endpoint_host }}:35357/v3
keystone_public_url: http://{{ keystone_endpoint_host }}/identity/v3
keystone_admin_token: ADMIN
keystone_admin_password: passw0rd

# Information for creating an account for the Storlet manager
storlet_management_account: storlet_management
storlet_management_admin_username: storlet_manager
storlet_manager_admin_password: storlet_manager

# Information for creating a Storlet enabled account
storlets_default_project_name: test
storlets_default_project_user_name: tester
storlets_default_project_user_password: testing

swift_user_id: 1003
swift_group_id: 1003

# middleware and gateway config file constants
storlet_execute_on_proxy_only: false

安装

要执行安装,请按照以下步骤操作

  1. 如上所述创建 hosts 文件

  2. 根据上述内容编辑文件 install/storlets/common.yml

  3. 在仓库的根目录下运行 ‘ant build’

  4. 在 install/storlets 下运行 ‘ansible-playbook -i <hosts 文件> storlet.yml’。如果 hosts 文件具有 sudoer 用户的凭据,则需要运行:‘ansible-playbook -s -i <hosts 文件> storlet.yml’

提示:在运行 playbook 之前,您可能需要“export ANSIBLE_HOST_KEY_CHECKING=False”,以防主机不在 known_hosts 中。注意:用于运行 playbook 的 hosts 文件也由管理员工具用于部署未来的镜像。因此,此文件中保留的 ssh 信息也必须在使用于 storlet-mgmt 节点时适用。