热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CentOS6.4openstackgrizzly安装配置(openvswitch单节点)

准备环境1、配置yum源CentOS6-Base-163.repo[base]nameCentOS-$releasever-Base-163.combaseurlhttp://mirrors.163.com/centos/$releasever/os/$basearch/#mirrorlisthttp://mirror
准备环境
1、配置yum源
CentOS6-Base-163.repo
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
epel.repo [epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://centos.ustc.edu.cn/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://centos.ustc.edu.cn/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://centos.ustc.edu.cn/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
openstack.repo [openstack]
baseurl=http://rdo.fedorapeople.org/openstack/openstack-grizzly/epel-6
gpgcheck=0

安装前准备
1、 安装OpenStack Utilities #yum install -y openstack-utils dnsmasq-utils
2、更新系统
# yum update
3、关闭iptables

# service iptables stop
# chkconfig iptables off
4.关闭selinux

# vi /etc/selinux/config
SELINUX=disabled
5、重启服务器
# reboot
6、安装qpid # yum install -y qpid-cpp-server
# sed -i -e 's/auth=.*/auth=no/g' /etc/qpidd.conf
# service qpidd start
# chkconfig qpidd on

部署KeyStone
1、安装KeyStone # yum install -y openstack-keystone
2、初始化数据库

# openstack-db --init --service keystone \
        --password PASSWORD
如果没有安装mysql,会在这步安装,这里默认密码PASSWORD 3、生成Token,并设置环境变量

# export SERVICE_TOKEN=$(openssl rand -hex 10)
# export SERVICE_ENDPOINT=http://10.9.0.206:35357/v2.0
# echo $SERVICE_TOKEN > /tmp/ks_admin_token
71068df694f4c4620156
4、修改配置文件

# openstack-config --set /etc/keystone/keystone.conf \
  DEFAULT admin_token $SERVICE_TOKEN
# openstack-config --set /etc/keystone/keystone.conf \
  signing token_format UUID
5、启动keystone服务

# service openstack-keystone start
# chkconfig openstack-keystone on
6、查看是否启动正常
# ps -ef | grep -i keystone-all
keystone  2331     1  3 15:24 ?        00:00:00 /usr/bin/python /usr/bin/keystone-all --config-file /etc/keystone/keystone.conf
root      2339  1902  0 15:24 pts/0    00:00:00 grep -i keystone-all
# grep ERROR /var/log/keystone/keystone.log
7、创建Keystone服务,并注册Endpoint

# keystone service-create --name=keystone --type=identity \
  --description="Keystone Identity Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |    Keystone Identity Service     |
|      id     | b987bd18f91a47709d1c191ca924f4db |
|     name    |             keystone             |
|     type    |             identity             |
+-------------+----------------------------------+
# keystone endpoint-create \
  --service_id b987bd18f91a47709d1c191ca924f4db \
  --publicurl 'http://10.9.0.206:5000/v2.0' \
  --adminurl 'http://10.9.0.206:35357/v2.0' \
  --internalurl 'http://10.9.0.206:5000/v2.0'
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |   http://10.9.0.206:35357/v2.0   |
|      id     | a86e402ec8144c0ba560f9b917c65981 |
| internalurl |   http://10.9.0.206:5000/v2.0    |
|  publicurl  |   http://10.9.0.206:5000/v2.0    |
|    region   |            regionOne             |
|  service_id | b987bd18f91a47709d1c191ca924f4db |
+-------------+----------------------------------+
其中service_id和上面创建service的返回ID对应
8、创建admin用户
a) 创建admin用户

# keystone user-create --name admin --pass PASSWORD
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | 8179d4236cd147f2a9670df1616882a0 |
|   name   |              admin               |
| tenantId |                                  |
+----------+----------------------------------+
b) 创建admin role

# keystone role-create --name admin
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | c44c1e8f4b8c4efa82beb83a847dd0ca |
|   name   |              admin               |
+----------+----------------------------------+
c) 创建admin tenant

# keystone tenant-create --name admin
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | 78b342b561ed4fb79ab764b828473f93 |
|     name    |              admin               |
+-------------+----------------------------------+
d)将admin用户加入到admin role中

# keystone user-role-add --user-id 8179d4236cd147f2a9670df1616882a0 \
  --role-id c44c1e8f4b8c4efa82beb83a847dd0ca \
  --tenant-id 78b342b561ed4fb79ab764b828473f93
e)设置admin的环境变量

