真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

如何使用Vagrant安裝TungstenFabric

如何使用Vagrant安裝Tungsten Fabric,很多新手對(duì)此不是很清楚,為了幫助大家解決這個(gè)難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。

創(chuàng)新互聯(lián)是一家專業(yè)提供巴彥淖爾企業(yè)網(wǎng)站建設(shè),專注與網(wǎng)站建設(shè)、網(wǎng)站制作、H5響應(yīng)式網(wǎng)站、小程序制作等業(yè)務(wù)。10年已為巴彥淖爾眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站制作公司優(yōu)惠進(jìn)行中。

01

準(zhǔn)備測(cè)試機(jī)

在16G的筆記本沒跑起來,就干脆拼湊了一臺(tái)游戲工作室級(jí)別的機(jī)器:雙路E5-2860v3 CPU,24核48線程,128G DDR4 ECC內(nèi)存,NVME盤 512G。在上面開5個(gè)VM,假裝是物理服務(wù)器。

· 192.16.35.110  deployer

· 192.16.35.111  tf控制器

· 192.16.35.112  openstack服務(wù)器,同時(shí)也是計(jì)算節(jié)點(diǎn)

· 192.16.35.113  k8s master

· 192.16.35.114  k8s的Node k01,同時(shí)也是ops的計(jì)算節(jié)點(diǎn)

直接使用vagrant拉鏡像會(huì)很慢,就先下載下來:

https://cloud.centos.org/centos/7/vagrant/x86_64/images/

下載對(duì)應(yīng)的VirtualBox.box文件。

然后使用命令, 命名為vagrant的box:

vagrant box add centos/7 CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box

