# UPGW 容器部署 ## 准备资源 ### 部署节点(物理机/虚拟机均可) ### UPGW节点(物理机/虚拟机均可) 镜像:CentOS-7-x86_64-Minimal-1908.iso vCPU:至少 6 核,推荐 8 核。 内存:至少 16G,推荐 32G。 硬盘:300G 网卡: 一张管理网卡,通过NAT访问宿主机及外网,网卡类型随意 三张用作 NES 的 DPDK 网卡 ### 文件资源 离线包下载地址:https://onedrive.live.com/?id=458D48D3A0E736CE%2137670&cid=458D48D3A0E736CE offline-node.tar.gz:离线安装包 upgw-experience-kits.tar.gz:ansible 安装脚本 upgw.tar:upgw最新代码 ## 部署准备 在 UPGW 主机上: - 设置 /etc/hosts,在两条本机的映射后加上主机名 在部署节点上: - 设置主机名 /etc/hosts,添加 UPGW 节点的 IP hostname 映射; - 设置免密 ssh-copy-id root@ - mkdir /opt/nts-offline - 将 upgw-experience-kits.tar.gz 放到 /opt 下并解压 - 将 offline-node.tar.gz 放到 /opt/nts-offline 下并解压 - 将代码 upgw.tar 放到 /opt/nts-offline 下 ## 部署 修改 inventory.ini 例: ``` [all] upgw ansible_ssh_user=root ansible_host=192.168.120.46 (upgw 节点的 IP) [edgenode_group] upgw ``` ``` # cd /opt/openness-experience-kits # ./deploy_onprem_node.sh ``` 此时在 UPGW 节点可以看到 created 状态的 UPGW docker ### 在 UPGW 节点安装 redis ``` yum install redis -y systemctl enable redis && systemctl start ``` ### 安装 hiredis ``` $ cd /opt/ $ git clone https://github.com/redis/hiredis.git $ cd hiredis/ $ git checkout v0.14.0 $ make && make install $ /sbin/ldconfig ``` ## 运行 ### 修改配置文件: nes 的配置文件位于 /var/lib/appliance/nts/nts.cfg ``` ; Copyright 2019 Intel Corporation. All rights reserved. ; ; Licensed under the Apache License, Version 2.0 (the "License"); ; you may not use this file except in compliance with the License. ; You may obtain a copy of the License at ; ; http://www.apache.org/licenses/LICENSE-2.0 ; ; Unless required by applicable law or agreed to in writing, software ; distributed under the License is distributed on an "AS IS" BASIS, ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ; See the License for the specific language governing permissions and ; limitations under the License. [PORT0] name = 0000:00:05.0 description = 82540EM Gigabit Ethernet Controller pci-address = 0000:00:05.0 traffic-type = mixed traffic-direction = upstream egress-port = 1 [PORT1] name = 0000:00:06.0 description = 82540EM Gigabit Ethernet Controller pci-address = 0000:00:06.0 traffic-type = mixed traffic-direction = downstream egress-port = 0 [PORT2] name = 0000:00:07.0 description = 82540EM Gigabit Ethernet Controller pci-address = 0000:00:07.0 traffic-type = mixed traffic-direction = lbp egress-port = 0 lbp-mac = e4:1d:2d:17:7a:10 [VM common] max = 32 number = 2 vhost-dev = /var/lib/appliance/nts/qemu/usvhost-1 [NES_SERVER] ctrl_ip = 0.0.0.0 ctrl_port = 9515 [REDIS_SERVER] host=127.0.0.1 port=6379 [KNI] max = 32 ``` ### 启动 UPGW ``` docker start upgw ``` 通过 docker logs -f upgw 查看启动日志