# vi keystonerc_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=PASSWORD
export OS_AUTH_URL=http://10.9.0.205:35357/v2.0/
export PS1='[\u@\h \W(keystone_admin)]\$ '
f)测试是否创建完成
# unset SERVICE_TOKEN
# unset SERVICE_ENDPOINT
# source ~/keystonerc_admin
# keystone user-list
9、创建一个普通用户
# keystone user-create --name tcommerce --pass PASSWORD
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | ad91d8062e5e48b185aa0e0847d4b860 |
|   name   |            tcommerce             |
| tenantId |                                  |
+----------+----------------------------------+
#  keystone role-create --name user
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | c5689d23e5a04465831f5e39caff1099 |
|   name   |               user               |
+----------+----------------------------------+
# keystone tenant-create --name user
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | f380922e9d844b77b7c1cb742c7ca04b |
|     name    |               user               |
+-------------+----------------------------------+
keystone user-role-add --user-id ad91d8062e5e48b185aa0e0847d4b860 \
  --role-id c5689d23e5a04465831f5e39caff1099 \
  --tenant-id f380922e9d844b77b7c1cb742c7ca04b
#vim keystonerc_tcommerce
export OS_USERNAME=tcommerce
export OS_TENANT_NAME=user
export OS_PASSWORD=PASSWORD
export OS_AUTH_URL=http://10.9.0.206:5000/v2.0/
export PS1='[\u@\h \W(tcommerce)]\$ '
# source keystonerc_tcommerce
# keystone user-list
Unable to communicate with identity service: {"error": {"message": "You are not authorized to perform the requested action: admin_required", "code": 403, "title": "Not Authorized"}}. (HTTP 403)
# keystone token-get
+-----------+----------------------------------+
|  Property |              Value               |
+-----------+----------------------------------+
|  expires  |       2013-04-25T08:14:28Z       |
|     id    | 1360775bf4504e84881689e6b9b4fff6 |
| tenant_id | f380922e9d844b77b7c1cb742c7ca04b |
|  user_id  | ad91d8062e5e48b185aa0e0847d4b860 |
+-----------+----------------------------------+

部署Glance

1、安装glance
# yum install -y openstack-glance
2、设置环境变量
# source ~/keystonerc_admin
3、初始数据库
# openstack-db --init --service glance \
        --password PASSWORD
4、修改配置文件
# openstack-config --set /etc/glance/glance-api.conf \
   paste_deploy flavor keystone
# openstack-config --set /etc/glance/glance-api.conf \
   keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/glance/glance-api.conf \
   keystone_authtoken admin_user admin
# openstack-config --set /etc/glance/glance-api.conf \
   keystone_authtoken admin_password PASSWORD
# openstack-config --set /etc/glance/glance-registry.conf \
   paste_deploy flavor keystone
# openstack-config --set /etc/glance/glance-registry.conf \
   keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/glance/glance-registry.conf \
   keystone_authtoken admin_user admin
# openstack-config --set /etc/glance/glance-registry.conf \
   keystone_authtoken admin_password PASSWORD
5、启动服务
# service openstack-glance-registry start
# service openstack-glance-api start
# chkconfig openstack-glance-registry on
# chkconfig openstack-glance-api on
6、创建服务和Endpoint
# keystone service-create --name=glance --type=image --description="Glance Image Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |       Glance Image Service       |
|      id     | c5b9b64a19084d8fbf1230ab200e730b |
|     name    |              glance              |
|     type    |              image               |
+-------------+----------------------------------+
# keystone endpoint-create --service_id c5b9b64a19084d8fbf1230ab200e730b \
  --publicurl http://10.9.0.206:9292 \
  --adminurl http://10.9.0.206:9292 \
  --internalurl http://10.9.0.206:9292
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |      http://10.9.0.206:9292      |
|      id     | 611967c3b2224cba8632e8ebe98bef96 |
| internalurl |      http://10.9.0.206:9292      |
|  publicurl  |      http://10.9.0.206:9292      |
|    region   |            regionOne             |
|  service_id | c5b9b64a19084d8fbf1230ab200e730b |
+-------------+----------------------------------+
7、测试是否安装成功
# source ~/keystonerc_tcommerce
# glance image-list
9、上传镜像到Glance
a)下载镜像

