免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12345下一页
最近访问板块 发新帖
查看: 92976 | 回复: 45
打印 上一主题 下一主题

[OpenStack] 图解openstack [复制链接]

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
1 [报告]
发表于 2014-08-15 15:01 |只看该作者
本帖最后由 cryboy2001 于 2014-08-15 15:50 编辑

四、openstak使用
密码在/root/下
-rw------- 1 root root 183 Aug 12 17:12 keystonerc_admin
-rw------- 1 root root 180 Aug 12 17:12 keystonerc_demo
这两个文件中,自带的2个用户admin与demo。



项目与管理员及下面的目录



1、在dashboard中,管理员下修改网络功能、加镜像、改云主机类型,云硬盘。然后要部署应用在项目中进行。

加外网(浮动ip段)




上传镜像

云硬盘


下面生成一台虚拟实例,能够上网,能通过外面的电脑ssh进入
进入项目----网络 添加私有网络



加路由加接口


得到的网络拓扑


加安全规责


创建云主机



浏览器直接用的novnc  自动得到的IP与ping openstack服务器 外网的一台主机,表明完全通了



外网ssh进入虚拟主机



挂载云硬盘


在云主机中挂载操作


论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
2 [报告]
发表于 2014-08-15 22:19 |只看该作者
不错不错,希望版主继续更新。

论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
3 [报告]
发表于 2014-08-15 22:20 |只看该作者
问一下版主,vmware vcloud suite和openstack有什么区别吗

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
4 [报告]
发表于 2014-08-16 08:42 |只看该作者
www_xylove 发表于 2014-08-15 22:20
问一下版主,vmware vcloud suite和openstack有什么区别吗


vmware vcloud suite和openstack是同一类产品,都是建立云的系统,但vmware vcloud suite是商业产品,而openstack是开源产品,就与ms windows与linux的区别是一样的,有非常多的其它公司的云操作系统也建立在openstack之上的如:HP Helion,华为的FusionCloud。

有人说openstack就是下一个linux,将成为未来开源的代表。

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
5 [报告]
发表于 2014-08-16 11:08 |只看该作者
本帖最后由 cryboy2001 于 2014-08-16 11:11 编辑

用linux总是离不开用命令行操作

加镜像

glance add name="<Image name>" is_public=true container_format=ovf disk_format=qcow2 < <filename>.img
nova image-list  查看
查看虚拟机类型
nova flavor-list
查看可用网络
nova network-list


生成一个实例要用到以上的镜像、虚拟机类型、和可用网络

nova boot --flavor 1 --image cirros --nic net-id=037c1fa2-3f35-4cab-a229-c236380f4a7b  cmdtest

为虚拟机加浮动ip

nova add-floating-ip cmdtest 192.168.10.24

查看生成的虚拟机

nova show cmdtest





利用浮动ip,从公网ssh进入



加一10G云盘

nova volume-create --display_name vdisk10 10

nova volume-list

nova volume-attach cmdtest vdisk10 /dev/vdb

可看到已加成功,可分区挂载使用了



附其它命令

