##2.基礎服務(SQl,RabbitMQ)--openstack

來源:互聯網
上載者:User

標籤:plugin   min   key   mysq   mys   character   for   基礎   訊息佇列   

2-基礎服務(SQl,RabbitMQ)

 

##2.基礎服務(MysqlSQL,RabbitMQ)#SQL root密碼DBPass=open2017# #------------------#SQL資料庫yum install mariadb mariadb-server python2-PyMySQL -ycp /etc/my.cnf.d/openstack.cnf{,.bak}echo "#[mysqld]bind-address = 0.0.0.0default-storage-engine = innodbinnodb_file_per_tablemax_connections = 4096collation-server = utf8_general_cicharacter-set-server = utf8#">/etc/my.cnf.d/openstack.cnf#啟動資料庫服務systemctl enable mariadb.servicesystemctl start mariadb.servicenetstat -antp|grep mysqld#mysql_secure_installation #初始化設定密碼,自動互動[[ -f /usr/bin/expect ]] || { yum install expect -y; } #若沒expect則安裝/usr/bin/expect << EOFset timeout 30spawn mysql_secure_installationexpect {    "enter for none" { send "\r"; exp_continue}    "Y/n" { send "Y\r" ; exp_continue}    "password:" { send "$DBPass\r"; exp_continue}    "new password:" { send "$DBPass\r"; exp_continue}    "Y/n" { send "Y\r" ; exp_continue}    eof { exit }}EOF#測試mysql -u root -p$DBPass -e "show databases;"[ $? = 0 ] || { echo "mariadb初始化失敗";exit; }#資料庫配置,建立資料庫、使用者授權#mysql -u root -p mysql -u root -p$DBPass -e "create database keystone;grant all privileges on keystone.* to ‘keystone‘@‘localhost‘ identified by ‘keystone‘;grant all privileges on keystone.* to ‘keystone‘@‘%‘ identified by ‘keystone‘;create database glance;grant all privileges on glance.* to ‘glance‘@‘localhost‘ identified by ‘glance‘;grant all privileges on glance.* to ‘glance‘@‘%‘ identified by ‘glance‘;create database nova;grant all privileges on nova.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;grant all privileges on nova.* to ‘nova‘@‘%‘ identified by ‘nova‘;create database nova_api;grant all privileges on nova_api.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;grant all privileges on nova_api.* to ‘nova‘@‘%‘ identified by ‘nova‘;create database nova_cell0;grant all privileges on nova_cell0.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;grant all privileges on nova_cell0.* to ‘nova‘@‘%‘ identified by ‘nova‘;create database neutron;grant all privileges on neutron.* to ‘neutron‘@‘localhost‘ identified by ‘neutron‘;grant all privileges on neutron.* to ‘neutron‘@‘%‘ identified by ‘neutron‘;flush privileges;select user,host from mysql.user;show databases;"## create database cinder;# grant all privileges on cinder.* to ‘cinder‘@‘localhost‘ identified by ‘cinder‘;# grant all privileges on cinder.* to ‘cinder‘@‘%‘ identified by ‘cinder‘;# #------------------sleep 1# #------------------#RabbitMQ #訊息佇列yum -y install erlang socatyum install -y rabbitmq-server#啟動 rabbitmq ,連接埠5672systemctl enable rabbitmq-server.servicesystemctl start rabbitmq-server.servicerabbitmq-plugins enable rabbitmq_management  #啟動web外掛程式連接埠15672#添加使用者及密碼rabbitmqctl  add_user admin adminrabbitmqctl  set_user_tags admin administratorrabbitmqctl add_user openstack openstack rabbitmqctl set_permissions openstack ".*" ".*" ".*" rabbitmqctl  set_user_tags openstack administratorsystemctl restart rabbitmq-server.servicenetstat -antp|grep ‘5672‘# rabbitmq-plugins list  #查看支援的外掛程式# lsof -i:15672#訪問RabbitMQ,訪問地址是http://ip:15672#預設使用者名密碼都是guest,瀏覽器添加openstack使用者到組並登陸測試

 

##2.基礎服務(SQl,RabbitMQ)--openstack

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.