# wget http://berrange.fedorapeople.org/images/2012-11-15/f17-x86_64-openstack-sda.qcow2
b)上传镜像
glance image-create --name "fd" \
        --is-public true \
        --disk-format qcow2 \
        --container-format bare \
        --file f17-x86_64-openstack-sda.qcow2
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 4255a68ec619c25d8e93ae00e514f42f     |
| container_format | bare                                 |
| created_at       | 2013-04-24T08:30:36                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | f1d57318-63f6-4670-a4c0-b97db6fab835 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | fd                                   |
| owner            | f380922e9d844b77b7c1cb742c7ca04b     |
| protected        | False                                |
| size             | 5089761                              |
| status           | active                               |
| updated_at       | 2013-04-24T08:30:36                  |
+------------------+--------------------------------------+
c)查看镜像

# glance image-list
+--------------------------------------+----------+-------------+------------------+---------+--------+
| ID                                   | Name     | Disk Format | Container Format | Size    | Status |
+--------------------------------------+----------+-------------+------------------+---------+--------+
| f1d57318-63f6-4670-a4c0-b97db6fab835 | fd       | qcow2       | bare             | 5089761 | active |
+--------------------------------------+----------+-------------+------------------+---------+--------+

部署Cinder
1、安装Cinder # yum install -y openstack-cinder
2、设置环境变量
# source ~/keystonerc_admin
3、初始化数据库
# openstack-db --init --service cinder \
        --password PASSWORD
4、修改配置文件
# openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/cinder/cinder.conf \
   keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/cinder/cinder.conf \
   keystone_authtoken admin_user admin
# openstack-config --set /etc/cinder/cinder.conf \
   keystone_authtoken admin_password PASSWORD
5、修改tgt配置文件
grep -q /etc/cinder/volumes /etc/tgt/targets.conf || sed -i '1iinclude /etc/cinder/volumes/*' /etc/tgt/targets.conf
6、启动tgt #service tgtd start
#chkconfig tgtd on
6、创建cinder-volumes
使用一个空闲独立的分区,这里这个分区为/dev/sdb1 # vgcreate cinder-volumes /dev/sdb1
  Volume group "cinder-volumes" successfully created
# vgdisplay cinder-volumes
  --- Volume group ---
  VG Name               cinder-volumes
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.90 TiB
  PE Size               4.00 MiB
  Total PE              498073
  Alloc PE / Size       0 / 0
  Free  PE / Size       498073 / 1.90 TiB
  VG UUID               KpVXij-o9qC-WNOI-BKIw-1VSz-NUEa-2UsYTF
7、 启动服务
# for srv in api scheduler volume ; do \
   sudo service openstack-cinder-$srv start ; \
  done
# for srv in api scheduler volume ; do \
   sudo chkconfig openstack-cinder-$srv on ; \
  done
8、检查是否有报错
# grep -i ERROR /var/log/cinder/*
# grep CRITICAL /var/log/cinder/*
9、创建服务和endpoint
# keystone service-create --name=cinder --type=volume --description="Cinder Volume Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |      Cinder Volume Service       |
|      id     | 43f96e5b49464b809388daebbc5c1b2b |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+
# keystone endpoint-create --service_id 43f96e5b49464b809388daebbc5c1b2b \
  --publicurl "http://10.9.0.206:8776/v1/\$(tenant_id)s" \
  --adminurl "http://10.9.0.206:8776/v1/\$(tenant_id)s" \
  --internalurl "http://10.9.0.206:8776/v1/\$(tenant_id)s"
10、测试是否正常
# source ~/keystonerc_username
# cinder list

部署 Nova
1、安装nova和cinderclient # yum install -y openstack-nova
# yum install -y python-cinderclient
2、初始化数据库
# openstack-db --init --service nova \
        --password PASSWORD
3、修改配置文件
# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/nova/api-paste.ini \
  filter:authtoken admin_token $(cat /tmp/ks_admin_token)
4、卸载nova-network
# rpm -e openstack-nova-network-2013.1-2.el6.noarch --nodeps
这里面使用Quantum替代
# service messagebus start
# chkconfig messagebus on
# service libvirtd start
# chkconfig libvirtd on
# openstack-config --set /etc/nova/nova.conf DEFAULT \
   volume_api_class nova.volume.cinder.API
# openstack-config --set /etc/nova/nova.conf DEFAULT \
   enabled_apis ec2,osapi_compute,metadata
5、创建服务和Endpoint

