Chinaunix首页 | 论坛 | 博客
  • 博客访问: 270783
  • 博文数量: 78
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 852
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-06 11:01
个人简介

不做第二个别人,永远做第一个自己。

文章分类

全部博文(78)

文章存档

2014年(60)

2013年(18)

分类: 云计算

2013-09-22 17:11:09

解释:我尽量把我能记录的步骤记录下来;
**************************************************************************************************
服务器:DELL R720
CPU:4
内存:64GB
硬盘:6TB (做RAID10) 可用空间 3TB
系统:Centos 6.4
用光盘安装Centos 6.4系统,这个大家都熟悉吧!到了分区的时候选择自定义分区:

分区名称 大小(MB)
/boot 1024
/     102400
swap   64000
剩余空间 ---
网络配置:
有4块网卡我用了2块
eth0 外部网络地址,作用为了和openstack中创建的实例instance通信;关联浮动ip
eth1 管理ip地址192.168.1.199
*************************************************************************************************************************************
步骤一、安装好系统,在dell服务器中安装的centos6.4中网卡的名称成了em1、em2、em3、em4、现在我给他改成咱们熟悉的eth0、eth1、eth2、eth3
修改
vi /etc/grub.conf

//找到这段,添加参数
title CentOS (2.6.32-358.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=a13f3beb-1ff3-4295-93f8-2488add1de59 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet biosdevname=0
        initrd /initramfs-2.6.32-358.el6.x86_64.img


删除此文件
# rm -f /etc/udev/rules.d/70-persistent-cd.rules

更改网卡名称:
cd /etc/sysconfig/network-scripts/
# mv ifcfg-em1 ifcfg-eth0
# mv ifcfg-em2 ifcfg-eth1
# mv ifcfg-em3 ifcfg-eth2
# mv ifcfg-em4 ifcfg-eth3

# perl -p -i -e 's/em1/eth0/g' ifcfg-eth0
# perl -p -i -e 's/em2/eth1/g' ifcfg-eth1
# perl -p -i -e 's/em3/eth2/g' ifcfg-eth2
# perl -p -i -e 's/em4/eth3/g' ifcfg-eth3

给dns文件+ i 节点不允许修改此文件中内容
# chattr +i /etc/resolv.conf

网络配置文件:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:24:E8:74:02:2C
TYPE=Ethernet
UUID=f49c5d7f-8c69-49aa-91d0-bb5448fe55c7
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none

cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:24:E8:74:02:2E
TYPE=Ethernet
UUID=b38288a2-8641-4a50-8919-60cd2f60ed54
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.1.199
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.199 cloudhost2

重新启动

步骤二、把剩余硬盘空间划分成LVM

备注:因为剩下的空间大小已经超过了2T,所以fdisk命令就无能无力了,那么就需要使用parted命令来帮助我们了
# parted
GNU Parted 2.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print 
Model: DELL PERC 6/i (scsi)
Disk /dev/sda: 2999GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  1075MB  1074MB  ext4                  boot
 2      1075MB  108GB   107GB   ext4
 3      108GB   176GB   67.1GB  linux-swap(v1)
(parted) mkpart                                                           
Partition name?  []? cinder-volumes                                   
File system type?  [ext2]? ext4                                           
Start? 176GB                                                              
End? 2999GB                                                               
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or
resource busy).  As a result, it may not reflect all of your changes until after reboot.
(parted) quit
到这个地方又的重启一次,然后识别lvm分区;
步骤三、创建lvm
# pvcreate /dev/sda4
  Physical volume "/dev/sda4" successfully created
# vgcreate cinder-volumes /dev/sda4   //cinder-volumes 这个名字必须是这个
  Volume group "cinder-volumes" successfully created
# setenforce 0
# sed -i -e "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config
yum -y install vim wget make gcc automake yum-utils unzip
开启网络转发功能
# vim /etc/sysctl.conf 

net.ipv4.ip_forward = 1

net.bridge.bridge-nf-call-ip6tables = 1

net.bridge.bridge-nf-call-iptables = 1

net.bridge.bridge-nf-call-arptables = 1
# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key       //这个报错不用管,等安装了openstack后就没了
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

vim /etc/sysconfig/modules/openstack-quantum-linuxbridge.modules

#!/bin/sh

modprobe -b bridge >/dev/null 2>&1

exit 0

# chmod u+x /etc/sysconfig/modules/openstack-quantum-linuxbridge.modules
下载&安装openstack源
# yum install -y
下载并安装安装openstack的工具:packstack
# yum install -y openstack-packstack

修改这个文件中的参数是因为安装过程中会网络超时报错,所以我改了一下
#vim /usr/lib/python2.6/site-packages/packstack/puppet/modules/packstack/manifests/netns.pp


    timeout => “3600”,    加一行

    command => "yum update -y kernel iputils iproute"
安装openstack
# packstack --allinone                                                           //我的安装时间是时间13-14分钟
Welcome to Installer setup utility