nova     
     absolute-limits     Print a list of absolute limits for a user
     actions             Retrieve server actions.
     add-fixed-ip        Add new IP address to network.
     add-floating-ip     Add a floating IP address to a server.
     add-secgroup        Add a Security Group to a server.
     aggregate-add-host  Add the host to the specified aggregate.
     aggregate-create    Create a new aggregate with the specified details.
     aggregate-delete    Delete the aggregate by its id.
     aggregate-details   Show details of the specified aggregate.
     aggregate-list      Print a list of all aggregates.
     aggregate-remove-host    Remove the specified host from the specified  aggregate.
     aggregate-set-metadata Update the metadata associated with the aggregate.
     aggregate-update    Update the aggregate's name and optionally  availability zone.
     boot                Boot a new server.
     cloudpipe-create    Create a cloudpipe instance for the given project
     cloudpipe-list      Print a list of all cloudpipe instances.
     cloudpipe-update Update a cloudpipe instance
     console-log         Get console log output of a server.
     credentials         Show user credentials returned from auth
     delete              Immediately shut down and delete a server.
     diagnostics         Retrieve server diagnostics.
     dns-create          Create a DNS entry for domain, name and ip.
     dns-create-private-domain  Create the specified DNS domain.
     dns-create-public-domain  Create the specified DNS domain.
     dns-delete          Delete the specified DNS entry.
     dns-delete-domain   Delete the specified DNS domain.
     dns-domains         Print a list of available dns domains.
     dns-list            List current DNS entries for domain and ip or domain and name.
     endpoints           Discover endpoints that get returned from the  authenticate services
     fixed-ip-get        Show information for a fixed IP
     fixed-ip-reserve    Reserve a fixed IP
     fixed-ip-unreserve  Unreserve fixed IP
     flavor-create       Create a new flavor
     flavor-delete       Delete a specific flavor
     flavor-key          Set or unset extra_spec for a flavor.
     flavor-list         Print a list of available 'flavors' (sizes of servers).
     flavor-show         Show details about the given flavor.
     floating-ip-create  Allocate a floating IP for the current tenant.
     floating-ip-delete  De-allocate a floating IP.
     floating-ip-list    List floating ips for this tenant.
     floating-ip-pool-list List all floating ip pools.
     get-vnc-console     Get a vnc console to a server.
     host-action         Perform a power action on a host.
     host-describe       Describe a specific host
     host-list           List all hosts by service
     host-update         Update host settings.
     hypervisor-list     List hypervisors.
     hypervisor-servers  List instances belonging to specific hypervisors.
     hypervisor-show     Display the details of the specified hypervisor.
     hypervisor-stats    Get hypervisor statistics over all compute nodes.[cpu,mem]
     hypervisor-uptime   Display the uptime of the specified hypervisor.
     image-create        Create a new image by taking a snapshot of a running server.
     image-delete        Delete an image.
     image-list          Print a list of available images to boot from.
     image-meta          Set or Delete metadata on an image.
     image-show          Show details about the given image.
     keypair-add         Create a new key pair for use with instances
     keypair-delete      Delete keypair by its id
     keypair-list        Print a list of keypairs for a user
     list                List active servers.
     list-extensions List available extensions
     live-migration      Migrates a running instance to a new machine.
     lock                Lock a server.
     meta                Set or Delete metadata on a server.
     migrate             Migrate a server.
     network-list        Print a list of available networks.
     network-show        Show details about the given network.
     pause               Pause a server.
     quota-class-show    List the quotas for a quota class.
     quota-class-update  Update the quotas for a quota class.
     quota-defaults      List the default quotas for a tenant.
     quota-show          List the quotas for a tenant.
     quota-update        Update the quotas for a tenant.
     rate-limits         Print a list of rate limits for a user
     reboot              Reboot a server.
     rebuild             Shutdown, re-image, and re-boot a server.
     remove-fixed-ip     Remove an IP address from a server.
     remove-floating-ip  Remove a floating IP address from a server.
     remove-secgroup     Remove a Security Group from a server.
     rename              Rename a server.
     rescue              Rescue a server.
     reset-state         Reset the state of an instance
     resize              Resize a server.
     resize-confirm      Confirm a previous resize.
     resize-revert       Revert a previous resize (and return to the previous VM).
     resume              Resume a server.
     root-password       Change the root password for a server.
     secgroup-add-group-rule
     Add a source group rule to a security group.
     secgroup-add-rule   Add a rule to a security group.
     secgroup-create     Create a security group.
     secgroup-delete     Delete a security group.
     secgroup-delete-group-rule
     Delete a source group rule from a security group.
     secgroup-delete-rule
     Delete a rule from a security group.
     secgroup-list       List security groups for the current tenant.
     secgroup-list-rules
     List rules for a security group.
     service-list        List nova services
     show                Show details about the given server.
     ssh                 SSH into a server.
     start               Start a server.
     stop                Stop a server.
     suspend             Suspend a server.
     unlock              Unlock a server.
     unpause             Unpause a server.
     unrescue            Unrescue a server.
     usage-list          List usage data for all tenants
     volume-attach       Attach a volume to a server.
     volume-create       Add a new volume.
     volume-delete       Remove a volume.
     volume-detach       Detach a volume from a server.
     volume-list         List all the volumes.
     volume-show         Show details about a volume.
     volume-snapshot-create      Add a new snapshot.
     volume-snapshot-delete      Remove a snapshot.
     volume-snapshot-list      List all the snapshots.
     volume-snapshot-show       Show details about a snapshot.
     volume-type-create  Create a new volume type.
     volume-type-delete  Delete a specific flavor.
     volume-type-list    Print a list of available 'volume types'.
     x509-create-cert    Create x509 cert for a user in tenant.
     x509-get-root-cert  Fetches the x509 root cert.

论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
6 [报告]
发表于 2014-08-16 18:57 |只看该作者
感觉openstack非常复杂,vmware vcloud也很复杂。
期待版主持续更新openstack,可以写一个openstack的系列,从最简单的介绍,再慢慢深入。

论坛徽章:
0
7 [报告]
发表于 2014-08-18 08:43 |只看该作者
如果只有一种hypervisor,感觉没必要用openstack

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
8 [报告]
发表于 2014-08-18 10:08 |只看该作者
zzpiggy 发表于 2014-08-18 08:43
如果只有一种hypervisor,感觉没必要用openstack


