ToB企服应用市场:ToB评测及商务社交产业平台

标题: OpenStack先容说明、OpenStack架构说明、OpenStack焦点服务说明、OpenStack [打印本页]

作者: 罪恶克星    时间: 2024-6-22 12:55
标题: OpenStack先容说明、OpenStack架构说明、OpenStack焦点服务说明、OpenStack
OpenStack先容说明

OpenStack劈头



熟悉openstack【重要】


OpenStack架构说明

OpenStack架构概览


OpenStack逻辑架构


OpenStack生产情况摆设架构示例



OpenStack焦点服务说明

通用组件


认证服务Keystone


Keystone:焦点概念


用户相干说明



服务相干说明


举例:user1用户要登录dashboard查看VM列表


镜像服务Glance


组件和架构



重要概念


计算范围Nova


组件和架构



Nova Compute与Hypervisor


Nova Conductor和Nova Scheduler


Nova Scheduler:Filter Scheduler


Nova Scheduler:Filter


Nova Scheduler:weight


Nova:相干概念



Nova:Availability Zone与Host Aggregate



Nova:Cell



块存储Cinder


Openstack中的存储概念


Cinder说明


架构与组件


Cinder scheduler:Filter


对象存储服务Swift


Cinder scheduler:weight



Cinder volume与后端存储


Cinder volume与后端存储


Cinder volume与后端存储



Cinder 与 Nova 的配合



Cinder:Cinder backup



网络服务Neutron


Neutron:焦点概念


Neutron:组件和架构



Neutron:plugin



Neutron:plugin 和 agent


常见组网:Linux Bridge


Linux Bridge:bridge 和 tap




Router namespace




常见组网:Open vSwitch


Swift:体系架构



Swift:Ring


Swift:数据一致性


Swift:扩展


编排服务Heat


简介


架构


工作流程



模板


  1. heat_template_version: --             ### HOT版本
  2. description:                                  ### 说明
  3.    # a description of the template
  4. parameter_groups:                             ### 指定参数顺序
  5. - label: <human-readable label of parameter group>
  6.    description: <description of the parameter group>
  7.    parameters:
  8.    - <param name>
  9.    - <param name>
  10. parameters:                                   ### 传递的参数
  11.    <param name>:                               ### 参数名
  12.      type: <string | number | json | comma_delimited_list | boolean>  ### 参数类型
  13.      label: <human-readable name of the parameter>  ### 标签
  14.      description: <description of the parameter>
  15.      default: <default value for parameter>
  16.      hidden: <true | false>                    ### 是否隐藏
  17.      constraints:                              ### 已有的内置参数:OS::stack_name、OS::stack_id、OS::project_id
  18.        <parameter constraints>
  19.      immutable: <true | false>
  20. resources:                                  ### 资源对象
  21.    <resource ID>:                            ### 资源的ID
  22.      type: <resource type>                   ### 资源的类型
  23.      properties:                             ### 资源的属性
  24.        <property name>: <property value>
  25.      metadata:                               ### 资源的元数据
  26.        <resource specific metadata>
  27.      depends_on: <resource ID or list of ID>
  28.      update_policy: <update policy>
  29.      deletion_policy: <deletion policy>
  30. outputs:                                    ### 返回值
  31.    <parameter name>:                         ### 参数名
  32.      description: <description>              ### 说明
  33.      value: <parameter value>                ### 输出值
复制代码
例子
  1. heat_temp_version:--
  2. Description: AWS::CloudWatch::Alarm using Ceilometer.
  3. parameters:
  4.    user_name:
  5.      type: string
  6.      label: User Name
  7.      description: User name to be configured for the application
  8.    port_number:
  9.      type: number
  10.      label: Port Number
  11.      description: Port number to be configured for the web server
  12. resources:
  13.    my_instance:
  14.      type: OS::Nova::Server
  15.      properties:
  16.        flavor: m1.small
  17.        image: F18-x86_64-cfntools
  18. outputs:
  19.    instance_ip:
  20.      description: IP address of the deployed compute instance
  21.      value: { get_attr: [my_instance, first_address] }
复制代码
模板内部函数


  1. 语法
  2. get_attr:
  3.    - <resource name>   ### 必须是模板 resouce 段中指定的资源。
  4.    - <attribute name>  ### 要获取的属性,如果属性对应的值是list 或map, 则可以指定key/index来获取具体的值。
  5.    - <key/index > (optional)
  6.    - <key/index > (optional)
  7.    - ...
  8. 示例
  9. resources:
  10.    my_instance:
  11.      type: OS::Nova::Server
  12. # ...
  13. outputs:
  14.    instance_ip:
  15.      description: IP address of the deployed compute instance
  16.      value: { get_attr: [my_instance, first_address] }
  17.    instance_private_ip:
  18.      description: Private IP address of the deployed compute instance
  19.      value: { get_attr: [my_instance, networks, private, ] }
复制代码

  1. 语法
  2. get_file: <content key>
  3. 示例
  4. resources:
  5.    my_instance:
  6.      type: OS::Nova::Server
  7.      properties:
  8.        # general properties ...
  9.        user_data:
  10.          get_file: my_instance_user_data.sh
  11.    my_other_instance:
  12.      type: OS::Nova::Server
  13.      properties:
  14.        # general properties ...
  15.        user_data:
  16.          get_file: http://example.com/my_other_instance_user_data.sh
