openstack平臺搭建步驟 openstack搭建教程

多條告白如次劇本只需引入一次
OpenStack安置安置
一、普通籌備處事
安置情況:CentOS 7 64
1、封閉當地iptables風火墻并樹立開機不自啟用
# systemctl stop firewalld.service# systemctl disable firewalld.service2、封閉當地selinux風火墻
# vim /etc/sysconfig/selinux SELINUX=disabled# setenforce 03、樹立長機計劃機稱呼
# hostnamectl set-hostname controller4、當地長機稱呼和ip的領會
# vim /etc/hosts192.168.0.104 controller5、安置ntp功夫校準東西
# yum -y install ntp# ntpdate asia.pool.ntp.org6、安置第三方yum源
# yum -y install yum-plugin-priorities# yum -y install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm# yum -y install http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm7、晉級體例軟硬件包并從新體例
# yum upgrade# reboot二、安置擺設mariadb數據庫
1、安置mariadb數據庫
# yum -y install mariadb mariadb-server MySQL-python2、擺設mariadb數據庫
# cp /etc/my.cnf /etc/my.cnf.bak# rpm -ql mariadb# vim /etc/my.cnf.d/server.cnf[mysqld]bind-address = 0.0.0.0default-storage-engine = innodbinnodb_file_per_tablecollation-server = utf8_general_ciinit-connect = 'SET NAMES utf8'character-set-server = utf83、啟用mariadb數據庫
# systemctl enable mariadb.service# systemctl start mariadb.service三、安置動靜部隊效勞
1、安置rabbit所需軟硬件包
# yum -y install rabbitmq-server2、啟用rabbit效勞
# systemctl enable rabbitmq-server.service# systemctl start rabbitmq-server.service3、樹立rabbit效勞暗號
# rabbitmqctl change_password guest rabbit四、安置keyston用戶認證組件
1、創造keystone數據庫和受權用戶
mysql -u root -pCREATE DATABASE keystone;GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';2、安置keystone組件包
# yum -y install openstack-utils openstack-keystone python-keystoneclient3、擺設keystone文獻
# cp /etc/keystone/keystone.conf /etc/keystone/keystone.conf.bak# vim /etc/keystone/keystone.conf [DEFAULT]verbose = True[database]connection = mysql://keystone:keystone@controller/keystone[token]provider = keystone.token.providers.uuid.Providerdriver = keystone.token.persistence.backends.sql.Token4、創造文憑和秘鑰文獻
# keystone-manage pki_setup --keystone-user keystone --keystone-group keystone# chown -R keystone:keystone /var/log/keystone# chown -R keystone:keystone /etc/keystone/ssl# chmod -R o-rwx /etc/keystone/ssl5、同步keystone到mariadb數據庫
# su -s /bin/sh -c "keystone-manage db_sync" keystone6、啟用keystone效勞并開機自啟用
# systemctl enable openstack-keystone.service# systemctl start openstack-keystone.service7、廢除過時的令牌
默許情景下,身份效勞保存在數據庫中過時的令牌無窮 。到時令牌的積聚大大減少數據庫的巨細,大概會貶低效勞的本能,更加是在資源有限的情況中 。咱們倡導您運用cron擺設一個周期性工作,廢除過時的令牌時
# (crontab -l -u keystone 2>&1 | grep -q token_flush) ||echo '@hourly /usr/bin/keystone-manage token_flush >/var/log/keystone/keystone-tokenflush.log 2>&1'>> /var/spool/cron/keystone—————————-Create tenants,user,and roles———————————
1、擺設admin的token
# export OS_SERVICE_TOKEN=$(openssl rand -hex 10)# export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0# echo $OS_SERVICE_TOKEN > ~/ks_admin_token# openstack-config --set /etc/keystone/keystone.conf DEFAULT admin_token$OS_SERVICE_TOKEN# service openstack-keystone restart2、創造tenant、user and role
a.Create the admin tenant、user、role# keystone tenant-create --name admin --description "Admin Tenant"# keystone user-create --name admin --pass admin --email admin@zhengyansheng.com# keystone role-create --name adminb.Add the admin tenant and user to the admin role:# keystone user-role-add --tenant admin --user admin --role adminc.By default, the dashboard limits access to users with the _member_ role.# keystone role-create --name _member_d.Add the admin tenant and user to the _member_ role:# keystone user-role-add --tenant admin --user admin --role _member_3、創造一個普遍demo名目和用戶
a.Create the demo tenant:# keystone tenant-create --name demo --description "Demo Tenant"b.Create the demo user:# keystone user-create --name demo --pass demo --email demo@zhengyansheng.comc.Add the demo tenant and user to the _member_ role:# keystone user-role-add --tenant demo --user demo --role _member_4、創造一個service名目
# keystone tenant-create --name service --description "Service Tenant"————————Create the service entity and API endpoint————————

推薦閱讀