{"id":11998,"date":"2023-09-19T13:38:44","date_gmt":"2023-09-19T20:38:44","guid":{"rendered":"https:\/\/www.xh86.me\/?p=11998"},"modified":"2023-09-19T13:38:44","modified_gmt":"2023-09-19T20:38:44","slug":"openstack-zed-%e9%83%a8%e7%bd%b2","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=11998","title":{"rendered":"OpenStack Zed \u90e8\u7f72"},"content":{"rendered":"<h2 id=\"\u7cfb\u7edf\u8981\u6c42\">\u7cfb\u7edf\u8981\u6c42<\/h2>\n<p>\u5355\u673a\u90e8\u7f72\u6700\u4f4e\u914d\u7f6e\uff1a<\/p>\n<ul>\n<li>2\u5f20\u7f51\u5361<\/li>\n<li>8G\u5185\u5b58<\/li>\n<li>40G\u786c\u76d8\u7a7a\u95f4<\/li>\n<\/ul>\n<p>\u4e3b\u673a\u7cfb\u7edf\uff1a<\/p>\n<ul>\n<li>CentOS Stream 9<\/li>\n<li>Debian Bullseye (11)<\/li>\n<li>openEuler 22.03 LTS<\/li>\n<li>Rocky Linux 9- Ubuntu Jammy (22.04)<\/li>\n<\/ul>\n<blockquote><p>\u5b98\u65b9\u4e0d\u518d\u652f\u6301CentOS 7\u4f5c\u4e3a\u4e3b\u673a\u7cfb\u7edf\uff0c\u6211\u8fd9\u91cc\u4f7f\u7528\u7684\u662fRocky Linux 9.1\uff08\u6700\u5c0f\u5316\u5b89\u88c5\uff09<\/p><\/blockquote>\n<h2 id=\"_1-\u5b89\u88c5\u4f9d\u8d56\">#1. \u5b89\u88c5\u4f9d\u8d56<\/h2>\n<h3 id=\"_1-1-\u5b89\u88c5\u57fa\u7840\u4f9d\u8d56\">#1.1 \u5b89\u88c5\u57fa\u7840\u4f9d\u8d56<\/h3>\n<div>\n<pre>dnf install git python3-devel libffi-devel gcc openssl-devel python3-libselinux\r\n<\/pre>\n<\/div>\n<h3 id=\"_1-2-\u5b89\u88c5ansible\u989d\u5916\u9700\u8981\u7684\u5305\">#1.2 \u5b89\u88c5Ansible\u989d\u5916\u9700\u8981\u7684\u5305<\/h3>\n<p>\u5b98\u65b9\u6587\u6863\u4e2d\u6ca1\u6709\u8bf4\u660e\uff0c\u5b9e\u9645\u90e8\u7f72\u8fc7\u7a0b\u4e2d\uff0c\u6ca1\u6709\u8fd9\u4e24\u4e2a\u5305\u4f1a\u65e0\u6cd5\u4f7f\u7528pip\u5b89\u88c5\u7684ansible<\/p>\n<div>\n<pre>dnf install python3-resolvelib sshpass\r\n<\/pre>\n<\/div>\n<h3 id=\"_1-3-\u8bbe\u7f6epython-venv\u865a\u62df\u73af\u5883\">#1.3 \u8bbe\u7f6ePython-venv\u865a\u62df\u73af\u5883<\/h3>\n<p>\u4e3a\u4e86\u9632\u6b62\u4e0e\u7cfb\u7edf\u7684python\u73af\u5883\u51b2\u7a81\uff0c\u8fd9\u91cc\u4f7f\u7528\u865a\u62df\u73af\u5883\u5b89\u88c5ansible\u4e0ekolla-ansible\u00a0\/path\/to\/venv\u662f\u865a\u62df\u73af\u5883\u7684\u76ee\u5f55\uff0c\u53ef\u4ee5\u81ea\u5df1\u6307\u5b9a<\/p>\n<p>\u521b\u5efa\u865a\u62df\u73af\u5883<\/p>\n<div>\n<pre>python3 -m venv \/path\/to\/venv\r\n<\/pre>\n<\/div>\n<p>\u8fdb\u5165\u865a\u62df\u73af\u5883<\/p>\n<div>\n<pre>source \/path\/to\/venv\/bin\/activate\r\n<\/pre>\n<\/div>\n<blockquote><p>\u5728\u865a\u62df\u73af\u5883\u4e2d\u8f93\u5165deactivate\u547d\u4ee4\uff0c\u5373\u53ef\u9000\u51fa\u865a\u62df\u73af\u5883<\/p><\/blockquote>\n<p>\u66f4\u6362pip\u56fd\u5185\u6e90\uff0c\u66f4\u65b0pip<\/p>\n<div>\n<pre>pip config set global.index-url https:\/\/pypi.tuna.tsinghua.edu.cn\/simple\r\npip install -U pip\r\n<\/pre>\n<\/div>\n<h3 id=\"_1-4-\u5b89\u88c5ansible\">#1.4 \u5b89\u88c5Ansible<\/h3>\n<p>Kolla-ansible\u9700\u8981ansible 5\u7248\u672c\uff0c\u8fd9\u91cc\u9700\u8981\u6307\u5b9a\u7248\u672c\u5b89\u88c5<\/p>\n<div>\n<pre>pip install 'ansible&gt;=4,&lt;6'\r\n<\/pre>\n<\/div>\n<h2 id=\"_2-\u5b89\u88c5kolla-ansible\">#2. \u5b89\u88c5Kolla-ansible<\/h2>\n<h3 id=\"_2-1-\u5b89\u88c5\u672c\u4f53\">#2.1 \u5b89\u88c5\u672c\u4f53<\/h3>\n<div>\n<pre>pip install git+https:\/\/opendev.org\/openstack\/kolla-ansible@stable\/zed\r\n<\/pre>\n<\/div>\n<h3 id=\"_2-2-\u83b7\u53d6kolla\u914d\u7f6e\u6587\u4ef6\">#2.2 \u83b7\u53d6Kolla\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\u5939<\/p>\n<div>\n<pre>mkdir \/etc\/kolla\r\n<\/pre>\n<\/div>\n<p>\u590d\u5236global.yml\u4e0epassword.yml\u5230\u914d\u7f6e\u6587\u4ef6\u5939<\/p>\n<div>\n<pre>cp -r \/path\/to\/venv\/share\/kolla-ansible\/etc_examples\/kolla\/* \/etc\/kolla\r\n<\/pre>\n<\/div>\n<h3 id=\"_2-3-\u83b7\u53d6ansible\u6e05\u5355\u6587\u4ef6\">#2.3 \u83b7\u53d6Ansible\u6e05\u5355\u6587\u4ef6<\/h3>\n<p>\u590d\u5236all-in-one\u4e0emultinode\u4e24\u4e2a\u6e05\u5355\u6587\u4ef6\uff0c\u5206\u522b\u5bf9\u5e94\u4e86\u5355\u673a\u90e8\u7f72\u4e0e\u591a\u8282\u70b9\u90e8\u7f72<\/p>\n<div>\n<pre>cp \/path\/to\/venv\/share\/kolla-ansible\/ansible\/inventory\/* .\r\n<\/pre>\n<\/div>\n<h2 id=\"_3-\u5b89\u88c5ansible-galaxy\u4f9d\u8d56\">#3. \u5b89\u88c5Ansible Galaxy\u4f9d\u8d56<\/h2>\n<div>\n<pre>kolla-ansible install-deps\r\n<\/pre>\n<\/div>\n<h2 id=\"_4-\u914d\u7f6eansible\">#4. \u914d\u7f6eAnsible<\/h2>\n<blockquote><p>\u5355\u673a\u90e8\u7f72\u65f6\uff0c\u53ef\u4ee5\u8df3\u8fc7\u8fd9\u4e00\u6b65<\/p><\/blockquote>\n<p>\u7f16\u8f91\/etc\/ansible\/ansible.cfg\uff0c\u5982\u679c\u6ca1\u6709\u5219\u9700\u8981\u5148\u521b\u5efa\uff0c\u5c06\u4e0b\u9762\u7684\u5185\u5bb9\u6dfb\u52a0\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d<\/p>\n<div>\n<pre>[defaults]\r\nhost_key_checking=False\r\npipelining=True\r\nforks=100\r\n<\/pre>\n<\/div>\n<h2 id=\"_5-\u51c6\u5907\u521d\u59cb\u5316\u914d\u7f6e\">#5. \u51c6\u5907\u521d\u59cb\u5316\u914d\u7f6e<\/h2>\n<h3 id=\"_5-1-\u4fee\u6539hosts\">#5.1 \u4fee\u6539hosts<\/h3>\n<blockquote><p>\u5355\u673a\u90e8\u7f72\u65f6\uff0c\u53ef\u4ee5\u8df3\u8fc7\u8fd9\u4e00\u6b65<\/p><\/blockquote>\n<p>\u5728\u90e8\u7f72\u673a\u7684hosts\u4e2d\u6dfb\u52a0\u9700\u8981\u90e8\u7f72\u7684\u4e3b\u673a\u7684\u4e3b\u673a\u540d\uff0c\u540e\u7eed\u4f1a\u81ea\u52a8\u540c\u6b65\u5230\u6240\u6709\u8282\u70b9 \u7f16\u8f91\/etc\/hosts\u6587\u4ef6\uff0c\u6211\u8fd9\u91cc\u51c6\u5907\u90e8\u7f723\u53f0\u63a7\u5236\u8282\u70b9\u4e0e3\u53f0\u8ba1\u7b97\u8282\u70b9 (\u5171\u7528)<\/p>\n<div>\n<pre>10.0.0.10 control01.openstack.instack.cloud control01\r\n10.0.0.20 control02.openstack.instack.cloud control02\r\n10.0.0.21 control03.openstack.instack.cloud control03\r\n<\/pre>\n<\/div>\n<h3 id=\"_5-2-\u51c6\u5907\u6e05\u5355\u6587\u4ef6\">#5.2 \u51c6\u5907\u6e05\u5355\u6587\u4ef6<\/h3>\n<ul>\n<li>\u5355\u673a\u90e8\u7f72\u65f6\uff0c\u4f7f\u7528all-in-one\u6e05\u5355\u6587\u4ef6- \u591a\u8282\u70b9\u90e8\u7f72\u65f6\uff0c\u4f7f\u7528multinode\u6e05\u5355\u6587\u4ef6<\/li>\n<\/ul>\n<blockquote><p>\u5355\u673a\u90e8\u7f72\u65f6\uff0c\u53ef\u4ee5\u4e0d\u7528\u4fee\u6539all-in-one\u6e05\u5355\u6587\u4ef6<\/p><\/blockquote>\n<p>\u4e0b\u9762\u662f\u6211\u7684multinode\u6e05\u5355\u6587\u4ef6\u7684\u5f00\u5934\u90e8\u5206\uff0c\u4f9b\u53c2\u8003<\/p>\n<div>\n<pre>[all]\r\ncontrol01\r\ncontrol02\r\ncontrol03\r\n\r\n[control]\r\n# \u6307\u5b9aroot\u5bc6\u7801\u3001\u7ba1\u7406\u7f51\u5361\r\ncontrol01 # ansible_ssh_pass=\"root\"  network_interface=\"ens192\"\r\ncontrol02 # ansible_ssh_pass=\"root\"  network_interface=\"ens192\"\r\ncontrol03 # ansible_ssh_pass=\"root\"  network_interface=\"ens192\"\r\n\r\n\r\n[network:children]\r\n# \u53ef\u5728\u7ec4\u540d\u540e\u6dfb\u52a0:children\u6765\u5bf9\u7ec4\u8fdb\u884c\u5d4c\u5957\r\ncompute\r\n\r\n[compute]\r\n# \u6307\u5b9aroot\u5bc6\u7801\u3001\u7ba1\u7406\u7f51\u5361\u3001\u5916\u90e8\u7f51\u5361\r\ncontrol \r\n\r\n[monitoring:children]\r\ncontrol\r\n\r\n[deployment]\r\nlocalhost       ansible_connection=local\r\n<\/pre>\n<\/div>\n<blockquote><p>\u8be6\u7ec6\u7684\u914d\u7f6e\u89c4\u5219\u89c1\u00a0<a href=\"http:\/\/ansible.com.cn\/docs\/intro_inventory.html\" target=\"_blank\" rel=\"noopener noreferrer\">Ansible\u6587\u6863(opens new window)<\/a><\/p><\/blockquote>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6d4b\u8bd5Ansible\u7684\u8fde\u901a\u6027<\/p>\n<div>\n<pre>ansible -i multinode all -m ping\r\n<\/pre>\n<\/div>\n<h3 id=\"_5-3-\u751f\u6210\u5bc6\u7801\">#5.3 \u751f\u6210\u5bc6\u7801<\/h3>\n<div>\n<pre>kolla-genpwd\r\n<\/pre>\n<\/div>\n<blockquote><p>\u5bc6\u7801\u5b58\u50a8\u5728\/etc\/kolla\/passwords.yml\u4e2d<\/p><\/blockquote>\n<h3 id=\"_5-4-\u914d\u7f6e-global-yml\">#5.4 \u914d\u7f6e global.yml<\/h3>\n<p>\u955c\u50cf\u9009\u62e9<\/p>\n<p>Kolla\u53ef\u4ee5\u9009\u62e9\u591a\u79cd\u955c\u50cf\u7248\u672c\uff1a<\/p>\n<ul>\n<li>CentOS Stream (centos)- Debian (debian)- Rocky (rocky)- Ubuntu (ubuntu) \u5b98\u65b9\u63a8\u8350\u65b0\u5b89\u88c5\u7684\u4f7f\u7528rocky\u6216ubuntu\uff0c\u8fd9\u91cc\u4f7f\u7528\u548c\u4e3b\u673a\u76f8\u540c\u7684rocky\u53d1\u884c\u7248<\/li>\n<\/ul>\n<div>\n<p>\u63d0\u793a<\/p>\n<p>\u9ed8\u8ba4\u4e0d\u7528\u4fee\u6539<\/p>\n<\/div>\n<div>\n<pre>kolla_base_distro: \"rocky\"\r\n<\/pre>\n<\/div>\n<p>\u955c\u50cf\u4ed3\u5e93<\/p>\n<p>\u56fd\u5185\u53ef\u80fd\u8bbf\u95eequay.io\u6bd4\u8f83\u6162\uff0c\u53ef\u4ee5\u6307\u5b9a\u56fd\u5185\u7684quay.io\u6e90<\/p>\n<div>\n<pre>docker_registry: \"quay.nju.edu.cn\"\r\n<\/pre>\n<\/div>\n<div>\n<p>\u81ea\u5efa\u4ed3\u5e93<\/p>\n<div>\n<pre>docker_registry: \"hub.instack.cloud\"\r\n<\/pre>\n<\/div>\n<\/div>\n<p>\u7f51\u7edc<\/p>\n<p>\u7ba1\u7406\u7f51\u7edc\u7684\u7f51\u5361\uff0c\u4e5f\u7528\u4e8e\u4e3b\u673a\u4e4b\u95f4\u7684\u901a\u4fe1<\/p>\n<div>\n<pre>network_interface: \"eth0\"\r\n\r\n<\/pre>\n<\/div>\n<p>\u8fde\u63a5\u5916\u90e8\u7f51\u7edc\u7684\u7f51\u5361\uff0c\u9700\u8981\u4e00\u4e2a\u5f00\u542f\u7684\uff0c\u6ca1\u6709\u914d\u7f6eIP\u7684\u7f51\u5361<\/p>\n<div>\n<pre>neutron_external_interface: \"eth1\"\r\n<\/pre>\n<\/div>\n<p>\u7528\u4e8e\u7ba1\u7406\u7684\u6d6e\u52a8IP\uff0c\u7531keepalived\u63d0\u4f9b\u9ad8\u53ef\u7528\u6027\uff0c\u5fc5\u987b\u662f\u7ba1\u7406\u7f51\u7edc\u4e2d\u6ca1\u6709\u88ab\u4f7f\u7528\u7684\u5730\u5740<\/p>\n<div>\n<pre>kolla_internal_vip_address: \"10.0.0.250\"\r\n<\/pre>\n<\/div>\n<p>\u76d1\u63a7<\/p>\n<div>\n<pre>enable_prometheus\r\n<\/pre>\n<\/div>\n<p>\u4e2d\u5fc3\u65e5\u5fd7<\/p>\n<div>\n<pre>enable_central_logging: \"yes\"\r\nenable_venus: \"yes\"\r\n<\/pre>\n<\/div>\n<blockquote><p>global.yml\u4e2d\u6240\u6709\u7684\u9009\u9879\uff0c\u90fd\u53ef\u4ee5\u5728\u6e05\u5355\u6587\u4ef6\u4e2d\u4e3a\u6bcf\u4e2a\u4e3b\u673a\u5355\u72ec\u914d\u7f6e\u3002\u4e0a\u9762\u7684multinode\u6587\u4ef6\u4e2d\uff0c\u6307\u5b9a\u4e86\u6bcf\u53f0\u4e3b\u673a\u7684\u7ba1\u7406\u7f51\u5361\u4e0e\u5916\u90e8\u7f51\u5361\u3002<\/p><\/blockquote>\n<h2 id=\"_6-\u90e8\u7f72\">#6. \u90e8\u7f72<\/h2>\n<p>\u6211\u8fd9\u91cc\u91c7\u7528\u591a\u8282\u70b9\u90e8\u7f72\uff0c\u4f7f\u7528\u7684\u662fmultinode\u6e05\u5355\u6587\u4ef6\uff0c\u5355\u673a\u90e8\u7f72\u8bf7\u4f7f\u7528all-in-one\u6e05\u5355\u6587\u4ef6<\/p>\n<p>\u5f15\u5bfc\u670d\u52a1\u5668<\/p>\n<div>\n<pre>kolla-ansible -i .\/multinode bootstrap-servers\r\n\r\n<\/pre>\n<\/div>\n<p>\u90e8\u7f72\u524d\u68c0\u67e5<\/p>\n<div>\n<pre>kolla-ansible -i .\/multinode prechecks\r\n\r\n<\/pre>\n<\/div>\n<p>\u5f00\u59cb\u90e8\u7f72<\/p>\n<div>\n<pre>kolla-ansible -i .\/multinode deploy\r\n\r\n<\/pre>\n<\/div>\n<h2 id=\"_7-\u4f7f\u7528openstack\">#7. \u4f7f\u7528OpenStack<\/h2>\n<h3 id=\"_7-1-\u547d\u4ee4\u884c-openstack-cli\">#7.1 \u547d\u4ee4\u884c\uff08OpenStack CLI\uff09<\/h3>\n<p>\u5b89\u88c5CLI\u5ba2\u6237\u7aef<\/p>\n<div>\n<pre>pip install python-openstackclient -c https:\/\/releases.openstack.org\/constraints\/upper\/zed\r\n<\/pre>\n<\/div>\n<p>\u751f\u6210openrc\u6587\u4ef6<\/p>\n<div>\n<pre>kolla-ansible post-deploy\r\n<\/pre>\n<\/div>\n<p>\u4f7f\u7528openrc\u6587\u4ef6<\/p>\n<div>\n<pre>. \/etc\/kolla\/admin-openrc.sh\r\n<\/pre>\n<\/div>\n<p>\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u4f7f\u7528OpenStack CLI\u4e86<\/p>\n<h3 id=\"_7-2-\u7f51\u9875-horizon\">#7.2 \u7f51\u9875\uff08Horizon\uff09<\/h3>\n<p>\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95eekolla_internal_vip_address\uff0c\u8f93\u5165\u8d26\u53f7\u5bc6\u7801\u5373\u53ef<\/p>\n<blockquote><p>\u8d26\u53f7\u5bc6\u7801\u53ef\u5728openrc\u6587\u4ef6\u4e2d\u67e5\u770b<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u7edf\u8981\u6c42 \u5355\u673a\u90e8\u7f72\u6700\u4f4e\u914d\u7f6e\uff1a 2\u5f20\u7f51\u5361 8G\u5185\u5b58 40G\u786c\u76d8\u7a7a\u95f4 \u4e3b\u673a\u7cfb\u7edf\uff1a CentOS Stream 9  [&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-11998","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\/11998","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=11998"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11998\/revisions"}],"predecessor-version":[{"id":11999,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11998\/revisions\/11999"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}