openstack 安装
openstack 安装
jiuyueshouyi 发表于6个月前
openstack 安装
  • 发表于 6个月前
  • 阅读 47
  • 收藏 0
  • 点赞 0
  • 评论 0

腾讯云 新注册用户 域名抢购1元起>>>   

https://docs.openstack.org/mitaka/zh_CN/install-guide-ubuntu/keystone-install.html
在 [database] 部分,配置数据库访问:

[database]
...
connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone

controller要改为ip,要不然会连不上数据库

配置 Apache HTTP 服务器

    编辑``/etc/apache2/apache2.conf``文件,为控制节点配置``ServerName``选项:

    ServerName controller
controller要改为ip

    
配置Linuxbridge代理¶

Linuxbridge代理为实例建立layer-2虚拟网络并且处理安全组规则。

    编辑``/etc/neutron/plugins/ml2/linuxbridge_agent.ini``文件并且完成以下操作:

        在``[linux_bridge]``部分,将公共虚拟网络和公共物理网络接口对应起来:

        [linux_bridge]
        physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
PROVIDER_INTERFACE_NAME改为机器实际网口名称,比如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']
报错原因是neutron配置文件(/etc/neutron/neutron.conf)中原先的connection字段未注掉,导致新配得connection被原先的覆盖掉了,原先默认的还使用sqlite3...

dashboard 输入 default/admin/huawei,登录认证失败,查看apach error.log,用户 admin 登录失败。检查dashboard配置文件,有一项配置有问题:
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3.0" % OPENSTACK_HOST
正确的应为:
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST


解决完上一个问题后,登录不再提示认证失败,但还是无法登录,查看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".
实在找不出什么原因,换Chrome登录,居然登录成功了(Firefox和IE都不行)

root@ubuntu:~# pvcreate /dev/sdc
  Device /dev/sdc not found (or ignored by filtering).
硬盘已添加,但创建还是失败,原因是 /etc/lvm/lvm.conf 中 filter字段,没有把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就会报错:
Invalid key_name provided. (HTTP 400) (Request-ID: req-5f12f3e7-5ff9-4a1a-932e-ebd936de1be1)
不指定key_name也能创建


manila文件共享服务,选项1是lvm,本地文件系统,选项2通过driver,分布式文件系统

社区版自带manila的Horizon插件,M版本默认没有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登陆后,提示错误,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没有安装,apt-get install python-pip又无法安装,参照 http://www.linuxdiyf.com/linux/19248.html 解决

在OpenStack Mitaka发行版中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

配置中文语言支持
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 manila
共有 人打赏支持
粉丝 3
博文 16
码字总数 10987
×
jiuyueshouyi
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: