How to change OpenVidu configuration#
The following steps are valid to change any configuration file in any deployment type. Simply just go to one of your Master Nodes, or the only Node in your deployment, and follow these steps:
- Go to one of your Master Nodes (or the only node in your deployment).
- Go to
/opt/openvidu/config
directory. - Find and change the configuration parameter you want to modify, it could be any file:
openvidu.env
,master_node.env
,livekit.yaml
,egress.yaml
, etc. -
Restart OpenVidu just by executing:
Notice that you only need to restart OpenVidu in one of the Master Nodes (or the only node in your deployment) to apply the changes to all the nodes.
Types of configuration files#
Configuration files can be divided into three types:
openvidu.env
: This file defines configuration parameters used by other services. Such as the domain name, credentials, etc.master_node.env
andmedia_node.env
(Only in Elastic and High Availability): These files define specific configuration parameters of the node they are placed in. It is very useful when you want to have different parameter values in different nodes.-
<service>.yaml
or<service>.env
: These files define the configuration of each service. For example,livekit.yaml
defines the configuration of the OpenVidu Server,egress.yaml
defines the configuration of the Egress Service, etc.These files make use of the parameters defined in the
openvidu.env
,master_node.env
, andmedia_node.env
files. For example, any service configuration file can access theDOMAIN_NAME
parameter defined in theopenvidu.env
file by using this syntax:You can check the OpenVidu Configuration In depth section to learn more about how the configuration system works.
Config files#
These are the configuration files for each kind of deployment:
The single node has all configuration files in the same directory /opt/openvidu/config/
:
OpenVidu Elastic has all the cluster configuration at /opt/openvidu/config/cluster/
with each configuration file separated depending on the node they are placed in: master_node
or media_node
. The file openvidu.env
is placed at /opt/openvidu/config/cluster/
because it is used by services of both types of nodes.
Specific parameter values of each Master Node are placed at /opt/openvidu/config/node/master_node.env
.
Master Node
|-- /opt/openvidu/config/
|-- cluster/
| |-- openvidu.env
| |-- master_node/
| | |-- grafana/
| | |-- app.env
| | |-- caddy.yaml
| | |-- dashboard.env
| | |-- loki.yaml
| | |-- mimir.yaml
| | |-- minio.env
| | |-- mongo.env
| | |-- operator.env
| | |-- promtail.yaml
| | |-- redis.env
| | `-- v2compatibility.env
| `-- media_node/
| |-- egress.yaml
| |-- ingress.yaml
| |-- livekit.yaml
| |-- prometheus.yaml
| `-- promtail.yaml
`-- node/
`-- master_node.env
Media Node
The Media Node in contrast has only the media_node.env
file, because the configuration is centralized in the Master Node.
OpenVidu High Availability has all the cluster configuration at /opt/openvidu/config/cluster/
with each configuration file separated depending on the node they are placed in: master_node
or media_node
. The file openvidu.env
is placed at /opt/openvidu/config/cluster/
because it is used by services of both types of nodes.
Specific parameter values of each Master Node are placed at /opt/openvidu/config/node/master_node.env
.
Master Node
|-- /opt/openvidu/config/
|-- cluster/
| |-- openvidu.env
| |-- master_node/
| | |-- grafana/
| | |-- app.env
| | |-- caddy.yaml
| | |-- dashboard.env
| | |-- loki.yaml
| | |-- mimir.yaml
| | |-- minio.env
| | |-- mongo.env
| | |-- operator.env
| | |-- promtail.yaml
| | |-- redis.env
| | `-- v2compatibility.env
| `-- media_node/
| |-- caddy.yaml
| |-- egress.yaml
| |-- ingress.yaml
| |-- livekit.yaml
| |-- prometheus.yaml
| `-- promtail.yaml
`-- node/
`-- master_node.env
Media Node
The Media Node in contrast has only the media_node.env
file, because the configuration is centralized in the Master Node.
Troubleshooting configuration#
After changing the configuration and restarting, you need to make sure that the changes have been applied correctly. Here are some tips to check if something is wrong. All the following commands must be executed in one of the Master Nodes (or the only node in your deployment):
-
Execute a
docker ps
. If you see anopenvidu-init
container constantly restarting, it means that the configuration file you modified has a syntax error. Check the logs of this container to see the error with:The log is self-explanatory and will tell you what is wrong with the configuration file:
service 'openvidu': Failed to process config file '/opt/openvidu/config/livekit.yaml': Errors found: * Error at line 18: Unmatched opening brace at position 7
Once fixed, restart OpenVidu again:
-
Execute a
docker ps
. If you don't see theopenvidu-init
container, but you see some containers restarting, check the logs of those restarting containers to see what is wrong: -
If all the containers are running correctly, execute the following command:
If you have an error like: 'No such file or directory' or simply the file is empty, the configuration is correct. If the file exists with content, some nodes may be malfunctioning. Check this file and failing container logs for errors.
This is how the log file looks when there are Media Nodes with errors:
[2024-10-09T05:54:29Z] [ERROR] Error in Media Node - 10.5.0.5: Container 'openvidu' error: could not parse config: yaml: unmarshal errors: line 17: cannot unmarshal !!str `trueee` into bool [2024-10-09T05:54:29Z] [ERROR] Error in Media Node - 10.5.0.4: Container 'openvidu' error: could not parse config: yaml: unmarshal errors: line 17: cannot unmarshal !!str `trueee` into bool
As you can see, the log informs you about which Media Node is failing and the error that is causing the failure, so in this way you can fix the file which is causing the error. Once fixed, restart OpenVidu again:
And again, check the logs until no errors appear.