cat << EEOOFF > vagrantfile### start # -*- mode: ruby -*-# vi: set ft=ruby :Vagrant.require_version 
">=2.0.3"# All Vagrant configuration is done below. The "2" in Vagrant.configure# configures the configuration version (we support older styles for# backwards compatibility). Please don't change it unless you know what# you're doing.ENV["LC_ALL"] = 
"en_US.UTF-8"VAGRANTFILE_API_VERSION = 
"2"Vagrant.configure("2") 
do |config|  # The most common configuration options are documented and commented below.  # For a complete reference, please see the online documentation at  # https://docs.vagrantup.com.  # Every Vagrant development environment requires a box. You can search for  # boxes at https://atlas.hashicorp.com/search.  config.vm.box = 
"geerlingguy/centos7"  # config.vbguest.auto_update = false  # config.vbguest.no_remote = true    config.vm.define 
"deployer" do | dp |    dp.vm.provider 
"virtualbox" do | v |      v.memory = 
"8000"      v.cpus = 2    end    dp.vm.network 
"private_network", ip: 
"192.16.35.110", auto_config: 
true    dp.vm.hostname = 
"deployer"  end  config.vm.define 
"tf" do | tf |    tf.vm.provider 
"virtualbox" do | v |      v.memory = 
"64000"      v.cpus = 16    end    tf.vm.network 
"private_network", ip: 
"192.16.35.111", auto_config: 
true    tf.vm.hostname = 
"tf"  end  config.vm.define 
"ops" do | os |    os.vm.provider 
"virtualbox" do | v |      v.memory = 
"16000"      v.cpus = 4    end    os.vm.network 
"private_network",ip: 
"192.16.35.112",  auto_config: 
true    os.vm.hostname = 
"ops"  end  config.vm.define 
"k8s" do | k8 |    k8.vm.provider 
"virtualbox" do | v |      v.memory = 
"8000"      v.cpus = 2    end    k8.vm.network 
"private_network", ip: 
"192.16.35.113", auto_config: 
true    k8.vm.hostname = 
"k8s"  end  config.vm.define 
"k01" do | k1 |    k1.vm.provider 
"virtualbox" do | v |      v.memory = 
"4000"      v.cpus = 2    end    k1.vm.network 
"private_network", ip: 
"192.16.35.114", auto_config: 
true    k1.vm.hostname = 
"k01"  end  config.vm.provision 
"shell", privileged: 
true, path: 
"./setup.sh"endEEOOFFcat << EEOOFF > setup.sh#!/bin/bash## Setup vagrant vms.#set -eu# Copy hosts infocat < /etc/hosts127.0.0.1 localhost127.0.1.1 vagrant.vm vagrant192.16.35.110 deployer192.16.35.111 tf192.16.35.112 ops192.16.35.113 k8s192.16.35.114 k01# The following lines are desirable for IPv6 capable hosts::1     localhost ip6-localhost ip6-loopbackff02::1 ip6-allnodesff02::2 ip6-allroutersEOFsystemctl stop firewalldsystemctl 
disable firewalldiptables -F && iptables -X && iptables -F -t nat && iptables -X -t natiptables -P FORWARD ACCEPTswapoff -a sed -i 
's/.*swap.*/#&/' /etc/fstab# swapoff -a && sysctl -w vm.swappiness=0# setenforce  0 sed -i 
"s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/sysconfig/selinux sed -i 
"s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config sed -i 
"s/^SELINUX=permissive/SELINUX=disabled/g" /etc/sysconfig/selinux sed -i 
"s/^SELINUX=permissive/SELINUX=disabled/g" /etc/selinux/config  # modprobe ip_vs_rrmodprobe br_netfilteryum -y update# sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory# sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory# yum install -y bridge-utils.x86_64# modprobe bridge# modprobe br_netfilter# Setup system varsyum install -y epel-releaseyum install -y yum-utils device-mapper-persistent-data lvm2 net-tools vim chrony python python-setuptools python-pip iproute lrzsz tree gityum install -y libguestfs-tools libvirt-python virt-install libvirt ansiblepip install wheel --upgrade -i https://mirrors.aliyun.com/pypi/simple/pip install pip --upgrade -i https://mirrors.aliyun.com/pypi/simple/pip install ansible  netaddr --upgrade -i https://mirrors.aliyun.com/pypi/simple/# python-urllib3 should be installed before "pip install requests"# if install failed, pip uninstall urllib3, then reinstall python-urllib3# pip uninstall -y urllib3 | true# yum install -y python-urllib3 pip install requests -i https://mirrors.aliyun.com/pypi/simple/systemctl 
disable libvirtd.servicesystemctl 
disable DNSmasqsystemctl stop libvirtd.servicesystemctl stop dnsmasqif [  -d 
"/root/.ssh" ]; 
then      rm -rf /root/.sshfissh-keygen -q -t rsa -N 
"" -f ~/.ssh/id_rsacat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keyschmod go-rwx ~/.ssh/authorized_keys# # timedatectl set-timezone Asia/Shanghaiif [ -f 
"/etc/chrony.conf" ]; 
then   mv /etc/chrony.conf /etc/chrony.conf.bakficat < /etc/chrony.conf      allow 192.16.35.0/24      server ntp1.aliyun.com iburst      local stratum 10      logdir /var/log/chrony      rtcsync      makestep 1.0 3      driftfile /var/lib/chrony/driftEOFsystemctl restart chronyd.servicesystemctl 
enable chronyd.serviceecho "* soft nofile 65536" >> /etc/security/limits.confecho "* hard nofile 65536" >> /etc/security/limits.confecho "* soft nproc 65536"  >> /etc/security/limits.confecho "* hard nproc 65536"  >> /etc/security/limits.confecho "* soft  memlock  unlimited"  >> /etc/security/limits.confecho "* hard memlock  unlimited"  >> /etc/security/limits.confif [ ! -d 
"/var/log/journal" ]; 
then  mkdir /var/log/journalfiif [ ! -d 
"/etc/systemd/journald.conf.d" ]; 
then  mkdir /etc/systemd/journald.conf.dficat < /etc/systemd/journald.conf.d/99-prophet.conf [Journal]Storage=persistentCompress=yesSyncIntervalSec=5mRateLimitInterval=30sRateLimitBurst=1000SystemMaxUse=10GSystemMaxFileSize=200MForwardToSyslog=noEOFsystemctl restart systemd-journaldEEOOFF
02
在所有的節(jié)點(diǎn)上安裝docker

CentOS

例如:如果pip安裝軟件的速度很慢,可以考慮使用基于aliyun的pip加速

