首页 > 解决方案 > 无法录制视频

问题描述

我们有连续传输视频的摄像机。对于每个用户会话,我们都会录制视频。我有一个视频流服务(使用节点媒体服务器),相机一直在其上流式传输视频。还有另一种录音服务。每当用户执行身份验证操作(登录)时,我都会从录制服务中生成一个进程,并创建一个写入流。当用户注销时,我会终止正在发生录制的衍生进程,并将视频上传到谷歌存储桶。

我的问题是 0 字节的视频。平均而言,这似乎发生了 50 次中的三次。

当 pod 重新启动时,问题就开始了。我只有一个吊舱。(这足以满足我的 cpu 和内存要求。我目前只有 20 台摄像头可供流式传输)。此外,还有这个限制,如果我在 VM1 上有 2 个 pod,另一个在 VM2 上,那么我需要知道进程将分配到哪个 VM(或 pod),以便终止进程。我认为在不久的将来,我将不得不增加 pod 的数量,我很快就会面临这个问题。

每当 Pod 重新启动时(由于我仍然不知道的原因。我检查了容器审计日志以找出我的 Pod 重新启动的原因,但这对我没有多大帮助,我请求的资源也足以满足我的负载)和如果有任何正在积极进行记录的过程,它们将丢失。我的录音失败了。我相信这就是我看到那些 0 字节视频的原因。

我如何确保如果所有 pod 都重新启动,则不应立即终止活动进程。或者,如果有办法延迟 pod 重启,直到当前录制完成(我非常怀疑这是否可能)。

标签: video-streaminggoogle-kubernetes-enginekubernetes-pod

解决方案


If you have multiple pod and if you want to know the pods belong to the nodes that can be achieved by below command:

$kubectl get pods -o wide

In order to resolve the issue you need to determine the reasons for pod failure. Thus, you can describe the pod by issuing below mentioned command:

$ kubectl describe pod your-pod-name

It will show you events sent by the kubelet to the apiserver about the lifecycle of the pod. And you will get the reasons for pod failure from here, so that you can take action accordingly. Additionally, you can use below commands to get the events of pods in default namespace.

$kubectl get events -n default

For more information please follow the article click here.


推荐阅读