Installing:
Clean Up...                                            [ DONE ]
Setting up ssh keys...root@192.168.1.199's password:        //输入root密码
                                 [ DONE ]
Adding pre install manifest entries...                 [ DONE ]
Adding MySQL manifest entries...                       [ DONE ]
Adding QPID manifest entries...                        [ DONE ]
Adding Keystone manifest entries...                    [ DONE ]
Adding Glance Keystone manifest entries...             [ DONE ]
Adding Glance manifest entries...                      [ DONE ]
Adding Cinder Keystone manifest entries...             [ DONE ]
Installing dependencies for Cinder...                  [ DONE ]
Checking if the Cinder server has a cinder-volumes vg...[ DONE ]
Adding Cinder manifest entries...                      [ DONE ]
Adding Nova API manifest entries...                    [ DONE ]
Adding Nova Keystone manifest entries...               [ DONE ]
Adding Nova Cert manifest entries...                   [ DONE ]
Adding Nova Conductor manifest entries...              [ DONE ]
Adding Nova Compute manifest entries...                [ DONE ]
Adding Nova Scheduler manifest entries...              [ DONE ]
Adding Nova VNC Proxy manifest entries...              [ DONE ]
Adding Nova Common manifest entries...                 [ DONE ]
Adding Openstack Network-related Nova manifest entries...[ DONE ]
Adding Quantum API manifest entries...                 [ DONE ]
Adding Quantum Keystone manifest entries...            [ DONE ]
Adding Quantum L3 manifest entries...                  [ DONE ]
Adding Quantum L2 Agent manifest entries...            [ DONE ]
Adding Quantum DHCP Agent manifest entries...          [ DONE ]
Adding Quantum Metadata Agent manifest entries...      [ DONE ]
Adding OpenStack Client manifest entries...            [ DONE ]
Adding Horizon manifest entries...                     [ DONE ]
Adding Swift Keystone manifest entries...              [ DONE ]
Adding Swift builder manifest entries...               [ DONE ]
Adding Swift proxy manifest entries...                 [ DONE ]
Adding Swift storage manifest entries...               [ DONE ]
Adding Swift common manifest entries...                [ DONE ]
Preparing servers...                                   [ DONE ]
Adding Nagios server manifest entries...               [ DONE ]
Adding Nagios host manifest entries...                 [ DONE ]
Adding post install manifest entries...                [ DONE ]
Installing Dependencies...                             [ DONE ]
Copying Puppet modules and manifests...                [ DONE ]
Applying Puppet manifests...
Applying 192.168.1.199_prescript.pp
192.168.1.199_prescript.pp :                                         [ DONE ]
Applying 192.168.1.199_mysql.pp
Applying 192.168.1.199_qpid.pp
192.168.1.199_mysql.pp :                                             [ DONE ]
192.168.1.199_qpid.pp :                                              [ DONE ]
Applying 192.168.1.199_keystone.pp
Applying 192.168.1.199_glance.pp
Applying 192.168.1.199_cinder.pp
192.168.1.199_keystone.pp :                                          [ DONE ]
192.168.1.199_cinder.pp :                                            [ DONE ]
192.168.1.199_glance.pp :                                            [ DONE ]
Applying 192.168.1.199_api_nova.pp
192.168.1.199_api_nova.pp :                                          [ DONE ]
Applying 192.168.1.199_nova.pp
192.168.1.199_nova.pp :                                              [ DONE ]
Applying 192.168.1.199_quantum.pp
192.168.1.199_quantum.pp :                                           [ DONE ]
Applying 192.168.1.199_osclient.pp
Applying 192.168.1.199_horizon.pp
192.168.1.199_osclient.pp :                                          [ DONE ]
192.168.1.199_horizon.pp :                                           [ DONE ]
Applying 192.168.1.199_ring_swift.pp
192.168.1.199_ring_swift.pp :                                        [ DONE ]
Applying 192.168.1.199_swift.pp
Applying 192.168.1.199_nagios.pp
Applying 192.168.1.199_nagios_nrpe.pp
192.168.1.199_swift.pp :                                             [ DONE ]
192.168.1.199_nagios_nrpe.pp :                                       [ DONE ]
192.168.1.199_nagios.pp :                                            [ DONE ]
Applying 192.168.1.199_postscript.pp
192.168.1.199_postscript.pp :                                        [ DONE ]
                           [ DONE ]


 **** Installation completed successfully ******




Additional information:
 * A new answerfile was created in: /root/packstack-answers-20130717-154110.txt
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * Did not create a cinder volume group, one already existed
 * To use the command line tools you need to source the file /root/keystonerc_admin created on 192.168.1.199
 * To use the console, browse to
 * To use Nagios, browse to username : nagiosadmin, password : 19f3b9e5e53e45a6
 * Kernel package with netns support has been installed on host 192.168.1.199. Please note that with this action you are loosing Red Hat support for this host. Because of the kernel update host mentioned above requires reboot.
 * The installation log file is available at: /var/tmp/packstack/20130717-154110-cU_a0p/openstack-setup.log