以现在来说,一个信息中心用一种hypervisor机率的很大,以后可能会有改变。

openstack包含的东西太多了,包含交互界面,权限管理,虚拟化服务器(hypervisor)、网络(含虚拟与实体,更象是sdn)、存储(块、对象、文件)、安全(防火墙等)。更关键的是它可以很方便的出售服务,还有openstack是开放性的,以后有新的功能,都能通过api集成进去。

如果,只是几台服务器,十几台虚拟机则根本不用考虑openstack或vm vsphere等,直接用hypervisor就可以了。openstack号称百万服务器千万虚拟机级别的信息中心,前几年国内大公司已达到2000台服务器的集成。

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
9 [报告]
发表于 2014-08-20 14:26 |只看该作者
本帖最后由 cryboy2001 于 2014-08-20 14:29 编辑

管理openstack

1、服务
在控制台系统信息中也能看到

OpenStack中Nova相关的服务
nova-compute:运行虚拟机实例最主要的服务。
nova-scheduler:管理调度服务器满足对运行虚拟机的请求。
nova-api:处理对OpenStack的请求,并运行相应的服务。
neutron:控制DHCP、DNS、路由的网络服务。
nova-objectstore:文件存储服务。
nova-common:OpenStack环境的基础Python库。
nova-cert:Nova证书管理服务,用来为Nova提供身份验证。
glance:镜像注册与传输服务。
rabbitmq-server:消息队列服务。
mysql-server:保存所有OpenStack服务数据的数据库服务,例如可用的计算节点、实例状态等。
ntp:网络时间协议,它在多节点的环境中十分重要,可以让计算节点保持相同的时钟。
dnsmasq:前向DNS和DHCP服务,用来为实例分配地址。




2、日志
与openstack相关的日志都在
#ll  /var/log
drwxr-x--- 2 rabbitmq rabbitmq 4096 Aug 17 03:47 rabbitmq
drwxr-xr-x 2 root root 4096 Aug 17 03:47 openvswitch
drwxr-x--- 2 nova nova 4096 Aug 17 03:47 nova
drwxr-xr-x 2 neutron neutron 4096 Aug 17 03:47 neutron
drwxr-x--- 2 keystone keystone 4096 Aug 17 03:47 keystone
drwxr-xr-x 2 glance nobody 4096 Aug 17 03:47 glance
drwxr-x--- 2 cinder root 4096 Aug 17 03:47 cinder
drwxr-xr-x 2 ceilometer root 4096 Aug 17 03:47 ceilometer
drwxr-xr-x 2 mongodb root 4096 Aug 17 03:47 mongodb
drwx------ 5 root root 4096 Aug 14 10:20 libvirt

要查看一个实例日志


3、监控与nagios
管理员---资源使用情况    中有服务器的监控



系统也已安装好了nagios
http://192.168.0.218/nagios/
密码在下面的位置
# cat /etc/nagios/passwd
nagiosadmin:eYuEUytV/nRpI
nagios相关配置文件在,可以修改参数已达到资源使用到一定成度时或服务停止运行时报警。
#ll /etc/nagios
total 96
-rw-rw-r-- 1 root root 11658 Aug 31 2013 cgi.cfg
drwxr-x--- 2 root nagios 4096 Aug 31 2013 conf.d
-rw------- 1 nagios root 141 Aug 14 10:30 keystonerc_admin
-rw-rw-r-- 1 root root 44650 Aug 14 10:30 nagios.cfg
-rw-r--r-- 1 nagios nagios 1016 Aug 14 10:30 nagios_command.cfg
-rw-r--r-- 1 nagios nagios 331 Aug 14 10:30 nagios_host.cfg
-rw-r--r-- 1 nagios nagios 1295 Aug 14 10:30 nagios_service.cfg
-rw-r--r-- 1 nagios nagios 8077 Aug 14 10:30 nrpe.cfg
drwxr-x--- 2 root nagios 4096 Aug 14 10:30 objects
-rw-r----- 1 root apache 27 Aug 14 10:30 passwd
drwxr-x--- 2 root nagios 4096 Aug 14 10:30 private


nogias界面



nogias监控内容

在命令行方式下也可以看到使用情况:



在数据库中也能找到



论坛徽章:
3
白羊座
日期:2014-08-25 15:04:112014年中国系统架构师大会
日期:2014-10-14 15:59:002015元宵节徽章
日期:2015-03-06 15:52:30
10 [报告]
发表于 2014-08-25 09:24 |只看该作者
你安装过程中有那么多的错误,是如何处理的,怎样完成安装啊。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP