久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

    OpenStack實(shí)踐(五):LinuxBridge方式實(shí)現(xiàn)LoadBalance

    環(huán)境:

    為梁山等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及梁山網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都做網(wǎng)站、網(wǎng)站設(shè)計(jì)、外貿(mào)營(yíng)銷網(wǎng)站建設(shè)、梁山網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!

    openstack版本pike
    控制節(jié)點(diǎn)主機(jī)openstack-controller(ubuntu 16.04.5) 172.27.34.37
    計(jì)算節(jié)點(diǎn)主機(jī)openstack-computer(ubuntu 16.04.5) 172.27.34.38
    vlan100
    centos01(172.27.100.17)、centos02(172.27.100.11)


    ubuntu安裝詳見(jiàn):Ubuntu16.04.5以lvm方式安裝全記錄

    openstack安裝詳見(jiàn):OpenStack實(shí)踐(一):Ubuntu16.04下DevStack方式搭建p版OpenStack


    拓?fù)鋱D:

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    目標(biāo):

    外網(wǎng)pc訪問(wèn)Load Balancers ip 172.27.34.11,會(huì)輪詢?cè)L問(wèn)后端web服務(wù)器

    本文目錄:

    一、新建vlan
    二、新建實(shí)例centos01

    三、配置安全組

    四、配置float ip

    五、新建實(shí)例centos02

    六、配置lbaas

    一、新建vlan

    1.配置ml2_conf.ini

    主備機(jī)同時(shí)配置ml2_conf.ini

    stack@openstack-controller:~$ view /etc/neutron/plugins/ml2/ml2_conf.ini
    [ml2]
    tenant_network_types = vlan
    extension_drivers = port_security
    mechanism_drivers = openvswitch,linuxbridge
    type_drivers = local,flat,vlan,gre,vxlan,geneve
    
    [ml2_type_vlan]
    network_vlan_ranges = vlan:3001:4000
    
    
    [linux_bridge]
    physical_interface_mappings = vlan:ens192

    2.重啟neutron

    stack@openstack-controller:~$ sudo systemctl restart devstack@q*

    3.創(chuàng)建vlan100

    stack@openstack-controller:/tmp$ openstack network create --provider-physical-network vlan --provider-network-type vlan --project admin vlan100

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    4.創(chuàng)建子網(wǎng)

    創(chuàng)建子網(wǎng)subnet172.27.100.0

    stack@openstack-controller:/tmp$ openstack subnet create --network vlan100 --subnet-range 172.27.100.0/24 --gateway 172.27.100.1 subnet172.27.100.0

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    5.查看創(chuàng)建的網(wǎng)絡(luò)

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    二、創(chuàng)建實(shí)例centos01

    1.上傳介質(zhì)

    上傳介質(zhì)CentOS-7-x86_64-GenericCloud-1503.qcow2c至/tmp目錄,下載地址:http://cloud.centos.org/centos/7/images/

    2.制作鏡像

    root@openstack-controller:~# su - stack
    stack@openstack-controller:~$ source devstack/openrc admin admin
    stack@openstack-controller:/tmp$ openstack image create "centos7"   --file CentOS-7-x86_64-GenericCloud-1503.qcow2c  --disk-format qcow2 --container-format bare   --public

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    3.新建秘鑰centos

    使用stack用戶分別新建秘鑰對(duì)centos

    stack@openstack-controller:~/key$ ssh-keygen  -t rsa -f centos.key
    stack@openstack-controller:~/key$ more centos.pub

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    4.導(dǎo)入秘鑰

    將公鑰導(dǎo)入

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    創(chuàng)建實(shí)例后,使用私鑰來(lái)登錄實(shí)例

    5.查看實(shí)例類型

    stack@openstack-controller:~$ nova flavor-list

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    實(shí)例類型選擇m1.small

    6.查看鏡像

    stack@openstack-controller:~$ glance image-list

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    選擇centos7

    7.查看主機(jī)名和zone

    stack@openstack-controller:~$ nova service-list

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    本文選擇控制節(jié)點(diǎn)luanch實(shí)例

    8.查看網(wǎng)絡(luò)

    stack@openstack-controller:~$ openstack network list

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    選擇新建的vlan100

    9.查看密鑰對(duì)

    stack@openstack-controller:~/key$ nova keypair-list

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    新建的實(shí)例centos01使用秘鑰centos

    10.新建實(shí)例centos01

    stack@openstack-controller:~/key$ nova boot --flavor m1.small --image centos7  --availability-zone nova:openstack-controller --nic net-name=vlan100 --key-name centos centos01

    11.查看新建實(shí)例

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    三、新建安全組

    1.編輯默認(rèn)安全組

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    2.新增規(guī)則

    新增規(guī)則允許ping、ssh和80端口訪問(wèn)

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    四、配置float ip
    外網(wǎng)訪問(wèn)配置

    1.配置ml2_conf.ini

    控制節(jié)點(diǎn)配置ml2_conf.ini

    stack@openstack-controller:~$ view /etc/neutron/plugins/ml2/ml2_conf.ini
    [ml2_type_flat]
    flat_networks = externaltt
    
    
    [ml2_type_vlan]
    network_vlan_ranges = vlan:3001:4000
    
    [linux_bridge]
    physical_interface_mappings = vlan:ens192,externaltt:ens224

    2.重啟網(wǎng)絡(luò)

    stack@openstack-controller:~$  sudo systemctl restart devstack@q*

    由于本文外網(wǎng)環(huán)境為flat網(wǎng)絡(luò)(物理機(jī)的網(wǎng)卡接在交換機(jī)的access口),此處外網(wǎng)配置選擇flat,對(duì)應(yīng)網(wǎng)卡ens224,虛擬機(jī)內(nèi)網(wǎng)為vlan,對(duì)應(yīng)網(wǎng)卡ens192。

    3.創(chuàng)建ext_net_flat

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    4.創(chuàng)建子網(wǎng)

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    5.不勾選dhcp

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    6.查看創(chuàng)建的外網(wǎng)

    172.27.34.0該網(wǎng)段需能訪問(wèn)外網(wǎng)。

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    新建路由

    1.新建路由router100

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    外部網(wǎng)絡(luò)選擇ext_net_flat,將外網(wǎng)連接至虛擬路由器

    此時(shí)會(huì)新增接口,ip為172.27.34.6

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    2.新增接口

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    創(chuàng)建floating ip

    1.分配浮動(dòng)ip

    floating ip提供靜態(tài)NAT功能,配置在router提供網(wǎng)關(guān)的外網(wǎng)interface上。

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    2.關(guān)聯(lián)實(shí)例

    創(chuàng)建浮動(dòng)ip172.27.34.4,并分別與實(shí)例centos01關(guān)聯(lián)

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    五、新建實(shí)例centos02

    實(shí)例centos02以centos01快照方式啟動(dòng)

    配置實(shí)例centos01

    1.登陸centos01

    登陸實(shí)例并修改密碼

    stack@openstack-controller:~/key$ sudo ssh -i  centos.key centos@172.27.34.4

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    2.修改配置文件sshd_config

    [root@centos01 ~]# view /etc/ssh/sshd_config
    PermitRootLogin yes
    PasswordAuthentication yes

    3.重啟sshd

    [root@centos01 ~]# service sshd restart
    Redirecting to /bin/systemctl restart  sshd.service

    此時(shí)可以遠(yuǎn)程訪問(wèn)實(shí)例了

    4.關(guān)閉selinux

    [root@centos01 ~]# setenforce 0
    [root@centos01 ~]# sed -i 's/^ *SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

    重啟后永久生效

    5.配置源

    [root@centos01 ~]# yum -y install wget
    [root@centos01 ~]# cd /etc/yum.repos.d/
    [root@centos01 yum.repos.d]# mkdir repo_bak && mv *.repo repo_bak/
    [root@centos01 yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo

    6.安裝apache服務(wù)并配置

    [root@centos01 ~]# yum -y install httpd
    [root@centos01 ~]# systemctl start httpd
    [root@centos01 ~]# systemctl enable httpd
    [root@centos01 ~]# echo web01-172.27.100.17 >/var/www/html/index.html

    7.訪問(wèn)centos01

    訪問(wèn)http://172.27.34.4/

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    創(chuàng)建實(shí)例centos02

    1.創(chuàng)建快照

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    根據(jù)實(shí)例centos01創(chuàng)建快照centos

    2.由鏡像啟動(dòng)實(shí)例

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    由鏡像centos啟動(dòng)實(shí)例centos02

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    網(wǎng)絡(luò)、實(shí)例類型等和centos01保持一致

    3.配置centos02

    參照centos01配置,關(guān)聯(lián)vip,連接centos02進(jìn)行相關(guān)配置

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    4.訪問(wèn)centos02

    訪問(wèn)http://172.27.34.5/

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    六、配置lbaas

    查看Octavia服務(wù)

    本文以O(shè)ctavia方式實(shí)現(xiàn)lbaas,從Pike版本開(kāi)始,Octavia就可以作為獨(dú)立的Keystone服務(wù)而不再是Neutron的一個(gè)service plugin。

    stack@openstack-controller:~$ openstack service list

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    Load Balancers配置

    1.創(chuàng)建Load Balancers

    新建Load Balancer 4,子網(wǎng)選擇內(nèi)網(wǎng)subnet172.27.100.0

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    2.配置Listener

    Listener的協(xié)議選擇HTTP,端口默認(rèn)為80

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    3.配置Pool

    Pool的方法為round_robin

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    4.加入pool members

    將centos01和centos02加入pool

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    5.新建monitor

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    6.分配浮動(dòng)ip

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    將浮動(dòng)ip172.27.34.11分配給load balance做vip

    7.查看新建的Load Balancers

    查看vip

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    查看實(shí)例

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    8.訪問(wèn)測(cè)試

    在計(jì)算節(jié)點(diǎn)訪問(wèn)vip

    root@openstack-computer:~# for i in {1..10};do sleep 5; curl http://172.27.34.11; done

    OpenStack實(shí)踐(五):Linux Bridge方式實(shí)現(xiàn)Load Balance

    訪問(wèn)vip,發(fā)現(xiàn)以輪詢方式分別訪問(wèn)后端的web服務(wù)器,結(jié)果符合預(yù)期。

    文章標(biāo)題:OpenStack實(shí)踐(五):LinuxBridge方式實(shí)現(xiàn)LoadBalance
    當(dāng)前鏈接:http://sd-ha.com/article36/jgihpg.html

    成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供、做網(wǎng)站、App開(kāi)發(fā)網(wǎng)站收錄、品牌網(wǎng)站制作、搜索引擎優(yōu)化

    廣告

    聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

    成都網(wǎng)站建設(shè)公司