# keystone service-create --name=nova --type=compute --description="Nova Compute Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |       Nova Compute Service       |
|      id     | dff2746d4d7049fab6e1a96968f6a6ff |
|     name    |               nova               |
|     type    |             compute              |
+-------------+----------------------------------+
# keystone endpoint-create --service_id dff2746d4d7049fab6e1a96968f6a6ff \
  --publicurl "http://10.9.0.206:8774/v1.1/\$(tenant_id)s" \
  --adminurl "http://10.9.0.206:8774/v1.1/\$(tenant_id)s" \
  --internalurl "http://10.9.0.206:8774/v1.1/\$(tenant_id)s"
+-------------+-------------------------------------------+
|   Property  |                   Value                   |
+-------------+-------------------------------------------+
|   adminurl  | http://10.9.0.206:8774/v1.1/$(tenant_id)s |
|      id     |      21cd3644397e4affb79e22ef26a4acb8     |
| internalurl | http://10.9.0.206:8774/v1.1/$(tenant_id)s |
|  publicurl  | http://10.9.0.206:8774/v1.1/$(tenant_id)s |
|    region   |                 regionOne                 |
|  service_id |      dff2746d4d7049fab6e1a96968f6a6ff     |
+-------------+-------------------------------------------+

部署 OpenStack Networking
1、为OpenStack Networking配置Keystone
# source ~/keystonerc_admin
# keystone service-create --name openstack_network --type network \
        --description 'OpenStack Networking Service'
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |   OpenStack Networking Service   |
|      id     | 90d4cf4d89a143dabf5faf2de1f0de48 |
|     name    |        openstack_network         |
|     type    |             network              |
+-------------+----------------------------------+
# keystone endpoint-create --service-id 90d4cf4d89a143dabf5faf2de1f0de48 \
        --publicurl 'http://10.9.0.206:9696/' \
        --adminurl 'http://10.9.0.206:9696/' \
        --internalurl 'http://10.9.0.206:9696/'
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |     http://10.9.0.206:9696/      |
|      id     | e6b17c6f8ff14455a755e4c9f6fc8ca6 |
| internalurl |     http://10.9.0.206:9696/      |
|  publicurl  |     http://10.9.0.206:9696/      |
|    region   |            regionOne             |
|  service_id | 90d4cf4d89a143dabf5faf2de1f0de48 |
+-------------+----------------------------------+
2、安装 quantum 和插件
# yum install openstack-quantum
# yum install openstack-quantum-openvswitch
3、配置Openstack-Networking
# openstack-config --set /etc/quantum/quantum.conf \
DEFAULT rpc_backend quantum.openstack.common.rpc.impl_qpid
# openstack-config --set /etc/quantum/quantum.conf \
DEFAULT qpid_hostname 10.9.0.206
# openstack-config --set /etc/quantum/quantum.conf \
       keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/quantum/quantum.conf \
       keystone_authtoken admin_user admin
# openstack-config --set /etc/quantum/quantum.conf \
       keystone_authtoken admin_password PASSWORD
# sudo sh -c 'echo 127.0.0.1 `hostname` >> /etc/hosts'
# quantum-server-setup --plugin openvswitch
Quantum plugin: openvswitch
Plugin: openvswitch => Database: ovs_quantum
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Would you like to update the nova configuration files? (y/n):
Y
Configuration updates complete!
# service quantum-server start
# chkconfig quantum-server on
4、修改nova.conf
network_api_class = nova.network.quantumv2.api.API
quantum_admin_username = admin
quantum_admin_password = PASSWORD
quantum_admin_auth_url = http://10.9.0.206:35357/v2.0/
quantum_auth_strategy = keystone
quantum_admin_tenant_name = admin
quantum_url = http://10.9.0.206:9696/
libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
libvirt_use_virtio_for_bridges=True
5、安装OpenStack Networking Agents
# yum install -y openstack-quantum-openvswitch
# quantum-node-setup --plugin openvswitch
Quantum plugin: openvswitch
Please enter the Quantum hostname:
10.9.0.206
Would you like to update the nova configuration files? (y/n):
y
/usr/bin/openstack-config --set|--del config_file section [parameter] [value]
Configuration updates complete!
# service openvswitch start
# chkconfig openvswitch on
# service quantum-openvswitch-agent start
# chkconfig quantum-openvswitch-agent on
# chkconfig quantum-ovs-cleanup on
6、安装 OpenStack Networking DHCP Agent #  quantum-dhcp-setup --plugin openvswitch
Quantum plugin: openvswitch
Please enter the Quantum hostname:
10.9.0.206
Configuration updates complete!
# service quantum-dhcp-agent start
# chkconfig quantum-dhcp-agent on
7、安装OpenStack Networking L3 Agent
# ovs-vsctl add-br br-int
# ovs-vsctl add-br br-ex
# ovs-vsctl add-port br-ex eth1
# yum install -y openstack-quantum
# quantum-l3-setup --plugin openvswitch
Quantum plugin: openvswitch
Please enter the Quantum hostname:
10.9.0.206
Configuration updates complete!
# quantum router-create router1
+-----------------------+--------------------------------------+
| Field                 | Value                                |
+-----------------------+--------------------------------------+
| admin_state_up        | True                                 |
| external_gateway_info |                                      |
| id                    | e6216a61-0212-4b0c-8b1c-3911e9b97974 |
| name                  | router1                              |
| status                | ACTIVE                               |
| tenant_id             | 78b342b561ed4fb79ab764b828473f93     |
+-----------------------+--------------------------------------+
# vi /etc/quantum/l3_agent.ini
router_id = 3129097f-4d02-4610-b77a-47dc7a2904ea
# service quantum-l3-agent start
# chkconfig quantum-l3-agent on
8、启动nova

