菜单

Agent--InSpur浪潮云

下载

描述:

浪潮云的备份代理配置需首先按照OpenStack备份代理的配合步骤生产环境中,由于keystone的api同一个模块会返回多个endpoint,因此需要通过配置文件确认各个不同的模块应使用哪个endpoint。

前提条件

按照手册 Agent--OpenStack 配置虚拟化平台。

修改EndPoint配置文件

获取EndPoint列表

访问KeyStone认证接口http://<keystone_ip>:<keystone_port>/<api_version>/auth/tokens获取云平台的EndPoint列表,认证接口示例:http://192.168.110.5:5000/v3/auth/tokens

修改配置文件

3.1.x以后版本

配置文件位于${unispace_base_dir}/bin/virt/config/endpoint_config.json

3.1.x以前版本

配置文件位于${unispace_base_dir}/bin/openstack/config/endpoint_config.json

以下内容为实际环境中的配置,正常情况下,浪潮云使用以下配置即可,无需做额外的设置,如果有特殊情况可根据实际的查询结果配置。

复制代码
{
        "nova":{
                "host": "http://nova.openstack.svc.gd-jm-jmzwjf-zww-icpc86.myinspurcloud.com",
                "version": "2.1",
                "name": "nova",
                "type": "compute",
                "interface_name": "public",
                "mapping": {}
        },
        "cinder":{
                "host": "http://cinder.openstack.svc.gd-jm-jmzwjf-zww-icpc86.myinspurcloud.com",
                "version": "3",
                "name": "cinderv3",
                "type": "volumev3",
                "interface_name": "public",
                "mapping": {}
        },
        "glance":{
                "host": "http://glance.openstack.svc.gd-jm-jmzwjf-zww-icpc86.myinspurcloud.com",
                "version": "2",
                "name": "glance",
                "type": "image",
                "interface_name": "public",
                "mapping": {}
        },
        "neutron":{
                "host": "http://neutron.openstack.svc.gd-jm-jmzwjf-zww-icpc86.myinspurcloud.com",
                "version": "2.0",
                "name": "neutron",
                "type": "network",
                "interface_name": "public",
                "mapping": {}
        }
}

参数说明

name:模块名称,系统会根据名称确定对应模块的 endpoint
type:模块类型,系统会根据类型确定对应模块的 endpoint
version:endpoint 版本,系统会在支持的 endpoint 版本中使用此配置的版本号,默认会取对应模块最新支持的 endpoint 版本
interface_name:endpoint inerface类型,默认会优先取 internal,浪潮云环境中需配置public
mapping:endpoint host 映射,如配置的host不是直接行访问的 host, 可通过此配置映射成代理节点可访问的 host,浪潮云环境中无需配置

修改hosts表

需要将主机 hostname 映射到当前主机回环地址 127.0.0.1。
通过上一步确认每个模块使用的endpoint后,如果访问节点无法解析endpoint的地址,需要将endpoint的地址加到访问节点的/etc/hosts表中。

示例

以volume的endpoint为例:

获取EndPoint列表

http://<keystone_ip>:<keystone_port>/<api_version>/auth/tokens获取EndPoints列表

language 复制代码
curl --location 'http://192.168.110.5:5000/v3/auth/tokens' \
--header 'Content-Type: application/json' \
--data '{
    "auth": {
        "identity": {
            "methods": [
                "password"
            ],
            "password": {
                "user": {
                    "name": "username",
                    "domain": {
                        "id": "default"
                    },
                    "password": "password"
                }
            }
        }
    }
}'

在返回结果中找到volume,例子中返回了两个版本的endpoint,每个endpoint有三种interface类型:

json 复制代码
{
    "token": {
        "is_domain": false,
      
        "catalog": [
             ...
            {
                "endpoints": [
                    {
                        "url": "http://public-ip:8776/v3/2a70276a202b4a419ad0c46c6de619af",
                        "interface": "public"                    
                    },
                    {
                        "url": "http://admin-ip:8776/v3/2a70276a202b4a419ad0c46c6de619af",
                        "interface": "admin",
                    },
                    {
                        "url": "http://internal-ip:8776/v3/2a70276a202b4a419ad0c46c6de619af",
                        "interface": "internal"
                    }
                ],
                "type": "volumev3",
                "name": "cinderv3"
            },
            {
                "endpoints": [
                    {
                        "url": "http://admin-ip:8776/v2/2a70276a202b4a419ad0c46c6de619af",
                        "interface": "admin"
                    },
                    {
                        "url": "http://public-ip:8776/v2/2a70276a202b4a419ad0c46c6de619af"
                        "interface": "public"
                    },
                    {
                        "url": "http://internal:8776/v2/2a70276a202b4a419ad0c46c6de619af",
                        "interface": "internal"
                    }
                ],
                "type": "volumev2",
                "name": "cinderv2"
            }
        ]
    }
}

读取配置文件

配置文件中配置了使用的volume模块使用的enpoint为:
name:cinderv3
type:volumev3
interface_name:public

language 复制代码
"cinder":{
            "name": "cinderv3",
            "type": "volumev3",
            "version": "",
            "interface_name": "public",
            "mapping": {}
},

从列表中匹配到满足以上条件的endpoint的url为
http://public-ip:8776/v3/2a70276a202b4a419ad0c46c6de619af

修改hosts表

如果访问节点无法直接解析public-ip,则需要将 public-ip 的解析加到/etc/hosts表中

分享文章
上一个
Agent--SANGFOR深信服
下一个
Agent--SQLServer
最近修改: 2025-11-28