复制代码

  1. 语法
  2. get_param:
  3.   - <parameter name>
  4.   - <key/index 1> (optional)
  5.   - <key/index 2> (optional)
  6.   - ...
  7. 示例
  8. parameters:
  9.     instance_type:
  10.      type: string
  11.      label: Instance Type
  12.      description: Instance type to be used.
  13.    server_data:
  14.      type: json
  15. resources:
  16.    my_instance:
  17.      type: OS::Nova::Server
  18.      properties:
  19.        flavor: { get_param: instance_type}
  20.        metadata: { get_param: [ server_data, metadata ] }
  21.        key_name: { get_param: [ server_data, keys, 0 ] }
  22. 输出
  23.    {"instance_type": "m1.tiny",
  24.    {"server_data": {"metadata": {"foo": "bar"},"keys": ["a_key","other_key"]}}}
复制代码

  1. 语法
  2. get_resource: <resource ID>
  3. 示例
  4. resources:
  5.    instance_port:
  6.      type: OS::Neutron::Port
  7.      properties: ...
  8.    instance:
  9.      type: OS::Nova::Server
  10.      properties:
  11.        ...
  12.        networks:
  13.          port: { get_resource: instance_port }
复制代码

  1. 语法
  2. list_join:
  3. - <delimiter>
  4. - <list to join>
  5. 示例输出:one,two,three
  6. list_join: [', ', ['one', 'two', 'and three']]
复制代码

  1. 语法
  2. digest:
  3.    - <algorithm>  ### 可用的值是hashlib(md5, sha1, sha224, sha256, sha384, and sha512) 或openssl的相关值
  4.    - <value>
  5. 示例
  6. # from a user supplied parameter
  7. pwd_hash: { digest: ['sha512', { get_param: raw_password }] }
复制代码

  1. 语法
  2. repeat:
  3.    template:
  4.      <template>
  5.    for_each:
  6.      <var>: <list>
  7. 示例
  8. parameters:
  9.    ports:
  10.      type: comma_delimited_list
  11.      label: ports
  12.      default: "80,443,8080"
  13.    protocols:
  14.      type: comma_delimited_list
  15.      label: protocols
  16.      default: "tcp,udp"
  17. resources:
  18.    security_group:
  19.      type: OS::Neutron::SecurityGroup
  20.      properties:
  21.        name: web_server_security_group
  22.        rules:
  23.          repeat:
  24.            for_each:
  25.              <%port%>: { get_param: ports }
  26.              <%protocol%>: { get_param: protocols }
  27.            template:
  28.              protocol: <%protocol%>
  29.              port_range_min: <%port%>
  30. 结果
  31. [{‘protocal’:tpc, ‘prot_range_min’:},
  32. {‘protocal’:tpc, ‘prot_range_min’:},
  33. {‘protocal’:tpc, ‘prot_range_min’:},
  34. {‘protocal’:udp, ‘prot_range_min’:},
  35. {‘protocal’:udp, ‘prot_range_min’:},
  36. {‘protocal’:udp, ‘prot_range_min’:}]
复制代码

  1. 语法
  2. str_replace:
  3.    template: <template string>
  4.    params: <parameter mappings>
  5. 示例
  6. resources:
  7.    my_instance:
  8.      type: OS::Nova::Server
  9.      # general metadata and properties ...
  10. outputs:
  11.    Login_URL:
  12.      description: The URL to log into the deployed application
  13.      value:
  14.        str_replace:
  15.          template: http://host/MyApplication
  16.          params:
  17.            host: { get_attr: [ my_instance, first_address ] }
复制代码

  1. 语法
  2. str_split:
  3.    - ','
  4.    - string,to,split
  5. 示例
  6. str_split: [',', 'string,to,split']
  7. 结果
  8. ['string', 'to', 'split']
复制代码
常用操作


计量服务 Ceilometer


简介

配景


概念


组件


数据处理

数据收集



数据处理


  1. sources: A source is a producer of samples
  2. ......
  3.    - name: cpu_source
  4.      interval: 600  ## Poller 获取 cpu samples 的间隔为 10 分钟
  5.      meters:
  6.          - "cpu"
  7.      sinks:
  8.          - cpu_sink
  9. ......
  10. sinks: A sink on the other hand is a chain of handlers of samples
  11. ......
  12.    - name: cpu_sink
  13.      transformers:  ## 转换器
  14.        - name: "rate_of_change"
  15.          parameters:
  16.                  target:
  17.                      name: "cpu_util"
  18.                      unit: "%"
  19.                      type: "gauge"
  20.                      scale: "100.0 / (10**9 * (resource_metadata.cpu_number or1))"
  21.       publishers:  ## 分发器
  22.           - notifier://
复制代码

数据生存


  1. [DEFAULT]
  2. dispatcher = database
  3. dispatcher = file
  4. [dispatcher_file]
  5. backup_count = 5
  6. file_path = /var/log/ceilometer/ceilometer-samples
  7. max_bytes = 100000
复制代码
数据访问


告警


架构

焦点架构



京东对 Ceilometer 的优化 (摘自京东架构师在2015年初OpenStack meetup 上的材料)


常用操作


OpenStack创建VM,服务间交互示例



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4