# service openstack-nova-api start
# service openstack-nova-cert start
# service openstack-nova-conductor start
# service openstack-nova-objectstore start
# service openstack-nova-scheduler start
# service openstack-nova-compute start
# chkconfig openstack-nova-api on
# chkconfig openstack-nova-cert on
# chkconfig openstack-nova-conductor on
# chkconfig openstack-nova-objectstore on
# chkconfig openstack-nova-scheduler on
# chkconfig openstack-nova-compute on

安装Horizon
yum install -y openstack-dashboard
yum install -y mod_ssl
#keystone role-create --name Member
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | 60b56c45151841018131c14f98052a08 |
|   name   |              Member              |
+----------+----------------------------------+
#service httpd start
#chkconfig httpd on
连接https://10.9.0.206/dashboard/
用户名:admin
密码:PASSWORD

Console Access
yum install -y openstack-nova-novncproxy
openstack-config --set /etc/nova/nova.conf \
DEFAULT novncproxy_host 0.0.0.0
openstack-config --set /etc/nova/nova.conf \
DEFAULT novncproxy_port 6080
openstack-config --set /etc/nova/nova.conf \
DEFAULT novncproxy_base_url http://10.9.0.206:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf \
DEFAULT vnc_enabled true
openstack-config --set /etc/nova/nova.conf \
DEFAULT vncserver_listen 127.0.0.1
openstack-config --set /etc/nova/nova.conf \
DEFAULT vncserver_proxyclient_address 127.0.0.1
service openstack-nova-novncproxy start
service openstack-nova-consoleauth start
chkconfig openstack-nova-novncproxy on
chkconfig openstack-nova-consoleauth on
service openstack-nova-compute restart

使用OpenStack
1、创建key
# nova keypair-add oskey > oskey.priv
# chmod 600 oskey.priv
2、创建Instance
#  nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 1  | m1.tiny   | 512       | 0    | 0         |      | 1     | 1.0         | True      | {}          |
| 2  | m1.small  | 2048      | 20   | 0         |      | 1     | 1.0         | True      | {}          |
| 3  | m1.medium | 4096      | 40   | 0         |      | 2     | 1.0         | True      | {}          |
| 4  | m1.large  | 8192      | 80   | 0         |      | 4     | 1.0         | True      | {}          |
| 5  | m1.xlarge | 16384     | 160  | 0         |      | 8     | 1.0         | True      | {}          |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
# nova image-list
+--------------------------------------+------+--------+--------+
| ID                                   | Name | Status | Server |
+--------------------------------------+------+--------+--------+
| f1d57318-63f6-4670-a4c0-b97db6fab835 | fd   | ACTIVE |        |
+--------------------------------------+------+--------+--------+
# nova boot --flavor 2 --key_name oskey --image f1d57318-63f6-4670-a4c0-b97db6fab835 fedoral
+-------------------------------------+--------------------------------------+
| Property                            | Value                                |
+-------------------------------------+--------------------------------------+
| OS-EXT-STS:task_state               | scheduling                           |
| image                               | fd                                   |
| OS-EXT-STS:vm_state                 | building                             |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000006                    |
| flavor                              | m1.small                             |
| id                                  | 6169db0a-4e70-4fea-9bd3-80f33875215d |
| security_groups                     | [{u'name': u'default'}]              |
| user_id                             | 8179d4236cd147f2a9670df1616882a0     |
| OS-DCF:diskConfig                   | MANUAL                               |
| accessIPv4                          |                                      |
| accessIPv6                          |                                      |
| progress                            | 0                                    |
| OS-EXT-STS:power_state              | 0                                    |
| OS-EXT-AZ:availability_zone         | None                                 |
| config_drive                        |                                      |
| status                              | BUILD                                |
| updated                             | 2013-04-25T05:01:05Z                 |
| hostId                              |                                      |
| OS-EXT-SRV-ATTR:host                | None                                 |
| key_name                            | oskey                                |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                 |
| name                                | fedoral                              |
| adminPass      &nb
推荐阅读
  • centos安装Mysql的方法及步骤详解
    本文介绍了centos安装Mysql的两种方式:rpm方式和绿色方式安装,详细介绍了安装所需的软件包以及安装过程中的注意事项,包括检查是否安装成功的方法。通过本文,读者可以了解到在centos系统上如何正确安装Mysql。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • Linux服务器密码过期策略、登录次数限制、私钥登录等配置方法
    本文介绍了在Linux服务器上进行密码过期策略、登录次数限制、私钥登录等配置的方法。通过修改配置文件中的参数,可以设置密码的有效期、最小间隔时间、最小长度,并在密码过期前进行提示。同时还介绍了如何进行公钥登录和修改默认账户用户名的操作。详细步骤和注意事项可参考本文内容。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 如何在服务器主机上实现文件共享的方法和工具
    本文介绍了在服务器主机上实现文件共享的方法和工具,包括Linux主机和Windows主机的文件传输方式,Web运维和FTP/SFTP客户端运维两种方式,以及使用WinSCP工具将文件上传至Linux云服务器的操作方法。此外,还介绍了在迁移过程中需要安装迁移Agent并输入目的端服务器所在华为云的AK/SK,以及主机迁移服务会收集的源端服务器信息。 ... [详细]
  • CentOS 7部署KVM虚拟化环境之一架构介绍
    本文介绍了CentOS 7部署KVM虚拟化环境的架构,详细解释了虚拟化技术的概念和原理,包括全虚拟化和半虚拟化。同时介绍了虚拟机的概念和虚拟化软件的作用。 ... [详细]
  • CEPH LIO iSCSI Gateway及其使用参考文档
    本文介绍了CEPH LIO iSCSI Gateway以及使用该网关的参考文档,包括Ceph Block Device、CEPH ISCSI GATEWAY、USING AN ISCSI GATEWAY等。同时提供了多个参考链接,详细介绍了CEPH LIO iSCSI Gateway的配置和使用方法。 ... [详细]
  • Centos下安装memcached+memcached教程
    本文介绍了在Centos下安装memcached和使用memcached的教程,详细解释了memcached的工作原理,包括缓存数据和对象、减少数据库读取次数、提高网站速度等。同时,还对memcached的快速和高效率进行了解释,与传统的文件型数据库相比,memcached作为一个内存型数据库,具有更高的读取速度。 ... [详细]
  • Linux下安装免费杀毒软件ClamAV及使用方法
    本文介绍了在Linux系统下安装免费杀毒软件ClamAV的方法,并提供了使用该软件更新病毒库和进行病毒扫描的指令参数。同时还提供了官方安装文档和下载地址。 ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 计算机存储系统的层次结构及其优势
    本文介绍了计算机存储系统的层次结构,包括高速缓存、主存储器和辅助存储器三个层次。通过分层存储数据可以提高程序的执行效率。计算机存储系统的层次结构将各种不同存储容量、存取速度和价格的存储器有机组合成整体,形成可寻址存储空间比主存储器空间大得多的存储整体。由于辅助存储器容量大、价格低,使得整体存储系统的平均价格降低。同时,高速缓存的存取速度可以和CPU的工作速度相匹配,进一步提高程序执行效率。 ... [详细]
  • Linux磁盘的分区、格式化的观察和操作步骤
    本文介绍了如何观察Linux磁盘的分区状态,使用lsblk命令列出系统上的所有磁盘列表,并解释了列表中各个字段的含义。同时,还介绍了使用parted命令列出磁盘的分区表类型和分区信息的方法。在进行磁盘分区操作时,根据分区表类型选择使用fdisk或gdisk命令,并提供了具体的分区步骤。通过本文,读者可以了解到Linux磁盘分区和格式化的基本知识和操作步骤。 ... [详细]
author-avatar
手机用户2602886967
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有