作者:Tatsuya Naganawa 译者:TF中文社区
如何构建Tungsten Fabric
这里的repo文件的说明文档大部分是有效的。
https://github.com/Juniper/contrail-dev-env–
yum -y install docker git
git clone https://github.com/Juniper/contrail-dev-env
cd contrail-dev-env
./startup.sh
docker exec -it contrail-developer-sandbox bash
cd /root/contrail-dev-env
yum -y remove python-devel ## 需要解决依赖关系问题
make sync
make fetch_packages
make setup
make dep
要构建所有模块,可以使用此命令(需要1-2个小时时间,具体取决于计算机性能)。
make rpm
make containers
要构建更多具体的模块,也可以使用这些命令。一个注意事项是,rpm-contrail本身是一个大的数据包,并且不能分解为更多(controller、vrouter等都包含在内)。
make list
make rpm-contrail
make list-containers
make container-general-base
make container-base
make container-kubernetes_kube-manager
- those make targets are included from this file:
/root/contrail/tools/packages/Makefile
https://github.com/Juniper/contrail-packages/blob/master/Makefile
如果仅构建vrouter.ko,此命令比较有用。
build:
cd /root/contrail
scons --opt=production --kernel-dir=/lib/modules/3.10.0-1062.el7.x86_64/build build-kmodule
clean:
cd /root/contrail/vrouter
make KERNELDIR=/lib/modules/3.10.0-1062.el7.x86_64/build clean
注意:当安装了其它发行版的kernel-devel软件包(我尝试过centos 8和amazon linux 2的软件包)时,也可以将其指定为kernel-dir。
例如,此命令为centos 8.2创建了vrouter.ko。
可以通过insmod命令手动加载。
# rpm -ivh --nodeps kernel-devel-4.18.0-147.8.1.el8_1.x86_64.rpm
# scons --opt=production --kernel-dir=/usr/src/kernels/4.18.0-147.8.1.el8_1.x86_64/ build-kmodule
charm安装
Tungsten Fabric也可以通过juju charm安装。
- 使用了bionic和Openstack Queens,有4个节点(juju node, openstack controller,
openstack compute, tunsten-fabric controller)
# apt update
# snap install --classic juju
# juju add-cloud
Select cloud type: manual
Enter a name for your manual cloud: manual-cloud-1
Enter the controller's hostname or IP address: (juju node's ip)
# ssh-keygen
# cd .ssh
# cat id_rsa.pub >> authorized_keys
# cd
# ssh-copy-id (other nodes' ip)
# juju bootstrap manual-cloud-1
# git clone https://github.com/Juniper/contrail-charms -b R5
# juju add-machine ssh:root@(openstack-controller ip)
# juju add-machine ssh:root@(openstack-compute ip)
# juju add-machine ssh:root@(TungstenFabric-controller ip)
# vi set-juju.sh
ju