tripleo undercloud 安装

来源:互联网 发布:像素大厨mac下载 编辑:程序博客网 时间:2024/05/07 19:25
1、新建虚机,编辑两个网卡
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:66:b5:9f brd ff:ff:ff:ff:ff:ff
    inet 172.30.121.81/24 brd 172.30.121.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe66:b59f/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:fc:e6:a0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.13.13/24 brd 192.168.13.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fefc:e6a0/64 scope link 
       valid_lft forever preferred_lft forever
[root@localhost yum.repos.d]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=172.30.121.81
NETMASK=255.255.255.0
GATEWAY=172.30.121.254
DNS1=172.16.180.1
DNS2=202.106.0.20


[root@localhost yum.repos.d]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
NAME=eth1
DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.13.13
NETMASK=255.255.255.0
GATEWAY=192.168.13.254


2、源用哪个
centos自带源




1、操作
Log in to your machine (baremetal or VM) where you want to install the undercloud as a non-root user (such as the stack user):
[root@localhost ~]# sudo useradd stack
[root@localhost ~]# sudo passwd stack
[root@localhost ~]# echo "stack ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/stack
stack ALL=(root) NOPASSWD:ALL
[root@localhost ~]# sudo chmod 0440 /etc/sudoers.d/stack
[root@localhost ~]# su - stack
[stack@localhost ~]$ 


2、Enable needed repositories:
[stack@localhost ~]$ sudo yum install -y yum-utils
[stack@localhost ~]$ sudo yum-config-manager --enable rhelosp-rhel-7-server-opt
Loaded plugins: fastestmirror


Stable Branch Enable the appropriate repos for the desired release, as indicated below. Do not enable any other repos not explicitly marked for that release.
Mitaka Enable latest RDO Mitaka Delorean repository for all packages
[stack@localhost ~]$ sudo curl -L -o /etc/yum.repos.d/delorean-mitaka.repo https://trunk.rdoproject.org/centos7-mitaka/current/delorean.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   217  100   217    0     0     27      0  0:00:08  0:00:07  0:00:01    50
[stack@localhost ~]$ sudo curl -L -o /etc/yum.repos.d/delorean-deps-mitaka.repo http://trunk.rdoproject.org/centos7-mitaka/delorean-deps.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   306  100   306    0     0    496      0 --:--:-- --:--:-- --:--:--   495
Ceph Enable the CentOS Storage SIG Ceph/Hammer repository if using Ceph
[stack@localhost ~]$ sudo yum -y install --enablerepo=extras centos-release-ceph-hammer
[stack@localhost ~]$ sudo sed -i -e 's%gpgcheck=.*%gpgcheck=0%' /etc/yum.repos.d/CentOS-Ceph-Hammer.repo




3、Install the yum-plugin-priorities package so that the Delorean repository takes precedence over the main RDO repositories:


[stack@localhost ~]$ sudo yum -y install yum-plugin-priorities




4、Install the TripleO CLI, which will pull in all other necessary packages as dependencies:


[stack@localhost ~]$ sudo yum install -y python-tripleoclient --skip-broken   【此方法虽然能过去,但是实际环境不可用,导致openstack名没有装上】

用yum将包升级后再执行(内核保证327.36.1。    327 :327.514都会报错)

[stack@localhost yum.repos.d]$ sudo yum update libselinux-utils

yum update 包名

[stack@localhost ~]$ sudo yum install -y python-tripleoclient

5、Run the command to install the undercloud:


[stack@localhost ~]$ vi undercloud.conf
[DEFAULT]


local_ip = 192.168.13.100/24
undercloud_public_vip = 192.168.13.101
undercloud_admin_vip = 192.168.13.102
local_interface = ens9
masquerade_network = 192.168.13.0/24
dhcp_start = 192.168.13.111
dhcp_end = 192.168.13.120
network_cidr = 192.168.13.0/24
network_gateway = 192.168.13.1
#network_gateway = 192.168.23.1
discovery_iprange = 192.168.13.121,192.168.13.130


[stack@localhost ~]$ openstack undercloud install


报错:
setenforce: SELinux is disabled
INFO: 2017-01-05 18:02:44,946 -- ############### End stdout/stderr logging ###############
ERROR: 2017-01-05 18:02:44,946 --     Hook FAILED.
ERROR: 2017-01-05 18:02:44,946 -- Failed running command ['dib-run-parts', u'/tmp/tmpHl_NuZ/pre-install.d']
  File "/usr/lib/python2.7/site-packages/instack/main.py", line 168, in main
    em.run()
  File "/usr/lib/python2.7/site-packages/instack/runner.py", line 79, in run
    self.run_hook(hook)
  File "/usr/lib/python2.7/site-packages/instack/runner.py", line 178, in run_hook
    raise Exception("Failed running command %s" % command)
ERROR: 2017-01-05 18:02:44,947 -- None
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 856, in install
    _run_instack(instack_env)
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 740, in _run_instack
    _run_live_command(args, instack_env, 'instack')
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 406, in _run_live_command
    raise RuntimeError('%s failed. See log for details.' % name)
RuntimeError: instack failed. See log for details.
Command 'instack-install-undercloud' returned non-zero exit status 1



yum update 
reboot
openstack undercloud install


这是由于内核版本低造成的。安装过程中已经自动把内核小版本升级装好了,请重启节点来升级内核,重启后继续执行此命令即可
重启虚机后重新执行即可

tripleo ui配置


1 开放TCP 3000端口,此为Tripleo UI的端口  【iptables -F】
2 由于puppet的安装有bug,手动更改修改httpd配置: 【vi /etc/httpd/conf.d/25-tripleo-ui.conf 】
  ## Rewrite rules
  #RewriteEngine On


  #Redirect 404 to index
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteRule (.*) index.html
  fallbackresource /index.html


3
【vim /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js】
把http://10.10.0.200:5000替换为:
http://10.10.0.200:5000/v2.0
重新启动httpd。浏览器可能有缓存 【service httpd restart】




4、页面登录
用户名:admin
密码:见stackrc 文件里。用【sudo hiera admin_password 】生成
http://192.168.14.78:3000/    【vnc里面的浏览器,外面链接不上】
http://192.169.57.100:3000/ 





0 0