How to show_nodes shows global IP

ett

Member
In this case, Edge will accept subscribers on public IP and will pull streams from Origin via private IP. You should set IP addresses, not hostnames.
As a result, CDN will be available for external clients, and private network will be used for internal CDN traffic.
As per the advice here, I specified the local IP of the origin to cdn_point_of_entry.
Then /cdn/show_nodes outputs the local IP of the edge.
(If specify the global IP of the origin to cdn_point_of_entry, then the edge IP is a global IP.)
We need the global IP because we are calling /cdn/show_nodes from the client and selecting the edge connection destination.

1. I want to set cdn_point_of_entry to local IP for internal CDN traffic.
2. It doesn't matter what method I use, I want to get a list of global IPs of the edge.

Do you have any advice?

Code:
ip={{ GLOBAL }}
ip_local=192.168.0.2
cdn_ip=192.168.0.2

cdn_enabled=true
cdn_nodes_resolve_ip=false
cdn_role=origin
cdn_point_of_entry=
Code:
ip={{ GLOBAL }}
ip_local=192.168.0.100
cdn_ip=192.168.0.100

cdn_enabled=true
cdn_nodes_resolve_ip=false
cdn_role=edge
cdn_point_of_entry=192.168.0.2
 

Max

Administrator
Staff member
1. I want to set cdn_point_of_entry to local IP for internal CDN traffic.
2. It doesn't matter what method I use, I want to get a list of global IPs of the edge.

Do you have any advice?
We recommend you to deploy a separate backend server in the same network. The backend server should:
1. Periodically send REST API query /cdn/show_nodes to Origin node
2. Parse Edges local IPs from /cdn/show_nodes response
3. On every edge, execute some script via SSH to detect Edge global IP, for example (AWS EC2 case):
Code:
#!/bin/bash
global_ip=$(curl --max-time 1 -s -f http://169.254.169.254/latest/meta-data/public-ipv4)
if [[ $? -eq 0 ]]; then
echo "global_ip=$global_ip"
exit 0
fi
exit 1
Or you can setup custom statisctics collection on Edges using the script above, and get global IP from statistics page
Code:
curl -s 'http://edge_local_ip:8081/?action=stat&params=global_ip'
4. Collect the actual list of Edges global IPs
Then, frontend should get the actual list of Edge global IPs from backend and connect a subscriber to some of them.
 

ett

Member
Thank you, Max.
I understood very well what you are saying.

I'm going to do it using DNS such as below. It may be a little hack.
Code:
edge-192-168-0-100.example.com    A    gl.ob.al.ip
 

ett

Member
Hi, Max.

I did not understand what you said correctly.
You said "If one of them is not a static IP, there is a problem.".
I thought there was no problem.

Today, I stopped the edge instance(=OLD_EDGE,172.16.40.193) and started a new edge instance(=NEW_EDGE,172.16.40.37).
Then, the server_log of cdn_point_of_entry(=ENTRY) showing this log endlessly.
Code:
06:40:49,755 ERROR             CDNNodes - Thread-47 Failed to connect to node 172.16.40.193
06:40:49,756 INFO                     C - CDNOutbound-BOSS-pool-35-thread-1 Exception on channel [id: 0x124b9f5f, null :> /172.16.40.193:8084], No route to host
For some reason, OLD_EDGE continued to appear even after restarting webcallserver, even though it no longer existed on EC2.
(The nodes information saved into Shared Memory?)

In that time, /cdn/show_nodes returned this.

Code:
[
  {
    "processingState": "UNKNOWN",
    "inboundConnected": false,
    "globalState": "PASSIVE",
    "outboundConnected": false,
    "version": "2.0",
    "role": "ORIGIN",
    "id": "172.16.40.193"
  },
  {
    "connectionStats": { ... },
    "processingState": "NEW_STREAMS_ALLOWED",
    "inboundConnected": true,
    "globalState": "ACTIVE",
    "outboundConnected": false,
    "version": "2.5",
    "role": "EDGE",
    "id": "172.16.40.37"
  }
]
It contains an OLD_EDGE that should not exist.

I set the timeout with cdn_nodes_timeout=600 and restarted webcallserver again.
Then the ENTRY error log stopped and /cdn/show_nodes correctly returned only one NEW_EDGE.

Does this occurrence have anything to do with what you said about "If one of them is not a static IP, there is a problem."?
Or, what are the problems when operating dynamic IPs using DDNS?

FYI: WCS 5.2.878-0fa519866a01f772758d01a8bde7f31717e07b85
 
Last edited:

Max

Administrator
Staff member
It contains an OLD_EDGE that should not exist.

I set the timeout with cdn_nodes_timeout=600 and restarted webcallserver again.
Then the ENTRY error log stopped and /cdn/show_nodes correctly returned only one NEW_EDGE.
This is normal behaviour if you are setting cdn_nodes_timeout=-1. To remove obsolete node from CDN, use /cdn/remove_node REST API query.
Does this occurrence have anything to do with what you said about "If one of them is not a static IP, there is a problem."?
Or, what are the problems when operating dynamic IPs using DDNS?
No. The problem with dynamic ip affects entering a node to CDN. If cdn_point_of_entry on node A is set to node B address, and node B is restarted with changing its address, node A cannot enter to CDN because it cannot connect to node B. So, if entry point node is restarted, you have to change this setting on all nodes.
 

ett

Member
This is normal behaviour if you are setting cdn_nodes_timeout=-1. To remove obsolete node from CDN, use /cdn/remove_node REST API query.
I see. It is not documented in API methods.

No. The problem with dynamic ip affects entering a node to CDN. If cdn_point_of_entry on node A is set to node B address, and node B is restarted with changing its address, node A cannot enter to CDN because it cannot connect to node B. So, if entry point node is restarted, you have to change this setting on all nodes.
Based on the story, as long as ENTRY is a static IP, it's fine, right?
 
Top