標籤:openstack
說明: linux-node1 控制節點
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M02/8B/AF/wKiom1hU5e_DtuN7AAGCo_Jxwf0955.png-wh_500x0-wm_3-wmp_4-s_813833762.png" title="10.png" alt="wKiom1hU5e_DtuN7AAGCo_Jxwf0955.png-wh_50" />
linux-node2 計算節點
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M00/8B/AB/wKioL1hU5hThI49RAACYCvrsq68761.png-wh_500x0-wm_3-wmp_4-s_1002421992.png" title="11.png" alt="wKioL1hU5hThI49RAACYCvrsq68761.png-wh_50" />
2.1.兩台centos7伺服器
主機名稱: [[email protected] ~]# hostname linux-node1 [[email protected] ~]# hostname linux-node2
IP: linux-node1 192.168.56.11/24 linux-node2 192.168.56.12/24
host解析cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.11 linux-node1 linux-node1.oldboyedu.com 192.168.56.12 linux-node2 linux-node2.oldboyedu.com
2.2 selinux 和防火牆關閉
[[email protected] ~]# getenforce Disabled[[email protected] ~]# getenforce Disabled#可以用sedsed -i ‘/SELINUX/s/enforcing/disabled/‘ /etc/selinux/config防火牆:systemctl stop firewalldsystemctl disable firewalld
2.3 配置時間同步(兩台都做)
yum –y install chronygrep"allow" /etc/chrony.conf #開啟allow192.168/16systemctl enable chronyd.service #設定開機自啟systemctl start chronyd.service #啟動timedatectl set-timezone Asia/Shanghai #同步時區
2.4 在linux-node1 上安裝資料庫
yum install -y mariadb mariadb-serverMySQl-python #安裝資料庫\cp /usr/share/mysql/my-medium.cnf /etc/my.cnf #拷貝設定檔在vi /etc/my.cnf 添加如下幾行[mysqld]default-storage-engine = innodb #預設的儲存引擎innodb_file_per_table #使用獨享的資料表空間collation-server = utf8_general_ci #設定校對規則init-connect = ‘SET NAMES utf8‘ #設定連結的字元集character-set-server = utf8 #設定預設的字元集systemctl enable mariadb.service #開機啟動資料庫systemctl start mariadb.service #立馬啟動資料庫
2.5 初始化資料庫
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/8B/AB/wKioL1hU4nGAB8saAACCOQakVEI774.png-wh_500x0-wm_3-wmp_4-s_2508488259.png" title="1.png" alt="wKioL1hU4nGAB8saAACCOQakVEI774.png-wh_50" />
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/8B/AE/wKiom1hU4oDiGxw0AABzNIeisC0131.png-wh_500x0-wm_3-wmp_4-s_3775320117.png" title="2.png" alt="wKiom1hU4oDiGxw0AABzNIeisC0131.png-wh_50" />
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/8B/AE/wKiom1hU4qnyp9_aAAAx1RndX_g329.png-wh_500x0-wm_3-wmp_4-s_3673516163.png" title="3.png" alt="wKiom1hU4qnyp9_aAAAx1RndX_g329.png-wh_50" />
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/8B/AB/wKioL1hU4raS6oOfAABIkYdqK9E423.png-wh_500x0-wm_3-wmp_4-s_1457484279.png" title="4.png" alt="wKioL1hU4raS6oOfAABIkYdqK9E423.png-wh_50" />
2.6 為各個組件建立資料庫並收授權
2.6.1 keystone
MariaDB[(none)]> create database keystone;Query OK,1 row affected (0.01 sec)MariaDB[(none)]> grant all on keystone.* to ‘keystone‘@‘localhost‘ identified by‘keystonne‘;Query OK,0 rows affected (0.00 sec)MariaDB[(none)]> grant all on keystone.* to ‘keystone‘@‘%‘ identified by‘keystone‘;Query OK, 0 rows affected (0.00 sec)
2.6.2 glance
MariaDB[(none)]> create database glance;Query OK,1 row affected (0.00 sec)MariaDB[(none)]> grant all on glance.* to ‘glance‘@‘%‘ identified by ‘glance‘;Query OK,0 rows affected (0.00 sec)MariaDB[(none)]> grant all on glance.* to ‘glance‘@‘localhost‘ identified by‘glance‘;
2.6.3 nova和nova_api
MariaDB[(none)]> create database nova;Query OK,1 row affected (0.00 sec)MariaDB[(none)]> grant all on nova.* to ‘nova‘@‘%‘ identified by ‘nova‘;Query OK,0 rows affected (0.00 sec)MariaDB[(none)]> grant all on nova.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;Query OK,0 rows affected (0.00 sec)MariaDB[(none)]> create database nova_api;Query OK,1 row affected (0.00 sec)MariaDB[(none)]> grant all on nova_api.* to ‘nova‘@‘localhost‘ identified by‘nova‘;Query OK,0 rows affected (0.00 sec)MariaDB[(none)]> grant all on nova_api.* to ‘nova‘@‘%‘ identified by ‘nova‘;
2.6.4 neutron
MariaDB[(none)]> create database neutron;Query OK,1 row affected (0.00 sec)MariaDB[(none)]> grant all on neutron.* to ‘neutron‘@‘%‘ identified by ‘neutron‘;Query OK,0 rows affected (0.00 sec)MariaDB[(none)]> grant all on neutron.* to ‘neutron‘@‘localhost‘ identified by‘neutron‘;;Query OK,0 rows affected (0.00 sec)MariaDB[(none)]> flush privileges;Query OK, 0 rows affected (0.00 sec)
2.6.5 檢驗資料庫
MariaDB[(none)]> show databases;+--------------------+|Database |+--------------------+|information_schema ||glance ||keystone ||mysql ||neutron ||nova || nova_api ||performance_schema |+--------------------+8 rows inset (0.00 sec) MariaDB[(none)]>
2.7 安裝訊息佇列(rabbitmq)
2.7.1 基本安裝
yuminstall rabbitmq-server -ysystemctl enable rabbitmq-server.servicesystemctl start rabbitmq-server.service[[email protected]~]# rabbitmqctl add_user openstack openstack #建立訊息佇列認證使用者Creatinguser "openstack" ......done.[[email protected]~]##建立的使用者得授權才能使用[[email protected]~]# rabbitmqctl set_permissions openstack ".*" ".*"".*" #授權使用者才能使用Settingpermissions for user "openstack" in vhost "/" ......done.
2.7.2 web介面安裝
查看組件[[email protected]~]# rabbitmq-plugins list[ ]amqp_client 3.3.5[ ]cowboy 0.5.0-rmq3.3.5-git4b93c2d[ ]eldap 3.3.5-gite309de4[ ]mochiweb 2.7.0-rmq3.3.5-git680dba8[ ]rabbitmq_amqp1_0 3.3.5[ ]rabbitmq_auth_backend_ldap 3.3.5[ ]rabbitmq_auth_mechanism_ssl 3.3.5[ ]rabbitmq_consistent_hash_exchange 3.3.5[ ]rabbitmq_federation 3.3.5[ ]rabbitmq_federation_management 3.3.5[ ]rabbitmq_management 3.3.5[ ]rabbitmq_management_agent 3.3.5[ ]rabbitmq_management_visualiser 3.3.5[ ]rabbitmq_mqtt 3.3.5[ ]rabbitmq_shovel 3.3.5[ ]rabbitmq_shovel_management 3.3.5[ ]rabbitmq_stomp 3.3.5[ ]rabbitmq_test 3.3.5[ ]rabbitmq_tracing 3.3.5[ ]rabbitmq_web_dispatch 3.3.5[ ]rabbitmq_web_stomp 3.3.5[ ]rabbitmq_web_stomp_examples 3.3.5[ ]sockjs 0.3.4-rmq3.3.5-git3132eb9[ ]webmachine 1.10.3-rmq3.3.5-gite9359c7載入組件 rabbitmq-plugins enable rabbitmq_management systemctlrestart rabbitmq-server.service #重啟訊息佇列說明 rabbitmq監聽的是5672 rabbitmq的管理介面監聽的是15672
2.7.3 訪問測試
預設是使用者guest 密碼是guest
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M01/8B/AF/wKiom1hU5RzQcILLAABVABrSdPE989.png-wh_500x0-wm_3-wmp_4-s_2145992820.png" style="float:none;" title="5.png" alt="wKiom1hU5RzQcILLAABVABrSdPE989.png-wh_50" />
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/8B/AB/wKioL1hU5R3zLzMcAABfJkQYHl8207.png-wh_500x0-wm_3-wmp_4-s_443600511.png" style="float:none;" title="6.png" alt="wKioL1hU5R3zLzMcAABfJkQYHl8207.png-wh_50" />
讓openstack使用者擁有admistrator的許可權進行登入
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/8B/AF/wKiom1hU5R2zR5jqAABXB8SCcXI510.png-wh_500x0-wm_3-wmp_4-s_2194309750.png" style="float:none;" title="7.png" alt="wKiom1hU5R2zR5jqAABXB8SCcXI510.png-wh_50" />
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/8B/AB/wKioL1hU5R7CPE5iAABTm1hLQAM854.png-wh_500x0-wm_3-wmp_4-s_2997680611.png" style="float:none;" title="8.png" alt="wKioL1hU5R7CPE5iAABTm1hLQAM854.png-wh_50" />
本文出自 “磚家部落格” 部落格,請務必保留此出處http://wsxxsl.blog.51cto.com/9085838/1883586
2-openstack基礎環境準備