设为首页 收藏本站
查看: 566|回复: 0

[经验分享] [Resolved] OpenStack Mitaka with Docker Integration Issue

[复制链接]

尚未签到

发表于 2017-6-26 20:53:56 | 显示全部楼层 |阅读模式
  2016年5月20日发布
1. How does Docker hood work with Nova hypervisor?
(오픈 스택과 도커 사이 연동은 어떻게 되어 있는가?)
DSC0000.png

  As shown in Figure above, the driver will fetch images from the OpenStack Image Service (Glance) and load them into the Docker filesystem. Images may be placed in Glance by exporting them from Docker using the 'docker save' command.
  그림에서 볼수 있다 싶이 docker driver는 glance로 부터 이미지를 가져오고 도커 파일 시스템에 로드한다. 이미지는 도커 명령어 docker save로 glance에 이미지를 저장해준다.
  2. Configure an existing OpenStack installation to enable Docker
  (기존 오픈 스택에 도커 설치 및 설정)
  2.1 on controller node
  Edit the /etc/nova/nova.conf, add following information
  [iyunv@controller ~]# vi /etc/nova/nova.conf
  [DEFAULT]
  compute_driver = novadocker.virt.docker.DockerDriver
  Edit the /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf, add following information
  [DEFAULT]
  container_formats = ami,ari,aki,bare,ovf,docker
  [iyunv@controller ~]#  systemctl restart openstack-nova-api openstack-glance-api openstack-glance-registry
  2.2 on compute node
  First, install docker on compute node.
  [iyunv@compute1~]# usermod -aG docker nova

  [iyunv@compute1~]# systemctl restart openstack-nova-compute


  Install novadocker driver

  pip install -e git+https://github.com/stackforge/nova-docker#egg=novadocker



  cd src/novadocker/

  python setup.py install


  Edit the /etc/nova/nova.conf, add following information
  [iyunv@compute1~]# vi /etc/nova/nova.conf
  [DEFAULT]
  compute_driver = novadocker.virt.docker.DockerDriver
  Create the directory /etc/nova/rootwrap.d/docker.filters file, add following contents
  [iyunv@compute1~]# vi /etc/nova/rootwrap.d/docker.filters
  # nova-rootwrap command filters for setting up network in the docker driver
  # This file should be owned by (and only-writeable by) the root user
  [Filters]
  # nova/virt/docker/driver.py: 'ln', '-sf', '/var/run/netns/.*'
  ln: CommandFilter, /bin/ln, root
  [iyunv@compute1~]# systemctl restart openstack-nova-compute
  Restart failed, error message is like this.
  Error:

  [iyunv@compute1~]# tail –f /var/log/nova/nova-compute.log

  

  2016-05-19 16:16:03.682 20533 WARNING oslo_reports.guru_meditation_report [-] Guru mediation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports.

  2016-05-19 16:16:03.919 20533 INFO oslo_service.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative

  2016-05-19 16:16:03.934 20533 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver [-] Unable to load the virtualization driver

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver Traceback (most recent call last):

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line 1622, in load_compute_driver

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver     virtapi)

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 64, in import_object_ns

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver     cls = import_class(import_str)

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 30, in import_class

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver     __import__(mod_str)

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/__init__.py", line 20, in <module>

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver     from novadocker.virt.docker import driver

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py", line 27, in <module>

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver     from docker import errors

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver ImportError: No module named docker


  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver
  Solution:
  Version conflict and make sure whether installed docker-py or not.
  [iyunv@compute1~]#  pip install docker-py
  [iyunv@compute1~]#  cd ~
  [iyunv@compute1~]#  git clone https://github.com/pypa/pip
  [iyunv@compute1~]#  cd pip/
  [iyunv@compute1~]#  python setup.py install
  [iyunv@compute1~]#  pip install docker-py
  [iyunv@compute1~]#  python2.7 -c 'import sys; print(sys.path)'
  [iyunv@compute1~]#  systemctl restart openstack-nova-compute
  [iyunv@compute1~]#  systemctl restart docker
  Check its working well:
  [iyunv@compute1~]# docker search hipache
  NAME                         DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
  hipache                      Hipache is a distributed proxy for high vo...   68        [OK]
  tutum/hipache                Extends official hipache image to provide ...   14                   [OK]
  willdurand/hipache                                                           1                    [OK]
  prologic/hipache             A production version of hipache with worki...   1                    [OK]
  elsdoerfer/hipache                                                           1                    [OK]
  rocketchat/hipache           Hipache with support of full config via en...   1                    [OK]
  jllopis/hipache                                                              0                    [OK]
  tjmehta/hipache                                                              0                    [OK]
  komljen/hipache              More info: https://github.com/komljen/dock...   0                    [OK]
  apnarm/autodock-hipache      autodock hipache plugin                         0                    [OK]
  trsouz/hipache                                                               0                    [OK]
  arnos/hipache                                                                0                    [OK]
  crosbymichael/hipache                                                        0                    [OK]
  turistforeningen/hipache                                                     0                    [OK]
  cpuguy83/hipache                                                             0                    [OK]
  jkingyens/hipache            Hipache + etcd. See http://required.io/hip...   0
  sherzberg/marathon-hipache                                                   0                    [OK]
  quarry/hipache                                                               0                    [OK]
  thomaswelton/hipache                                                         0                    [OK]
  aldrinleal/hipache                                                           0                    [OK]
  prologic/autodock-hipache    autodock hipache plugin                         0                    [OK]
  smartprocure/hipache                                                         0                    [OK]
  apnarm/hipache               A production version of hipache with worki...   0                    [OK]
  aldryn/hipache                                                               0                    [OK]
  tsuru/router-hipache         tsuru router-hipache                            0                    [OK]
  [iyunv@compute1~]# docker pull tutum/hipache
  [iyunv@compute1~]# docker save tutum/hipache | glance image-create --container-format=docker --disk-format=raw --name tutum/hipache
  [iyunv@compute1~]# glance image-list
  +--------------------------------------+--------------------+
  | ID                                   | Name               |
  +--------------------------------------+--------------------+
  | 0d3c0d81-7071-4e15-b677-1dd8222f7815 | cirros             |
  | 1977d857-7fa1-4296-8d58-c3989b862eea | tutum/hipache      |
  | 631c61ba-2a5d-4271-a4ac-d718c1e9849d | willdurand/hipache |
  +--------------------------------------+--------------------+
  Create Container on OpenStack Dashboard using docker image.
  I used selfservice network to create container.

DSC0001.png


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-388383-1-1.html 上篇帖子: OpenStack实践系列⑥构建虚拟机实例 下篇帖子: Openstack Neutron:二层技术和实现
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表