{"id":6862,"date":"2017-07-13T10:11:21","date_gmt":"2017-07-13T02:11:21","guid":{"rendered":"http:\/\/rmohan.com\/?p=6862"},"modified":"2017-07-13T10:11:21","modified_gmt":"2017-07-13T02:11:21","slug":"centos-7-2-installation-deployment-openstack-tutorial","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6862","title":{"rendered":"CentOS 7.2 Installation Deployment OpenStack Tutorial"},"content":{"rendered":"<p><strong>CentOS 7.2 Installation Deployment OpenStack Tutorial<\/strong><\/p>\n<p><strong>Environmental preparation<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Share CentOS 7.2 installation deployment OpenStack tutorial, we want to help.<\/p>\n<p>1, the system environment<\/p>\n<p># Uname -r<\/p>\n<p>3.10.0-327.el7.x86_64<\/p>\n<p># Cat \/ etc \/ RedHat -release<\/p>\n<p>CentOS Linux release 7.2.1511 (Core)<\/p>\n<p>2, the server deployment<\/p>\n<p>IP<\/p>\n<p>CPU name<\/p>\n<p>Character<\/p>\n<p>Configuration<\/p>\n<p>192.168.56.108<\/p>\n<p>Controller<\/p>\n<p>Control node<\/p>\n<p>M: 4G; C: 2C; 50G<\/p>\n<p>192.168.56.109<\/p>\n<p>Compute<\/p>\n<p>Calculate nodes<\/p>\n<p>M: 2G; C: 2C; 50G<\/p>\n<p>3, the basic environment to prepare<\/p>\n<p>3.1, configure hosts<\/p>\n<p># Cat \/ etc \/ hosts<\/p>\n<p>192.168.56.108 controller<\/p>\n<p>192.168.56.109 compute<\/p>\n<p>3.2, configure the time synchronization<\/p>\n<p>[Root @ controller ~] # yum install -y ntp<\/p>\n<p>[Root @ controller ~] # vim \/etc\/ntp.conf<\/p>\n<p>15 restrict -6 :: 1<\/p>\n<p>16 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap<\/p>\n<p>27 restrict 0.centos.pool.ntp.org nomodify notrap noquery<\/p>\n<p>28 restrict 1.centos.pool.ntp.org nomodify notrap noquery<\/p>\n<p>29 restrict 2.centos.pool.ntp.org nomodify notrap noquery<\/p>\n<p>30 restrict 3.centos.pool.ntp.org nomodify notrap noquery<\/p>\n<p>31 server 127.127.1.0<\/p>\n<p>32 fudge 127.127.1.0 stratum 10<\/p>\n<p>[Root @ controller ~] # systemctl enable ntpd<\/p>\n<p>[Root @ controller ~] # systemctl start ntpd<\/p>\n<p>Configure timing tasks on the control node and compute nodes<\/p>\n<p>[Root @ compute ~] # crontab -l * \/ 5 * * * * \/ usr \/ sbin \/ ntpdate 192.168.56.108&gt; \/ dev \/ null 2&gt; &amp; 1<\/p>\n<p>3.3, turn off the firewall<\/p>\n<p># Systemctl stop firewalld<\/p>\n<p>3.4, close selinux<\/p>\n<p># SELINUX = disabled \/ etc \/ selinux \/ config \/\/ need to reboot<\/p>\n<p>3.5, install the basic package<\/p>\n<p>[Root @ controller ~] # yum install -yhttp: \/\/ dl. Fedora project.org\/pub\/epel\/7\/x86_64\/e\/epel-release-7-7.noarch.rpm<\/p>\n<p>[Root @ controller ~] # yum install -y centos-release-openstack-liberty<\/p>\n<p>[Root @ controller ~] # yum install -y python-openstackclient<\/p>\n<p>3.6, install mysql<\/p>\n<p>[Root @ controller ~] # yum install -y mariadb mariadb-server mysql-python<\/p>\n<p>[Root @ controller ~] # vim \/etc\/my.cnf<\/p>\n<p>Add the following lines in the mysqld module:<\/p>\n<p>Default-storage-engine = innodb<\/p>\n<p>Innodb_file_per_table<\/p>\n<p>Collation-server = utf8_general_ci<\/p>\n<p>Init-connect = &#8216;SET NAMES utf8&#8217;<\/p>\n<p>Character-set-server = utf8<\/p>\n<p>[Root @ controller ~] # systemctl enable mariadb.service<\/p>\n<p>[Root @ controller ~] # systemctl start mariadb.service<\/p>\n<p>[Root @ controller ~] # mysql_secure_installation<\/p>\n<p>3.7, install rabbitmq<\/p>\n<p>[Root @ controller ~] # yum install-y rabbitmq-server<\/p>\n<p>[Root @ controller ~] # systemctl enable rabbitmq-server.service<\/p>\n<p>[Root @ controller ~] # systemctl start rabbitmq-server.service<\/p>\n<p>[Root @ controller ~] # rabbitmqctl add_user openstack openstack<\/p>\n<p>Creating user &#8220;openstack&#8221; &#8230;<\/p>\n<p>&#8230; done.<\/p>\n<p>[Root @ controller ~] # rabbitmqctl set_permissions openstack &#8216;. *&#8217; &#8216;. *&#8217; &#8216;. *&#8217;<\/p>\n<p>Setting permissions for user &#8220;openstack&#8221; in vhost &#8220;\/&#8221; &#8230;<\/p>\n<p>&#8230; done.<\/p>\n<p>[Root @ controller ~] # rabbitmqctl set_user_tags openstack administrator<\/p>\n<p>[Root @ controller ~] # rabbitmq-plugins enable rabbitmq_management<\/p>\n<p>[Root @ controller ~] # systemctl restart rabbitmq-server.service<\/p>\n<p>In the browser, enter http:\/\/192.168.56.108:15672, the default account and password for the guest<\/p>\n<p>Login will be created before the openstack users to join admin, the results are as follows:<\/p>\n<p>&nbsp;<\/p>\n<p>[root@controller ~]# mysql -u root -p<br \/>\n[root@controller ~]# CREATE DATABASE keystone;<br \/>\n[root@controller ~]# GRANT ALL PRIVILEGES ON keystone.* TO &#8216;keystone&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;PWS&#8217;;<br \/>\n[root@controller ~]# GRANT ALL PRIVILEGES ON keystone.* TO &#8216;keystone&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;PWS&#8217;;<br \/>\n[root@controller ~]# openssl rand -hex 10<br \/>\n2?keystone<\/p>\n<p>yum install openstack-keystone httpd mod_wsgi python-openstackclient memcached python-memcached<br \/>\n3?memcache<\/p>\n<p># systemctl enable memcached.service<br \/>\n# systemctl start memcached.service<br \/>\n4?<\/p>\n<p>Edit the \/etc\/keystone\/keystone.conf file and complete the following actions:<br \/>\nIn the [DEFAULT] section, define the value of the initial administration token:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n[DEFAULT]<br \/>\n&#8230;<br \/>\nadmin_token = ADMIN_TOKEN<br \/>\nReplace ADMIN_TOKEN with the random value that you generated in a previous step.<br \/>\nIn the [database] section, configure database access:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n[database]<br \/>\n&#8230;<br \/>\nconnection = mysql:\/\/keystone:KEYSTONE_DBPASS@controller\/keystone<br \/>\nReplace KEYSTONE_DBPASS with the password you chose for the database.<br \/>\nIn the [memcache] section, configure the Memcache service:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n[memcache]<br \/>\n&#8230;<br \/>\nservers = localhost:11211<br \/>\nIn the [token] section, configure the UUID token provider and Memcached driver:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n[token]<br \/>\n&#8230;<br \/>\nprovider = keystone.token.providers.uuid.Provider<br \/>\ndriver = keystone.token.persistence.backends.memcache.Token<br \/>\nIn the [revoke] section, configure the SQL revocation driver:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n[revoke]<br \/>\n&#8230;<br \/>\ndriver = keystone.contrib.revoke.backends.sql.Revoke<br \/>\n(Optional) To assist with troubleshooting, enable verbose logging in the [DEFAULT] section:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n[DEFAULT]<br \/>\n&#8230;<br \/>\nverbose = True<br \/>\nPopulate the Identity service database:<br \/>\n# su -s \/bin\/sh -c &#8220;keystone-manage db_sync&#8221; keystone<br \/>\n5?HTTP<\/p>\n<p>Edit the \/etc\/httpd\/conf\/httpd.conf file and configure the ServerName option to reference the controller node:<br \/>\nServerName controller<br \/>\nCreate the \/etc\/httpd\/conf.d\/wsgi-keystone.conf file with the following content:<br \/>\nListen 5000<br \/>\nListen 35357<\/p>\n<p>&lt;VirtualHost *:5000&gt;<br \/>\nWSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}<br \/>\nWSGIProcessGroup keystone-public<br \/>\nWSGIScriptAlias \/ \/var\/www\/cgi-bin\/keystone\/main<br \/>\nWSGIApplicationGroup %{GLOBAL}<br \/>\nWSGIPassAuthorization On<br \/>\nLogLevel info<br \/>\nErrorLogFormat &#8220;%{cu}t %M&#8221;<br \/>\nErrorLog \/var\/log\/httpd\/keystone-error.log<br \/>\nCustomLog \/var\/log\/httpd\/keystone-access.log combined<br \/>\n&lt;\/VirtualHost&gt;<\/p>\n<p>&lt;VirtualHost *:35357&gt;<br \/>\nWSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}<br \/>\nWSGIProcessGroup keystone-admin<br \/>\nWSGIScriptAlias \/ \/var\/www\/cgi-bin\/keystone\/admin<br \/>\nWSGIApplicationGroup %{GLOBAL}<br \/>\nWSGIPassAuthorization On<br \/>\nLogLevel info<br \/>\nErrorLogFormat &#8220;%{cu}t %M&#8221;<br \/>\nErrorLog \/var\/log\/httpd\/keystone-error.log<br \/>\nCustomLog \/var\/log\/httpd\/keystone-access.log combined<br \/>\n&lt;\/VirtualHost&gt;<br \/>\nCreate the directory structure for the WSGI components:<br \/>\n# mkdir -p \/var\/www\/cgi-bin\/keystone<br \/>\nCopy the WSGI components from the upstream repository into this directory:<br \/>\n# curl http:\/\/git.openstack.org\/cgit\/openstack\/keystone\/plain\/httpd\/keystone.py?h=stable\/kilo | tee \/var\/www\/cgi-bin\/keystone\/main \/var\/www\/cgi-bin\/keystone\/admin<br \/>\nAdjust ownership and permissions on this directory and the files in it:<br \/>\n# chown -R keystone:keystone \/var\/www\/cgi-bin\/keystone<br \/>\n# chmod 755 \/var\/www\/cgi-bin\/keystone\/*<br \/>\nRestart the Apache HTTP server:<br \/>\n# systemctl enable httpd.service<br \/>\n# systemctl start httpd.service<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 7.2 Installation Deployment OpenStack Tutorial<\/p>\n<p>Environmental preparation<\/p>\n<p>&nbsp;<\/p>\n<p>Share CentOS 7.2 installation deployment OpenStack tutorial, we want to help.<\/p>\n<p>1, the system environment<\/p>\n<p># Uname -r<\/p>\n<p>3.10.0-327.el7.x86_64<\/p>\n<p># Cat \/ etc \/ RedHat -release<\/p>\n<p>CentOS Linux release 7.2.1511 (Core)<\/p>\n<p>2, the server deployment<\/p>\n<p>IP<\/p>\n<p>CPU name<\/p>\n<p>Character<\/p>\n<p>Configuration<\/p>\n<p>192.168.56.108<\/p>\n<p>Controller<\/p>\n<p>Control node<\/p>\n<p>M: 4G; [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6862"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6862"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6862\/revisions"}],"predecessor-version":[{"id":6863,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6862\/revisions\/6863"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}