Skip to main content
Skip table of contents

Создание кластера медиасервера

Создание кластера медиасервера

Кластеры нужны для резервирования заведённых потоков. Если основной сервер потока прекращает работу, этот поток поднимается и пишет архив на резервном сервере

POST /api/admin/v1/clusters

Параметры метода

string name, имя кластера


array servers, массив id медиасерверов (минимум 2 сервера)


string type, тип кластера

200 OK

Успешный ответ

JSON
{
    "id": 3,
    "name": "Кластер 3-1",
    "type": "main-secondary",
    "internal": 555,
    "external": 555,
    "m4f": 555,
    "rtsp": 555,
    "publish": 555,
    "streams_limit": 6000,
    "bitrate_limit": 600000,
    "created_at": "2021-05-27 17:14:48",
    "updated_at": "2022-05-27 12:40:39",
    "servers": [
        {
            "id": 5,
            "type": "media_server_v2",
            "schema": "https",
            "domain": "labMS7.vms.local",
            "internal": "8080",
            "external": "8443",
            "m4f": "8443",
            "rtsp": "5554",
            "publish": "555",
            "traffic_in": 7747,
            "traffic_out": 0,
            "status": 1,
            "is_enabled": 1,
            "is_main": 0,
            "has_cache": 0,
            "proxy": "vms.local",
            "created_at": "2021-05-27 16:16:26",
            "updated_at": "2022-05-27 12:40:02",
            "group_type": "all",
            "can_delete": false,
            "streams_limit": 6000,
            "bitrate_limit": 600000,
            "extra": {
                "io": {
                    "read_rate": 0,
                    "read_bytes": 0,
                    "write_rate": 0,
                    "write_bytes": 0
                },
                "cpu": {
                    "total": 12,
                    "usage": 4,
                    "stime_sec": 3327,
                    "utime_sec": 3327
                },
                "mem": {
                    "rss": 280457216,
                    "share": 9302016,
                    "usage": 2447687680
                },
                "net": {
                    "in_bitrate": 7933016,
                    "out_bitrate": 0
                },
                "drives": {
                    "/": {
                        "fs": "ext4",
                        "mount": "/",
                        "inode_free": 1438962,
                        "inode_total": 1605632,
                        "capacity_free": 18041573376,
                        "capacity_total": 25759584256
                    },
                    "/boot": {
                        "fs": "ext4",
                        "mount": "/boot",
                        "inode_free": 65216,
                        "inode_total": 65536,
                        "capacity_free": 704004096,
                        "capacity_total": 1023303680
                    },
                    "/storage": {
                        "fs": "ext4",
                        "mount": "/storage",
                        "inode_free": 32757063,
                        "inode_total": 32768000,
                        "capacity_free": 115594178560,
                        "capacity_total": 527371075584
                    }
                },
                "server": {
                    "ip4": "192.168.200.19",
                    "name": "MS-21.03-lts",
                    "build": "7c80c1d",
                    "uptime": 175679,
                    "startat": 1653468723,
                    "version": "21.03",
                    "hostname": "labMS7.vms.local",
                    "revision": "lts",
                    "timestamp": "20220524110654"
                },
                "cluster": {
                    "id": "3",
                    "node": "7",
                    "enable": "true",
                    "hostname": "labMS7.vms.local"
                },
                "license": {
                    "own": "Vms",
                    "type": "enterprise",
                    "issued": 1685180402
                },
                "streams": {
                    "total": 21,
                    "active": 3,
                    "clients": 0
                },
                "storages": {
                    "/storage": {
                        "fs": "",
                        "err": 0,
                        "name": "default",
                        "mount": "/storage",
                        "inode_free": 32757063,
                        "inode_total": 32768000,
                        "capacity_free": 115594178560,
                        "capacity_total": 527371075584
                    }
                }
            }
        },
        {
            "id": 6,
            "type": "media_server_v2",
            "schema": "https",
            "domain": "labMS8.vms.local",
            "internal": "8080",
            "external": "8443",
            "m4f": "8443",
            "rtsp": "5554",
            "publish": "555",
            "traffic_in": 31891,
            "traffic_out": 8152,
            "status": 1,
            "is_enabled": 1,
            "is_main": 0,
            "has_cache": 0,
            "proxy": ".vms.local",
            "created_at": "2021-05-27 16:17:06",
            "updated_at": "2022-05-27 12:40:02",
            "group_type": "all",
            "can_delete": false,
            "streams_limit": 6000,
            "bitrate_limit": 600000,
            "extra": {
                "io": {
                    "read_rate": 0,
                    "read_bytes": 0,
                    "write_rate": 0,
                    "write_bytes": 0
                },
                "cpu": {
                    "total": 18,
                    "usage": 22,
                    "stime_sec": 15722,
                    "utime_sec": 15722
                },
                "mem": {
                    "rss": 999301120,
                    "share": 10383360,
                    "usage": 2962427904
                },
                "net": {
                    "in_bitrate": 32656224,
                    "out_bitrate": 8347728
                },
                "drives": {
                    "/": {
                        "fs": "ext4",
                        "mount": "/",
                        "inode_free": 1472963,
                        "inode_total": 1605632,
                        "capacity_free": 18250248192,
                        "capacity_total": 25759584256
                    },
                    "/boot": {
                        "fs": "ext4",
                        "mount": "/boot",
                        "inode_free": 65220,
                        "inode_total": 65536,
                        "capacity_free": 807084032,
                        "capacity_total": 1023303680
                    },
                    "/storage": {
                        "fs": "ext4",
                        "mount": "/storage",
                        "inode_free": 32720062,
                        "inode_total": 32768000,
                        "capacity_free": 15834046464,
                        "capacity_total": 527371075584
                    }
                },
                "server": {
                    "ip4": "192.168.200.20",
                    "name": "MS-21.03-lts",
                    "build": "7c80c1d",
                    "uptime": 175679,
                    "startat": 1653468723,
                    "version": "21.03",
                    "hostname": "labMS8.vms.local",
                    "revision": "lts",
                    "timestamp": "20220524110654"
                },
                "cluster": {
                    "id": "3",
                    "node": "8",
                    "enable": "true",
                    "hostname": "labMS8.vms.local"
                },
                "license": {
                    "own": "Vms",
                    "type": "enterprise",
                    "issued": 1685180402
                },
                "streams": {
                    "total": 22,
                    "active": 16,
                    "clients": 4
                },
                "storages": {
                    "/storage": {
                        "fs": "",
                        "err": 0,
                        "name": "default",
                        "mount": "/storage",
                        "inode_free": 32720062,
                        "inode_total": 32768000,
                        "capacity_free": 15834046464,
                        "capacity_total": 527371075584
                    }
                }
            }
        }
    ]
}

401 Unauthorized

Токен авторизации не передан или не валидный Получение токена

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/clusters' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "name": "string",
    "servers": [],
    "type": "string"
}'
PHP
PHP
$data = array (
  'name' => 'string',
  'servers' => 
  array (
  ),
  'type' => 'string',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/clusters', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.