到此安装成功了openstack!
查看都安装了那些软件包:
# rpm -qa | grep openstack*
openstack-swift-plugin-swift3-1.0.0-0.20120711git.el6.noarch
openstack-nova-common-2013.1.2-1.el6.noarch
openstack-dashboard-2013.1.1-1.el6.noarch
openstack-swift-container-1.8.0-2.el6.noarch
kernel-2.6.32-358.111.1.openstack.el6.x86_64
openstack-nova-conductor-2013.1.2-1.el6.noarch
kernel-firmware-2.6.32-358.111.1.openstack.el6.noarch
openstack-cinder-2013.1.1-1.el6.noarch
openstack-nova-scheduler-2013.1.2-1.el6.noarch
openstack-nova-console-2013.1.2-1.el6.noarch
python-django-openstack-auth-1.0.7-1.el6.noarch
openstack-swift-proxy-1.8.0-2.el6.noarch
openstack-quantum-2013.1.2-1.el6.noarch
openstack-packstack-2013.1.1-0.20.dev642.el6.noarch
openstack-utils-2013.1-8.el6.noarch
openstack-nova-api-2013.1.2-1.el6.noarch
openstack-nova-cert-2013.1.2-1.el6.noarch
openstack-nova-novncproxy-0.4-7.el6.noarch
openstack-nova-compute-2013.1.2-1.el6.noarch
openstack-swift-account-1.8.0-2.el6.noarch
openstack-quantum-openvswitch-2013.1.2-1.el6.noarch
openstack-swift-object-1.8.0-2.el6.noarch
openstack-keystone-2013.1.2-1.el6.noarch
openstack-swift-1.8.0-2.el6.noarch
openstack-glance-2013.1.2-2.el6.noarch

有的会因为没安装以下几个软件包导致instance的各种的网络问题!!!!
# yum -y install gedit
# yum -y install *kate* --skip-broken

配置一个br-ex,这个网卡在rdo中没有自动生成需要手动配置一下!
# virsh net-destroy default
Network default destroyed
[root@cloudhost2 ~]# virsh net-autostart default --disable
Network default unmarked as autostarted
[root@cloudhost2 ~]# ovs-vsctl add-port br-ex eth0
[root@cloudhost2 ~]# ovs-vsctl show
e7b4b619-b85b-4b6c-b6ea-36ceea32e14d
    Bridge br-int
        Port br-int
            Interface br-int
                type: internal
    Bridge br-ex
        Port "eth0"
            Interface "eth0"
        Port br-ex
            Interface br-ex
                type: internal
    ovs_version: "1.10.0"

# openstack-config --set /etc/quantum/quantum.conf DEFAULT ovs_use_veth True
# reboot
# source keystonerc_admin
查看租户!
# keystone tenant-list
+----------------------------------+----------+---------+
|                id                |   name   | enabled |
+----------------------------------+----------+---------+
| 4066476a7fdd46eebb657796c9a5592e |  admin   |   True  |
| 0fca2d3f7ab64937afdde09939ac8845 | services |   True  |
+----------------------------------+----------+---------+
创建private network
# quantum net-create --tenant-id 4066476a7fdd46eebb657796c9a5592e net_lisys
创建private network  subnet
# quantum subnet-create --tenant-id 4066476a7fdd46eebb657796c9a5592e net_lisys 20.20.20.0/24
创建路由器
# quantum router-create --tenant-id 4066476a7fdd46eebb657796c9a5592e router_lisys
查看代理类型
# quantum agent-list 
添加L3代理到路由器中
# quantum l3-agent-router-add 4d2929db-76f6-4d16-bd63-c0dcc5d64446 router_lisys
把private network 添加到路由器端口中
# quantum router-interface-add 4595f474-9016-4e27-ae4f-bca6629e1ead(路由器) 98a3b47f-de80-4ff7-8607-2a99866190f7(subnet-network id)
创建external外边网络(instance 链接外部)
quantum net-create net_external --router:external=True --shared
# quantum subnet-create  --tenant-id 4066476a7fdd46eebb657796c9a5592e net_external --allocation-pool start=192.168.1.221,end=192.168.1.249 --gateway 192.168.1.1 192.168.1.0/24 --enable_dhcp=False
把external设置成出去的网关
# quantum router-gateway-set router_lisys net_external
创建浮动ip地址
# quantum floatingip-create net_external

这个是在Centos6.4上安装G版本!看好多兄弟因为网络没搞定而苦恼,我还是把这个发布一下吧!希望能帮助你们把你们的问题解决掉!
另外提醒大家红帽的H版的也已经能用,我现在是在H版上测试!

packstack --allinone 安装H版的地址是:


步骤:
sudo yum install -y 
yum -y update
reboot

sudo yum install -y openstack-packstack python-netaddr

packstack --allinone



阅读(1449) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~