一、操作系統:centos7 1406 最小化安裝
openstack版本選取juno-eol
初學者openstack版本選擇問題:不要太老的版本,因爲pip安裝依賴時模塊大都寫的>=哪個版本,選擇太老的openstack版本會導致pip安裝時模塊太新各種衝突,最新版本也不行,坑還沒被人踩過,錯誤查不到,最好兩年左右的成熟版本,去github上找release查看以前的版本,如果能夠安裝成功,最好pip list命令保存一下各個模塊版本,否則以後相同命令可能會安裝不上1、時間同步
yum install ntp -y
service ntpd start
chkconfig ntpd on
2、內核參數調整
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
3、關閉(iptables或firewalld)和selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
或//看centos版本
/etc/init.d/iptables stop
chkconfig iptables off
vim /etc/selinux/config
SELINUX=disable
setenforce 0
4、安裝epel
yum install -y epel-release
5、安裝
yum install -y python-pip gcc gcc-c++ make libtool patch automake python-devel libxslt-devel MySQL-python openssl-devel libudev-devel git wget libvirt-python libvirt qemu-kvm gedit python-numdisplay device-mapper bridge-utils libffi-devel libffi lrzsz mariadb mariadb-server python2-PyMySQL rabbitmq-server httpd mod_wsgi memcached python-memcached
6、下載安裝包並解壓
7、啓動mysql和memcached和rabbitmq
//mysql////////////////////////////////////////////////////
vi /etc/my.cnf(在mysqld下添加)
default-storage-engine = innodb
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
systemctl enable mariadb.servicesystemctl start mariadb.service
mysqladmin -u root password openstack//添加密碼openstack
進入mysql
create database keystone;
grant all on keystone.* to keystone@'localhost' identified by 'keystone';//用戶名密碼都叫keystone
create database glance;
grant all on glance.* to glance@'localhost' identified by 'glance';//用戶名密碼都叫glance
create database nova;
grant all on nova.* to nova@'localhost' identified by 'nova';//用戶名密碼都叫nova
create database neutron;
grant all on neutron.* to neutron@'localhost' identified by 'neutron';//用戶名密碼都叫neutron
create database cinder;
grant all on cinder.* to cinder@'localhost' identified by 'cinder';//用戶名密碼都叫cinder
create database horizon//沒有這個,界面不需要數據庫
grant all on horizon.* to horizon@'192.168.0.0/255.255.0.0' identified by 'horizon';
執行後測試一下相關賬戶是否能登陸
例如keystone用戶keystone密碼
//rabitmq相關/////////////////////////////////////////////
chkconfig rabbitmq-server on
/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management
service rabbitmq-server start
//memcached相關///////////////////////////////////////////////////////
systemctl enable memcached.service
systemctl start memcached.service
8、安裝python模塊依賴
pip install --upgrade pip
可能需要:
pip install --upgrade setuptools (沒有相關報錯就不用執行)
//以下是統一安裝模式,也可以每個模塊獨立安裝相關依賴
cat */requirements.txt|sort -n|uniq>>openstack.txt
pip install -r openstack.txt
/////////////可選源
-i http://pypi.v2ex.com/simple/ --trusted-host pypi.v2ex.com
-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
在這個階段需要調整模塊版本才能成功,如果衝突可以嘗試安裝相關模塊允許的最小版本
9、安裝每個軟件
進入解壓的軟件目錄
git init(重要:一定要執行)
python setup.py install
後續還會繼續瞭解學習關於openStack的內容,敬請關注