· 各個(gè)節(jié)點(diǎn)設(shè)置pip加速

    mkdir .pip && tee ~/.pip/pip.conf <<-'EOF'[global]trusted-host =  mirrors.aliyun.comindex-url = https://mirrors.aliyun.com/pypi/simpleEOF

    注意requests包不能在urllib3之后安裝,否則會(huì)出錯(cuò):

      pip uninstall urllib3pip uninstall chardetpip install requests

      (這些命令應(yīng)該都已經(jīng)在 setup.sh 中執(zhí)行過了)

        yum install -y yum-utils device-mapper-persistent-data lvm2 net-tools iproute lrzsz tree gityum-config-manager   --add-repo   https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repoyum makecache fastyum install -y docker-ceyum -y install epel-releasesystemctl daemon-reloadsystemctl enable dockersystemctl restart dockeryum install -y chronysystemctl start chronydsystemctl enable chronyd
        03
        拉取并啟動(dòng)Contrail-Kolla-Ansible-Deployer容器

        容器的Nightly builds 可以從這里訪問: Docker Hub

        https://hub.docker.com/r/opencontrailnightly/contrail-kolla-ansible-deployer/tags

        例如:

          vim /etc/docker/daemon.json{ "registry-mirrors" : [ "https://hub-mirror.c.163.com",    "https://registry.docker-cn.com" ] }systemctl restart dockerexport CAD_IMAGE=opencontrailnightly/contrail-kolla-ansible-deployer:master-latestdocker run -td --net host --name contrail_kolla_ansible_deployer $CAD_IMAGE
          04
           將配置文件復(fù)制到容器

          instance.yaml:用于配置Tungsten Fabric集群的模板文件。

          https://github.com/Juniper/contrail-ansible-deployer/wiki/Contrail-with-Openstack-Kolla#13-configure-necessary-parameters-configinstancesyaml-under-appropriate-parameters

          要獲得有關(guān)如何配置該文件中所有可用參數(shù)的信息,可閱讀這里:

          https://github.com/Juniper/contrail-ansible-deployer/blob/master/README.md#configuration

            cat << EOF > instances.yamlprovider_config:  bms:    ssh_pwd: vagrant    ssh_user: root    ntpserver: ntp1.aliyun.com    domainsuffix: localinstances:  tf:    provider: bms    ip: 192.16.35.111    roles:      config_database:      config:      control:      analytics_database:      analytics:      webui:  ops:    provider: bms    ip: 192.16.35.112    roles:      openstack:      openstack_compute:        vrouter:        PHYSICAL_INTERFACE: 
            enp0s8  k8s:    provider: bms    ip: 192.16.35.113    roles:      k8s_master:      k8s_node:      kubemanager:      vrouter:        PHYSICAL_INTERFACE: 
            enp0s8  k01:    provider: bms    ip: 192.16.35.114    roles:      openstack_compute:      k8s_node:      vrouter:        PHYSICAL_INTERFACE: 
            enp0s8contrail_configuration:  AUTH_MODE: keystone  KEYSTONE_AUTH_URL_VERSION: /v3  KEYSTONE_AUTH_ADMIN_PASSWORD: 
            vagrant  CLOUD_ORCHESTRATOR: 
            openstack  CONTRAIL_VERSION: 
            latest  UPGRADE_KERNEL: 
            true  ENCAP_PRIORITY: 
            "VXLAN,MPLSoUDP,MPLSoGRE"  PHYSICAL_INTERFACE: 
            enp0s8global_configuration:  CONTAINER_REGISTRY: 
            opencontrailnightlykolla_config:  kolla_globals:    enable_haproxy: no    enable_ironic: "no"    enable_swift: "no"    network_interface: 
            "enp0s8"  kolla_passwords:    keystone_admin_password: vagrantEOFexport INSTANCES_FILE=instances.yamldocker cp $INSTANCES_FILE contrail_kolla_ansible_deployer:/root/contrail-ansible-deployer/config/instances.yaml

            05
            準(zhǔn)備好所有節(jié)點(diǎn)的環(huán)境

            除了deployer,我在所有節(jié)點(diǎn)上都做了一遍。

            正常的做法是建個(gè)自己的repository放各種image,實(shí)驗(yàn)環(huán)境節(jié)點(diǎn)少,直接國內(nèi)下載也很快的。

            注意python和python-py這兩個(gè)包是沖突的,只能安裝其中之一,最好先全卸載,再安裝其中一個(gè):

              pip uninstall docker-py docker pip install pythonyum -y install python-devel python-subprocess32 python-setuptools python-pip pip install --upgrade pip find / -name *subpro*.egg-info find / -name *subpro*.egg-info |xargs rm -rfpip install -I sixpip install -I docker-compose

              將k8s  repository改成阿里的,缺省的Google源太慢或不通:vi

              playbooks/roles/k8s/tasks/RedHat.yml

                yum_repository:name: Kubernetesdescription: k8s repobaseurl: https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64gpgkey: https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpgrepo_gpgcheck: yesgpgcheck: yeswhen: k8s_package_version is defined

                playbook中安裝這些需要訪問海外網(wǎng)站,可以從國內(nèi)下載,然后改個(gè)tag:

                  k8s.gcr.io/kube-apiserver:v1.14.8k8s.gcr.io/kube-controller-manager:v1.14.8k8s.gcr.io/kube-scheduler:v1.14.8k8s.gcr.io/kube-proxy:v1.14.8k8s.gcr.io/pause:3.1k8s.gcr.io/etcd:3.3.10k8s.gcr.io/coredns:1.3.1

                  換個(gè)方法變通處理一下

                    docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.14.8docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.14.8docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.14.8docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.14.8docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.3.10docker pull coredns/coredns:1.3.1docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.8.3

                    再重新給下載的打個(gè)tag

                      docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.14.8 k8s.gcr.io/kube-apiserver:v1.14.8docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.14.8 k8s.gcr.io/kube-controller-manager:v1.14.8docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.14.8 k8s.gcr.io/kube-scheduler:v1.14.8docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.14.8 k8s.gcr.io/kube-proxy:v1.14.8docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1 k8s.gcr.io/pause:3.1docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10docker tag docker.io/coredns/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.8.3  k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.3
                      06
                      啟動(dòng)deployer容器,進(jìn)入其中進(jìn)行部署
                        docker start contrail_kolla_ansible_deployer

                        進(jìn)入deployer容器:

                          docker exec -it contrail_kolla_ansible_deployer bashcd /root/contrail-ansible-deployeransible-playbook -i inventory/ -e orchestrator=openstack playbooks/provision_instances.ymlansible-playbook -i inventory/ -e orchestrator=openstack playbooks/configure_instances.ymlansible-playbook -i inventory/ -e orchestrator=openstack playbooks/install_openstack.ymlansible-playbook -i inventory/ -e orchestrator=openstack playbooks/install_k8s.ymlansible-playbook -i inventory/ -e orchestrator=openstack playbooks/install_contrail.ymlkubectl taint nodes k8s node-role.kubernetes.io/master-

                          最后一次kubelet升級(jí)到最新,遇到CSI的bug,修改一下配置文件后重啟kubelet即可:

                            After experiencing the same issue, editing /var/lib/kubelet/config.yaml to add:featureGates:  CSIMigration: false

                            07
                            安裝完成后,建2個(gè)VM和容器測(cè)試一下
                              yum install -y gcc python-develpip install python-openstackclientpip install python-ironicclientsource /etc/kolla/kolla-toolbox/admin-openrc.sh

                              如果openstack命令有如下“queue”的報(bào)錯(cuò),是需要python3:

                                File "/usr/lib/python2.7/site-packages/openstack/utils.py", line 13, in     import queueImportError: No module named queue
                                  rm -f /usr/bin/pythonln -s /usr/bin/python3 /usr/bin/pythonpip install python-openstackclientpip install python-ironicclientyum install -y python3-pipyum install -y gcc python-devel wgetpip install --upgrade setuptoolspip install --ignore-installed python-openstackclient我每次都需要python3,所以干脆也安裝了這個(gè):pip3 install python-openstackclient -i https://mirrors.aliyun.com/pypi/simple/pip3 install python-ironicclient -i https://mirrors.aliyun.com/pypi/simple/

                                  進(jìn)入Tungsten Fabric,用瀏覽器:https://192.16.35.111:8143

                                  進(jìn)入openstack,用瀏覽器:https://192.16.35.112

                                  在k8s master上(192.16.35.113):

                                    scp root@192.16.35.114:/opt/cni/bin/contrail-k8s-cni /opt/cni/bin/mkdir /etc/cni/net.dscp root@192.16.35.114:/etc/cni/net.d/10-contrail.conf /etc/cni/net.d/10-contrail.conf

                                    (都沒有找到帶tcpdump的版本)

                                    reboot

                                    source /etc/kolla/kolla-toolbox/admin-openrc.sh

                                      openstack image create cirros --disk-format qcow2 --public --container-format bare --file cirros-0.4.0-x86_64-disk.imgnova flavor-create m1.tiny auto 512 1 1openstack network create net1openstack subnet create --subnet-range 10.1.1.0/24 --network net1 mysubnet1NET_ID=`openstack network list | grep net1 | awk -F '|' '{print $2}' | tr -d ' '` nova boot --image cirros --flavor m1.tiny --nic net-id=${NET_ID} VM1nova boot --image cirros --flavor m1.tiny --nic net-id=${NET_ID} VM2

                                      進(jìn)入k8s_master, 192.16.35.113:

                                        yum install -y gitgit clone https://github.com/virtualhops/k8s-demokubectl create -f k8s-demo/po-ubuntuapp.ymlkubectl create -f k8s-demo/rc-frontend.ymlkubectl expose rc/frontendkubectl exec -it ubuntuapp curl frontend # many times

                                        看完上述內(nèi)容是否對(duì)您有幫助呢?如果還想對(duì)相關(guān)知識(shí)有進(jìn)一步的了解或閱讀更多相關(guān)文章,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝您對(duì)創(chuàng)新互聯(lián)的支持。


                                        新聞標(biāo)題:如何使用Vagrant安裝TungstenFabric
                                        網(wǎng)站路徑:http://weahome.cn/article/ggsoec.html

                                        其他資訊

                                        在線咨詢

                                        微信咨詢

                                        電話咨詢

                                        028-86922220(工作日)

                                        18980820575(7×24)

                                        提交需求

                                        返回頂部