在此页面上
安装 Contrail 命令
使用此示例安装 Contrail 命令 Docker 容器映像。
Contrail Command 是 Contrail Cloud 和 Contrail Enterprise Multicloud 解决方案的 GUI。它代表了交换矩阵底层、叠加网络和虚拟端点的单一管理接触点,以及云服务的 AppFormix 性能和资源监控应用程序。
Contrail Command 还简化了 OpenStack 集群的配置以及 Contrail 在这些集群中的集成。通过提供工作流来促进与编排器的集成(最初为 OpenStack Kolla 提供支持),Contrail Command 使集成成为一项简单的任务。
将 Contrail 命令与业务流程协调程序集成后,可以使用 Contrail 命令执行典型任务,例如创建叠加网络、创建特定实例、启动工作负载、将工作负载附加到叠加网络,以及设置防火墙权限以控制通信路径。对于这些典型任务,您不必使用编排器的 UI(例如 OpenStack 仪表板)。
通常,您可以使用 Contrail 命令执行自动化工作流程,如下所示:
部署基于 Contrail 和 Kolla 的 OpenStack 集群。
监控和管理底层和物理设备、叠加层和虚拟端点,以及端到端策略和控制。
编排在裸机服务器、虚拟机和容器上运行的工作负载。
发现并管理数据中心 IP 交换矩阵。
大多数工作流都是基于意图的,这意味着您可以在适用的情况下使用模板和向导来配置工作流。
要求
Contrail 命令服务器的系统要求如下:
具有以下特性的虚拟机或物理 x86 服务器:
4 个 vCPU
32 GB 内存
100 GB 磁盘,所有用户存储在“/”分区中(即,删除“/home”分区(如果存在),并增加“/”分区释放的存储量)
与虚拟机或物理服务器(以下称为 Contrail 命令服务器)之间的互联网访问
运行支持您的 Contrail 网络版本的 CentOS 版本。
我们会在 CentOS 7 上定期测试 Contrail 命令,但 Contrail Command 应该可以在其他常见版本的 Linux 上使用。有关 Contrail 网络和编排平台组合支持的 CentOS 版本列表,请参阅 Contrail 网络支持的平台列表。
你可以使用命令安装
yum update
带有更新软件包的 CentOS。连接到管理网络的 IP 接口。Contrail Command 通过此接口管理 Contrail 和 OpenStack 群集。
SSH 访问
访问 hub.juniper.net 注册表。有关详细信息,请参阅 Contrail Registry 19XX 的自述文件访问 。
<container_tag> 有关详细信息,请参阅 Contrail Registry 19XX 的自述文件访问 。
概述
安装
Contrail Command 部署为一对 Docker 容器。您可以通过下载并运行 contrail-command-deployer
映像来安装 Contrail 命令,该映像在其自己的容器中运行,并在 Contrail 命令安装完成后退出。
在开始之前,请设置满足指定要求的 CentOS 7 服务器。 有关受支持平台的列表,请参阅 https://www.juniper.net/documentation/en_US/release-independent/contrail/topics/reference/contrail-supported-platforms.pdf。
此外,从服务器中删除任何已安装的 Python Docker (docker
和 docker-py
) 库。会自动 contrail-command-deployer
安装所有必要的库。如果你使用的是新安装的最小 CentOS 7 服务器,那么这些 Python Docker 库在服务器上尚不存在,你不必采取任何操作。
pip uninstall docker docker-py
如果在未安装 Python Docker 库时发出上述命令,则不会有什么坏处。
程序
分步过程
在 CentOS 7 服务器上执行以下步骤以配置和安装 Contrail 命令。
安装并启动 Docker 引擎。以下一组命令添加 Docker 存储库,并以安装和启动 Docker 社区版版本 18.06 为例。
yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo yum install -y docker-ce-18.06.0.ce systemctl start docker
从 hub.juniper.net 中提取
contrail-command-deployer
Docker 映像。有关如何获取访问安全 hub.juniper.net 注册表的凭据以及要使用的容器标记的名称的信息,请参阅自述文件 Contrail Registry 19XX。
登录到 hub.juniper.net 注册表。
docker login hub.juniper.net \ --username <container_registry_username> \ --password <container_registry_password>
检索
contrail-command-deployer
Docker 映像。docker pull hub.juniper.net/contrail/contrail-command-deployer:<container_tag>
其中<container_tag>,是要安装的版本 Contrail 命令 (UI) 容器部署的容器标记。请参阅自述文件访问 Contrail Registry 19XX,以获取任何 Contrail 网络版本 19 软件的 。<container_tag>
创建 command_servers.yml 配置文件。
command_servers.yml 文件包含计划在其中安装 Contrail 命令的服务器的信息,以及容器注册表和其他配置参数的信息。Contrail 命令在单个服务器上运行,通常是运行 的
contrail-command-deployer
同一服务器(即此过程中使用的服务器)。运行
contrail-command-deployer
时,它会读取并处理 command_servers.yml 文件。此文件的示例显示在 #sample-command-servers__sample-command-servers-51 和 #sample-command-servers__sample-command-servers-50 中。注意:如果要部署 AppFormix,请在文件中添加
command_servers.yml
以下两行。它们必须放置在 “command_servers
” 层次结构之外,要么紧跟在文件最顶部的 “---
” 之后,要么放在文件最底部的最后两行。下面显示了一个示例,其中将两行添加到文件顶部:--- user_command_volumes: - /opt/software/appformix:/opt/software/appformix command_servers: server1: ip:
contrail-command-deployer
运行容器以部署 Contrail 命令。要执行全新安装,请执行以下操作:
docker run -td --net host -v \ <ABSOLUTE_PATH_TO_command_servers.yml_FILE>:/command_servers.yml \ --privileged \ --name contrail_command_deployer \ hub.juniper.net/contrail/contrail-command-deployer:<container_tag>
其中<ABSOLUTE_PATH_TO_command_servers.yml_FILE>,是在步骤 3 中创建的 command_servers.yml 文件的绝对路径,<container_tag>也是要安装的版本的 Contrail 命令 (UI) 容器部署的容器标记。
(可选)跟踪步骤 4 的进度。
docker logs -f contrail_command_deployer
安装完成后,验证 Contrail 命令容器是否正在运行。
[root@centos254 ~]# docker ps -a CONTAINER ID IMAGE <trimmed> STATUS <trimmed> NAMES 2e62e778aa91 hub.juniper.net/... Up <trimmed> contrail_command c8442860e462 circleci/postgre... Up <trimmed> contrail_psql 57a666e93d1a hub.juniper.net/... Exited <trimmed> contrail_command_deployer
contrail_command
容器是 GUIcontrail_psql
,容器是数据库。两个容器的状态都应为“已启动”。容器
contrail-command-deployer
的“状态”应为“已退出”,因为它在安装完成后退出。-
使用 https://<Contrail-Command-Server-IP-Address>:9091 登录 Contrail 命令。使用您在步骤 3 的 command_servers.yml 文件中指定的用户名和密码。如果在示例 command_servers.yml 文件中使用示例 command_servers.yml 文件,则用户名为 ,密码为 admin contrail123。
示例 command_servers.yml 文件
最小的 command_servers.yml 文件
以下示例文件具有安装 Contrail 命令时所需的最低配置。
注意:此输出中提供的密码仅用于说明目的。我们建议根据组织在环境中的安全准则使用唯一密码。
--- command_servers: server1: ip: <IP Address> # IP address of server where you want to install Contrail Command connection: ssh ssh_user: root ssh_pass: <contrail command server password> sudo_pass: <contrail command server root password> ntpserver: <NTP Server address> registry_insecure: false container_registry: hub.juniper.net/contrail container_tag: <container_tag> container_registry_username: <registry username> container_registry_password: <registry password> config_dir: /etc/contrail contrail_config: database: type: postgres dialect: postgres password: contrail123 keystone: assignment: data: users: admin: password: contrail123 insecure: true client: password: contrail123
完整的 command_servers.yml 文件
以下示例文件详尽列出了安装 Contrail 命令时可以使用的配置和支持参数。
注意:此输出中提供的密码仅用于说明目的。我们建议根据组织在环境中的安全准则使用唯一密码。
--- # User defined volumes #user_command_volumes: # - /var/tmp/contrail:/var/tmp/contrail command_servers: server1: ip: <IP Address> connection: ssh ssh_user: root ssh_pass: <contrail command server password> sudo_pass: <contrail command server root password> ntpserver: <NTP Server address> # Specify either container_path #container_path: /root/contrail-command-051618.tar # or registry details and container_name registry_insecure: false container_registry: hub.juniper.net/contrail container_name: contrail-command container_tag: <container_tag> container_registry_username: <registry username> container_registry_password: <registry password> config_dir: /etc/contrail # contrail command container configurations given here go to /etc/contrail/contrail.yml contrail_config: # Database configuration. PostgreSQL supported database: type: postgres dialect: postgres host: localhost user: root password: contrail123 name: contrail_test # Max Open Connections for DB Server max_open_conn: 100 connection_retries: 10 retry_period: 3s # Log Level log_level: debug # Cache configuration cache: enabled: true timeout: 10s max_history: 100000 rdbms: enabled: true # Server configuration server: enabled: true read_timeout: 10 write_timeout: 5 log_api: true address: ":9091" # TLS Configuration tls: enabled: true key_file: /usr/share/contrail/ssl/cs-key.pem cert_file: /usr/share/contrail/ssl/cs-cert.pem # Enable GRPC or not enable_grpc: false # Static file config # key: URL path # value: file path. (absolute path recommended in production) static_files: /: /usr/share/contrail/public # API Proxy configuration # key: URL path # value: String list of backend host #proxy: # /contrail: # - http://localhost:8082 notify_etcd: false # VNC Replication enable_vnc_replication: true # Keystone configuration keystone: local: true assignment: type: static data: domains: default: &default id: default name: default projects: admin: &admin id: admin name: admin domain: *default demo: &demo id: demo name: demo domain: *default users: admin: id: admin name: Admin domain: *default password: contrail123 email: admin@juniper.nets roles: - id: admin name: admin project: *admin bob: id: bob name: Bob domain: *default password: bob_password email: bob@juniper.net roles: - id: Member name: Member project: *demo store: type: memory expire: 36000 insecure: true authurl: https://localhost:9091/keystone/v3 # disable authentication with no_auth true and comment out keystone configuraion. #no_auth: true insecure: true etcd: endpoints: - localhost:2379 username: "" password: "" path: contrail watcher: enabled: false storage: json client: id: admin password: contrail123 project_name: admin domain_id: default schema_root: / endpoint: https://localhost:9091 compilation: enabled: false # Global configuration plugin_directory: 'etc/plugins/' number_of_workers: 4 max_job_queue_len: 5 msg_queue_lock_time: 30 msg_index_string: 'MsgIndex' read_lock_string: "MsgReadLock" master_election: true # Plugin configuration plugin: handlers: create_handler: 'HandleCreate' update_handler: 'HandleUpdate' delete_handler: 'HandleDelete' agent: enabled: true backend: file watcher: polling log_level: debug # The following are optional parameters used to patch/cherrypick # revisions into the contrail-ansible-deployer sandbox. These configs # go into the /etc/contrail/contrail-deploy-config.tmpl file # cluster_config: # ansible_fetch_url: "https://review.opencontrail.org/Juniper/contrail-ansible-deployer refs/changes/80/40780/20" # ansible_cherry_pick_revision: FETCH_HEAD # ansible_revision: GIT_COMMIT_HASH