這篇文章主要講解了“openstack的安裝步驟”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“openstack的安裝步驟”吧!
主要從事網(wǎng)頁(yè)設(shè)計(jì)、PC網(wǎng)站建設(shè)(電腦版網(wǎng)站建設(shè))、wap網(wǎng)站建設(shè)(手機(jī)版網(wǎng)站建設(shè))、成都響應(yīng)式網(wǎng)站建設(shè)公司、程序開發(fā)、微網(wǎng)站、微信小程序定制開發(fā)等,憑借多年來(lái)在互聯(lián)網(wǎng)的打拼,我們?cè)诨ヂ?lián)網(wǎng)網(wǎng)站建設(shè)行業(yè)積累了豐富的成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、網(wǎng)絡(luò)營(yíng)銷經(jīng)驗(yàn),集策劃、開發(fā)、設(shè)計(jì)、營(yíng)銷、管理等多方位專業(yè)化運(yùn)作于一體,具備承接不同規(guī)模與類型的建設(shè)項(xiàng)目的能力。
https://docs.openstack.org/mitaka/zh_CN/install-guide-ubuntu/keystone-install.html
在 [database] 部分,配置數(shù)據(jù)庫(kù)訪問(wèn):
[database]
...
connection = MySQL+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone
controller要改為ip,要不然會(huì)連不上數(shù)據(jù)庫(kù)
配置 Apache HTTP 服務(wù)器
編輯``/etc/apache2/apache2.conf``文件,為控制節(jié)點(diǎn)配置``ServerName``選項(xiàng):
ServerName controller
controller要改為ip
配置Linuxbridge代理?
Linuxbridge代理為實(shí)例建立layer-2虛擬網(wǎng)絡(luò)并且處理安全組規(guī)則。
編輯``/etc/neutron/plugins/ml2/linuxbridge_agent.ini``文件并且完成以下操作:
在``[linux_bridge]``部分,將公共虛擬網(wǎng)絡(luò)和公共物理網(wǎng)絡(luò)接口對(duì)應(yīng)起來(lái):
[linux_bridge]
physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
PROVIDER_INTERFACE_NAME改為機(jī)器實(shí)際網(wǎng)口名稱,比如eth0
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
> --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Cannot add a NOT NULL column with default value NULL [SQL: u'ALTER TABLE address_scopes ADD COLUMN ip_version INTEGER NOT NULL']
報(bào)錯(cuò)原因是neutron配置文件(/etc/neutron/neutron.conf)中原先的connection字段未注掉,導(dǎo)致新配得connection被原先的覆蓋掉了,原先默認(rèn)的還使用sqlite3...
dashboard 輸入 default/admin/huawei,登錄認(rèn)證失敗,查看apach error.log,用戶 admin 登錄失敗。檢查dashboard配置文件,有一項(xiàng)配置有問(wèn)題:
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3.0" % OPENSTACK_HOST
正確的應(yīng)為:
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
解決完上一個(gè)問(wèn)題后,登錄不再提示認(rèn)證失敗,但還是無(wú)法登錄,查看apach日志:
[Thu Jun 22 12:23:38.272490 2017] [:error] [pid 3107:tid 3051838272] Could not process panel theme_preview: Dashboard with slug "developer" is not registered.
[Thu Jun 22 12:23:41.487565 2017] [:error] [pid 3107:tid 3051838272] Login successful for user "admin".
實(shí)在找不出什么原因,換Chrome登錄,居然登錄成功了(Firefox和IE都不行)
root@ubuntu:~# pvcreate /dev/sdc
Device /dev/sdc not found (or ignored by filtering).
硬盤已添加,但創(chuàng)建還是失敗,原因是 /etc/lvm/lvm.conf 中 filter字段,沒(méi)有把sdc加入accept
neutron subnet-create --name provider \
--allocation-pool start=START_IP_ADDRESS,end=END_IP_ADDRESS \
--DNS-nameserver DNS_RESOLVER --gateway PROVIDER_NETWORK_GATEWAY \
provider PROVIDER_NETWORK_CIDR
START_IP_ADDRESS用192.168.1.100
END_IP_ADDRESS用192.168.1.200
DNS_RESOLVER用192.168.1.1
PROVIDER_NETWORK_GATEWAY用192.168.1.1
PROVIDER_NETWORK_CIDR用 192.168.1.0/24
openstack server create --flavor m1.tiny --image cirros \
--nic net-id=PROVIDER_NET_ID --security-group default \
--key-name mykey provider-instance
指定key_name就會(huì)報(bào)錯(cuò):
Invalid key_name provided. (HTTP 400) (Request-ID: req-5f12f3e7-5ff9-4a1a-932e-ebd936de1be1)
不指定key_name也能創(chuàng)建
manila文件共享服務(wù),選項(xiàng)1是lvm,本地文件系統(tǒng),選項(xiàng)2通過(guò)driver,分布式文件系統(tǒng)
社區(qū)版自帶manila的Horizon插件,M版本默認(rèn)沒(méi)有manila的Horizon插件,所以在Dashboard上看不到manila的操作。
https://github.com/openstack/manila-ui
先安裝git
apt-get install git
從github下載horizon和manila-ui的代碼
git clone https://github.com/openstack/horizon
git clone https://github.com/openstack/manila-ui
安裝gcc
apt-get install gcc
安裝python-dev
sudo apt-get install python-dev
安裝python-pip
apt-get install python-pip
cd horizon
python tools/install_venv.py
dashboard登陸后,提示錯(cuò)誤,apach日志:
RuntimeError: Unable to create a new session key. It is likely that the cache is unavailab
解決方法:
vi /etc/openstack-dashboard/local_settings.py
SESSION_ENGINE = 'django.contrib.sessions.backends.cache' 改為 SESSION_ENGINE = 'django.contrib.sessions.backends.file'
如果提示pip沒(méi)有安裝,apt-get install python-pip又無(wú)法安裝,參照 http://www.linuxdiyf.com/linux/19248.html 解決
在OpenStack Mitaka發(fā)行版中Horizon中不包括Manila,需要安裝額外的插件manila-ui才能在Horizon中顯示Share菜單。
安裝Manila UI 查看列表:http://tarballs.openstack.org/manila-ui/
pip install 'http://tarballs.openstack.org/manila-ui/manila-ui-stable-mitaka.tar.gz'
在Horizon中啟用Manila UI 查看Manila UI安裝路徑:find /usr -name 'manila_ui'
cd /usr/local/lib/python2.7/dist-packages/manila_ui
sudo cp ./enabled/_90_manila_*.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
配置中文語(yǔ)言支持
sudo apt-get install gettext python-pip python-dev build-essential
cd /usr/share/openstack-dashboard/horizon
sudo /usr/share/openstack-dashboard/manage.py makemessages -l en --no-obsolete
sudo /usr/share/openstack-dashboard/manage.py makemessages -d djangojs -l en --no-obsolete
cd /usr/share/openstack-dashboard/openstack_dashboard
sudo /usr/share/openstack-dashboard/manage.py makemessages --extension=html,txt,csv --ignore=openstack -l en --no-obsolete
cd /usr/share/openstack-dashboard/horizon
sudo /usr/share/openstack-dashboard/manage.py compilemessages
cd /usr/share/openstack-dashboard/openstack_dashboard
sudo /usr/share/openstack-dashboard/manage.py compilemessagescd /usr/local/lib/python2.7/dist-packages/manila_ui
重新加載Apache Web Server
sudo service apache2 reload
感謝各位的閱讀,以上就是“openstack的安裝步驟”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)openstack的安裝步驟這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!