{"id":12008,"date":"2023-09-19T13:45:12","date_gmt":"2023-09-19T20:45:12","guid":{"rendered":"https:\/\/www.xh86.me\/?p=12008"},"modified":"2023-09-19T13:45:12","modified_gmt":"2023-09-19T20:45:12","slug":"octavia%e8%b4%9f%e8%bd%bd%e5%9d%87%e8%a1%a1%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=12008","title":{"rendered":"Octavia\u8d1f\u8f7d\u5747\u8861\u670d\u52a1"},"content":{"rendered":"<h1>Octavia\u8d1f\u8f7d\u5747\u8861\u670d\u52a1<\/h1>\n<div>\n<p>Octavia \u4ee5\u670d\u52a1\u7684\u5f62\u5f0f\u63d0\u4f9b\u8d1f\u8f7d\u5747\u8861\u3002\u672c\u6307\u5357\u6db5\u76d6\u4e86\u4e3a\u00a0Amphora\u00a0\u9a71\u52a8\u7a0b\u5e8f\u914d\u7f6e\u00a0Octavia\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u00a0Octavia\u00a0\u6587\u6863\u3002<\/p>\n<h2 id=\"_1-\u542f\u7528-octavia\">#1.\u00a0\u542f\u7528 Octavia<\/h2>\n<p>\u8fdb\u5165\u90e8\u7f72\u673a\uff0c\u627e\u5230\u00a0\/etc\/kolla\/globals.yml\uff0c\u5e76\u8bbe\u7f6e<\/p>\n<div>\n<pre>enable_octavia: \"yes\"\r\n<\/pre>\n<\/div>\n<h2 id=\"_2-\u81ea\u52a8\u751f\u6210\u8bc1\u4e66\">#2.\u00a0\u81ea\u52a8\u751f\u6210\u8bc1\u4e66<\/h2>\n<div>\n<pre>kolla-ansible octavia-certificates\r\n<\/pre>\n<\/div>\n<p>\u8bc1\u4e66\u548c\u5bc6\u94a5\u5c06\u5728 \/etc\/kolla\/config\/octavia<\/p>\n<h2 id=\"_3-\u91cd\u65b0\u90e8\u7f72\">#3. \u91cd\u65b0\u90e8\u7f72<\/h2>\n<div>\n<pre>kolla-ansible -i .\/multinode deploy --tags common,horizon,octavia\r\n<\/pre>\n<\/div>\n<h2 id=\"_4-\u6784\u5efaamphora\u955c\u50cf\">#4. \u6784\u5efaAmphora\u955c\u50cf<\/h2>\n<h3 id=\"_4-1-\u5b89\u88c5\u4f9d\u8d56\">#4.1 \u5b89\u88c5\u4f9d\u8d56<\/h3>\n<div>\n<pre>sudo apt -y install debootstrap qemu-utils git kpartx\r\n<\/pre>\n<\/div>\n<h3 id=\"_4-2-\u83b7\u53d6-octavia-\u6e90\u4ee3\u7801\">#4.2\u00a0\u83b7\u53d6 Octavia \u6e90\u4ee3\u7801<\/h3>\n<p>\u5efa\u8bae\u7528\u56fd\u5185git\u5e73\u53f0\u955c\u50cf\u4e00\u4efd<\/p>\n<div>\n<pre># \u5b98\u7f51\u547d\u4ee4\uff08\u4e0d\u5efa\u8bae\uff09\r\n# git clone https:\/\/opendev.org\/openstack\/octavia -b stable\/zed\r\n# \u955c\u50cf\r\ngit clone https:\/\/jihulab.com\/james-curtis\/octavia.git -b stable\/zed\r\n<\/pre>\n<\/div>\n<h3 id=\"_4-3-\u5b89\u88c5-diskimage-builder\">#4.3\u00a0\u5b89\u88c5 diskimage-builder<\/h3>\n<div>\n<pre>python3 -m venv \/dib-venv\r\nsource \/dib-venv\/bin\/activate\r\npip install diskimage-builder\r\n<\/pre>\n<\/div>\n<h3 id=\"_4-4-\u955c\u50cf\u6e90\">#4.4 \u955c\u50cf\u6e90<\/h3>\n<blockquote><p>\u4e0b\u4e00\u6b65\u9700\u8981\u4e0b\u8f7d\u5927\u91cf\u6587\u4ef6\uff0c\u9700\u8981\u514b\u9686\u51e0\u4e2a\u4ed3\u5e93\uff0c\u5efa\u8bae\u4f7f\u7528 jihulab.com<\/p><\/blockquote>\n<p>\u4e0b\u9762\u662f\u9700\u8981\u8bbe\u7f6e\u7684\u90e8\u5206\u73af\u5883\u53d8\u91cf<\/p>\n<ul>\n<li>DIB_REPOLOCATION_amphora_agent\uff08\u5c06\u5b89\u88c5\u5728\u6620\u50cf\u4e2d\u7684 amphora-agent \u4ee3\u7801\u7684\u4f4d\u7f6e\uff09<\/li>\n<\/ul>\n<p>\u9ed8\u8ba4\u503c\uff1ahttps:\/\/opendev.org\/openstack\/octavia<\/p>\n<ul>\n<li>DIB_REPOLOCATION_octavia_lib\uff08\u5c06\u5b89\u88c5\u5728\u6620\u50cf\u4e2d\u7684 octavia-lib \u4ee3\u7801\u7684\u4f4d\u7f6e\uff09<\/li>\n<\/ul>\n<p>\u9ed8\u8ba4\u503c\uff1ahttps:\/\/opendev.org\/openstack\/octavia-lib<\/p>\n<ul>\n<li>DIB_PYPI_MIRROR_URL<\/li>\n<li>DIB_REPOLOCATION_upper_constraints\uff08upper-constraints.txt\u4f9d\u8d56\u5305\uff09<\/li>\n<\/ul>\n<p>\u9ed8\u8ba4\u503c\uff1ahttps:\/\/opendev.org\/openstack\/requirements\/raw\/branch\/master\/upper-constraints.txt<\/p>\n<ul>\n<li>DIB_DISTRIBUTION_MIRROR\uff08\u6240\u9009\u57fa\u672c\u64cd\u4f5c\u7cfb\u7edf\u7684\u955c\u50cf URL\uff09<\/li>\n<\/ul>\n<p>\u6ce8\u610f\uff0c\u8fd9\u4e2a\u955c\u50cfurl\u662f\u7ed9Ubuntu\u7528\u7684\uff0c\u5fc5\u987b\u662fhttp\u3002\u63a8\u8350\u4f7f\u7528\u4e2d\u56fd\u79d1\u5b66\u6280\u672f\u5927\u5b66\u955c\u50cf\uff08http\uff09<\/p>\n<p>\u5bfc\u51fa\u73af\u5883\u53d8\u91cf<\/p>\n<div>\n<pre>export DIB_REPOLOCATION_amphora_agent=https:\/\/jihulab.com\/james-curtis\/octavia.git\r\nexport DIB_REPOLOCATION_octavia_lib=https:\/\/jihulab.com\/james-curtis\/octavia-lib.git\r\nexport DIB_DISTRIBUTION_MIRROR=http:\/\/mirrors.ustc.edu.cn\/ubuntu\r\nexport DIB_REPOLOCATION_upper_constraints=https:\/\/jihulab.com\/james-curtis\/requirements\/-\/raw\/stable\/zed\/upper-constraints.txt\r\nexport DIB_PYPI_MIRROR_URL=https:\/\/pypi.tuna.tsinghua.edu.cn\/simple\r\nexport DIB_NO_PYPI_PIP=1\r\n<\/pre>\n<\/div>\n<h3 id=\"_4-5-\u521b\u5efa-amphora-\u955c\u50cf\">#4.5\u00a0\u521b\u5efa Amphora \u955c\u50cf<\/h3>\n<div>\n<pre>cd octavia\/diskimage-create\r\n.\/diskimage-create.sh\r\n<\/pre>\n<\/div>\n<p>\u6784\u5efa\u6210\u529f\u8f93\u51fa\u5982\u4e0b<\/p>\n<div>\n<pre>2023-02-07 07:17:59.379 | Converting image using qemu-img convert\r\n2023-02-07 07:18:48.341 | Image file \/root\/octavia\/diskimage-create\/amphora-x64-haproxy.qcow2 created...\r\n2023-02-07 07:18:48.486 | Build completed successfully\r\nSuccessfully built the amphora using the stable\/zed amphora-agent.\r\nAmphora image size: \/root\/octavia\/diskimage-create\/amphora-x64-haproxy.qcow2 380361216\r\n<\/pre>\n<\/div>\n<p>\u5b8c\u6210\u540e\u6267\u884c\uff0c\u6ce8\u610f\u5207\u6362python\u865a\u62df\u73af\u5883<\/p>\n<div>\n<pre>kolla-ansible post-deploy\r\n<\/pre>\n<\/div>\n<h3 id=\"_4-5-1-\u5e38\u89c1\u95ee\u9898\">#4.5.1 \u5e38\u89c1\u95ee\u9898<\/h3>\n<p>\u6709\u53ef\u80fd\u4f1a\u78b0\u5230\u4f9d\u8d56\u7248\u672c\u51b2\u7a81\uff0c\u6574\u7406\u65e5\u5fd7\u4e4b\u540e\u5982\u4e0b<\/p>\n<div>\n<pre>2023-02-07 05:26:03.331 | ERROR: Cannot install octavia because these package versions have conflicting dependencies.\r\n2023-02-07 05:26:03.332 | \r\n2023-02-07 05:26:03.332 | The conflict is caused by:\r\n2023-02-07 05:26:03.332 |     keystonemiddleware 9.4.0 depends on oslo.cache&amp;gt;=1.26.0\r\n2023-02-07 05:26:03.332 |     The user requested (constraint) oslo-cache===2.10.1\r\n2023-02-07 05:26:03.332 | \r\n2023-02-07 05:26:03.332 | To fix this you could try to:\r\n2023-02-07 05:26:03.332 | 1. loosen the range of package versions you've specified\r\n2023-02-07 05:26:03.332 | 2. remove package versions to allow pip attempt to solve the dependency conflict\r\n2023-02-07 05:26:03.332 | \r\n2023-02-07 05:26:03.332 | ERROR: ResolutionImpossible: for help visit https:\/\/pip.pypa.io\/en\/latest\/topics\/dependency-resolution\/#dealing-with-dependency-conflicts\r\n2023-02-07 05:26:08.775 | Unmount \/tmp\/dib_build.vAReHkDS\/mnt\/var\/cache\/apt\/archives\r\n<\/pre>\n<\/div>\n<p>\u6216\u8005<\/p>\n<div>\n<pre>2023-02-07 06:58:49.465 |      \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 119.9\/119.9 kB 341.3 kB\/s eta 0:00:00\r\n2023-02-07 06:58:52.487 | ERROR: Cannot install octavia==11.0.1.dev16 because these package versions have conflicting dependencies.\r\n2023-02-07 06:58:52.488 | \r\n2023-02-07 06:58:52.488 | The conflict is caused by:\r\n2023-02-07 06:58:52.488 |     octavia 11.0.1.dev16 depends on octavia-lib&amp;gt;=3.1.0\r\n2023-02-07 06:58:52.488 |     The user requested (constraint) octavia-lib===2.5.0\r\n2023-02-07 06:58:52.488 | \r\n2023-02-07 06:58:52.488 | To fix this you could try to:\r\n2023-02-07 06:58:52.488 | 1. loosen the range of package versions you've specified\r\n2023-02-07 06:58:52.488 | 2. remove package versions to allow pip attempt to solve the dependency conflict\r\n2023-02-07 06:58:52.488 | \r\n2023-02-07 06:58:52.488 | ERROR: ResolutionImpossible: for help visit https:\/\/pip.pypa.io\/en\/latest\/topics\/dependency-resolution\/#dealing-with-dependency-conflicts\r\n2023-02-07 06:59:02.344 | Unmount \/tmp\/dib_build.AUyWgqMg\/mnt\/var\/cache\/apt\/archives\r\n\r\n<\/pre>\n<\/div>\n<p>\u8fd9\u4e2a\u4e4b\u540e\u9700\u8981\u624b\u52a8\u7f16\u8f91\u00a0upper-constraints.txt<\/p>\n<p>\u5148\u628a\u6587\u4ef6\u4e0b\u8f7d\u8fc7\u6765<\/p>\n<div>\n<pre>wget https:\/\/jihulab.com\/james-curtis\/requirements\/-\/raw\/stable\/zed\/upper-constraints.txt -O \/tmp\/upper-constraints.txt\r\n<\/pre>\n<\/div>\n<p>\u7136\u540e\u7f16\u8f91\u00a0upper-constraints.txt<\/p>\n<p>\u6ce8\u91ca\u51b2\u7a81\u7684\u8f6f\u4ef6\u5305<\/p>\n<div>\n<pre># oslo.cache===2.10.1\r\n# octavia-lib===2.5.0\r\n\r\n<\/pre>\n<\/div>\n<p>\u4fee\u6539\u73af\u5883\u53d8\u91cf<\/p>\n<div>\n<pre>export DIB_REPOLOCATION_upper_constraints=file:\/\/\/tmp\/upper-constraints.txt\r\n<\/pre>\n<\/div>\n<p>\u91cd\u65b0\u6784\u5efa\u955c\u50cf<\/p>\n<h2 id=\"_5-\u6fc0\u6d3boctavia\u6388\u6743\">#5. \u6fc0\u6d3boctavia\u6388\u6743<\/h2>\n<div>\n<pre>. \/etc\/kolla\/octavia-openrc.sh\r\n<\/pre>\n<\/div>\n<h2 id=\"_6-\u5728-glance-\u4e2d\u6ce8\u518c\u955c\u50cf\">#6.\u00a0\u5728 Glance \u4e2d\u6ce8\u518c\u955c\u50cf<\/h2>\n<div>\n<pre>openstack image create amphora-x64-haproxy.qcow2 --container-format bare --disk-format qcow2 --private --tag amphora --file \/root\/octavia\/diskimage-create\/amphora-x64-haproxy.qcow2 --property hw_architecture='x86_64' --property hw_rng_model=virtio\r\n<\/pre>\n<\/div>\n<h2 id=\"_7-\u9a8c\u8bc1\u7ed3\u679c\">#7. \u9a8c\u8bc1\u7ed3\u679c<\/h2>\n<h3 id=\"_7-1-\u9a8c\u8bc1\u547d\u4ee4\u884c\">#7.1 \u9a8c\u8bc1\u547d\u4ee4\u884c<\/h3>\n<p>\u5217\u51fa\u6240\u6709\u8d1f\u8f7d\u5747\u8861\u5668<\/p>\n<div>\n<pre>openstack loadbalancer list\r\n<\/pre>\n<\/div>\n<p>\u5982\u679c\u51fa\u73b0<\/p>\n<div>\n<pre>openstack: 'loadbalancer' is not an openstack command. See 'openstack --help'.\r\n<\/pre>\n<\/div>\n<p>\u5b89\u88c5 python-octaviaclient<\/p>\n<div>\n<pre>pip install python-octaviaclient<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Octavia\u8d1f\u8f7d\u5747\u8861\u670d\u52a1 Octavia \u4ee5\u670d\u52a1\u7684\u5f62\u5f0f\u63d0\u4f9b\u8d1f\u8f7d\u5747\u8861\u3002\u672c\u6307\u5357\u6db5\u76d6\u4e86\u4e3a\u00a0Amphora\u00a0\u9a71\u52a8\u7a0b\u5e8f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,3],"tags":[],"class_list":["post-12008","post","type-post","status-publish","format-standard","hentry","category-linux","category-system"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/12008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12008"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/12008\/revisions"}],"predecessor-version":[{"id":12009,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/12008\/revisions\/12009"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}