Kurento Docker: 无法连接到 127.0.0.1 端口 8888: 连接被拒绝
Kurento Docker: Failed to connect to 127.0.0.1 port 8888: Connection refused
刚在里面做了 docker build -t kurento-media-server .
:https://github.com/Kurento/kurento-docker/tree/master/kurento-media-server。
一切都已建成。我 运行 docker run -p 8888:8888 kurento-media-server
然后 curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: 127.0.0.1:8888" -H "Origin: 127.0.0.1" http://127.0.0.1:8888/kurento
。它错误的说它无法连接到端口。
容器的输出如下:
+ set -e
+ '[' -n '' ']'
+ '[' -n '' -a -n '' ']'
+ sed /::1/d
+ cat /etc/hosts
+ tee /etc/hosts
+ exec /usr/bin/kurento-media-server
libdc1394 error: Failed to initialize libdc1394
0:00:00.388968390 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:173:loadModules: Found module: /usr/lib/x86_64-linux-gnu/kurento/modules/libkmsfiltersmodule.so
0:00:00.391239217 1 0x1a0ed80 DEBUG KurentoModuleManager ModuleManager.cpp:89:loadModule: Module loaded from /usr/lib/x86_64-linux-gnu/kurento/modules/libkmsfiltersmodule.so
0:00:00.391323949 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:135:loadModule: Loaded filters version 6.6.2 generated at Jul 25 2017 13:36:15
0:00:00.391373374 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:173:loadModules: Found module: /usr/lib/x86_64-linux-gnu/kurento/modules/libkmselementsmodule.so
0:00:00.397720952 1 0x1a0ed80 DEBUG KurentoModuleManager ModuleManager.cpp:89:loadModule: Module loaded from /usr/lib/x86_64-linux-gnu/kurento/modules/libkmselementsmodule.so
0:00:00.397775428 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:135:loadModule: Loaded elements version 6.6.3 generated at Aug 11 2017 20:18:10
0:00:00.397813668 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:173:loadModules: Found module: /usr/lib/x86_64-linux-gnu/kurento/modules/libkmscoremodule.so
0:00:00.400336082 1 0x1a0ed80 DEBUG KurentoModuleManager ModuleManager.cpp:89:loadModule: Module loaded from /usr/lib/x86_64-linux-gnu/kurento/modules/libkmscoremodule.so
0:00:00.400394600 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:135:loadModule: Loaded core version 6.6.3 generated at Aug 11 2017 19:36:36
0:00:00.400440935 1 0x1a0ed80 INFO KurentoMediaServer main.cpp:238:main: Kmsc version: 6.6.2
0:00:00.400446370 1 0x1a0ed80 INFO KurentoMediaServer main.cpp:239:main: Compiled at: Jul 25 2017 13:53:46
0:00:00.400450958 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:230:loadConfig: Reading configuration from: /etc/kurento/kurento.conf.json
0:00:00.401349714 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:167:loadModulesConfigFromDir: Looking for config files in /etc/kurento/modules
0:00:00.401476528 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:167:loadModulesConfigFromDir: Looking for config files in /etc/kurento/modules/kurento
0:00:00.402000771 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/MediaElement.conf.ini
0:00:00.402443799 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini
0:00:00.402952686 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
0:00:00.403411471 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/UriEndpoint.conf.ini
0:00:00.403949526 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/SdpEndpoint.conf.json
0:00:00.404450739 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/HttpEndpoint.conf.ini
0:00:00.404520754 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:246:loadConfig: Configuration loaded successfully
0:00:00.404618365 1 0x1a0ed80 DEBUG KurentoLoadConfig loadConfig.cpp:252:loadConfig: Effective loaded config:
{
"mediaServer":
{
"resources":
{
"garbageCollectorPeriod": "240"
},
"net":
{
"websocket":
{
"port": "8888",
"path": "kurento",
"threads": "10"
}
}
},
"configPath": "\/etc\/kurento",
"modules":
{
"kurento":
{
"MediaElement":
{
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"BaseRtpEndpoint":
{
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"WebRtcEndpoint":
{
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"UriEndpoint":
{
"defaultPath": "file:\/\/\/var\/kurento\/",
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"SdpEndpoint":
{
"numAudioMedias": "1",
"numVideoMedias": "1",
"audioCodecs":
[
{
"name": "opus\/48000\/2"
},
{
"name": "PCMU\/8000"
},
{
"name": "AMR\/8000"
}
],
"videoCodecs":
[
{
"name": "VP8\/90000"
},
{
"name": "H264\/90000"
}
],
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"HttpEndpoint":
{
"serverAddress": "localhost",
"port": "9091",
"configPath": "\/etc\/kurento\/modules\/kurento"
}
}
}
}
0:00:00.404814109 1 0x1a0ed80 INFO KurentoServerMethods ServerMethods.cpp:89:ServerMethods: Not enough resources exception will be raised when resources reach 0.800000
0:00:00.405296158 1 0x1a0f2a0 DEBUG KurentoWorkerPool WorkerPool.cpp:39:workerThreadLoop: Working thread starting
0:00:00.405839379 1 0x1a0ed80 INFO KurentoWebSocketTransport WebSocketTransport.cpp:209:WebSocketTransport: Secure websocket server not enabled
0:00:00.405310438 1 0x7f4c68001840 DEBUG KurentoWorkerPool WorkerPool.cpp:39:workerThreadLoop: Working thread starting
0:00:00.407012759 1 0x1a0ed80 INFO KurentoMediaServer main.cpp:256:main: Mediaserver started
0:04:00.405721382 1 0x7f4c60001780 DEBUG KurentoMediaSet MediaSet.cpp:122:doGarbageCollection: Running garbage collector
有时我忘记 Linux 指令不等于 Docker 运行 Mac 指令。
curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: 172.16.88.128:8888" -H "Origin: 127.0.0.1" http://172.16.88.128:8888/kurento
是正确的命令,其中 non-localhost IP 是我从 docker-machine ip default
获得的
刚在里面做了 docker build -t kurento-media-server .
:https://github.com/Kurento/kurento-docker/tree/master/kurento-media-server。
一切都已建成。我 运行 docker run -p 8888:8888 kurento-media-server
然后 curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: 127.0.0.1:8888" -H "Origin: 127.0.0.1" http://127.0.0.1:8888/kurento
。它错误的说它无法连接到端口。
容器的输出如下:
+ set -e
+ '[' -n '' ']'
+ '[' -n '' -a -n '' ']'
+ sed /::1/d
+ cat /etc/hosts
+ tee /etc/hosts
+ exec /usr/bin/kurento-media-server
libdc1394 error: Failed to initialize libdc1394
0:00:00.388968390 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:173:loadModules: Found module: /usr/lib/x86_64-linux-gnu/kurento/modules/libkmsfiltersmodule.so
0:00:00.391239217 1 0x1a0ed80 DEBUG KurentoModuleManager ModuleManager.cpp:89:loadModule: Module loaded from /usr/lib/x86_64-linux-gnu/kurento/modules/libkmsfiltersmodule.so
0:00:00.391323949 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:135:loadModule: Loaded filters version 6.6.2 generated at Jul 25 2017 13:36:15
0:00:00.391373374 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:173:loadModules: Found module: /usr/lib/x86_64-linux-gnu/kurento/modules/libkmselementsmodule.so
0:00:00.397720952 1 0x1a0ed80 DEBUG KurentoModuleManager ModuleManager.cpp:89:loadModule: Module loaded from /usr/lib/x86_64-linux-gnu/kurento/modules/libkmselementsmodule.so
0:00:00.397775428 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:135:loadModule: Loaded elements version 6.6.3 generated at Aug 11 2017 20:18:10
0:00:00.397813668 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:173:loadModules: Found module: /usr/lib/x86_64-linux-gnu/kurento/modules/libkmscoremodule.so
0:00:00.400336082 1 0x1a0ed80 DEBUG KurentoModuleManager ModuleManager.cpp:89:loadModule: Module loaded from /usr/lib/x86_64-linux-gnu/kurento/modules/libkmscoremodule.so
0:00:00.400394600 1 0x1a0ed80 INFO KurentoModuleManager ModuleManager.cpp:135:loadModule: Loaded core version 6.6.3 generated at Aug 11 2017 19:36:36
0:00:00.400440935 1 0x1a0ed80 INFO KurentoMediaServer main.cpp:238:main: Kmsc version: 6.6.2
0:00:00.400446370 1 0x1a0ed80 INFO KurentoMediaServer main.cpp:239:main: Compiled at: Jul 25 2017 13:53:46
0:00:00.400450958 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:230:loadConfig: Reading configuration from: /etc/kurento/kurento.conf.json
0:00:00.401349714 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:167:loadModulesConfigFromDir: Looking for config files in /etc/kurento/modules
0:00:00.401476528 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:167:loadModulesConfigFromDir: Looking for config files in /etc/kurento/modules/kurento
0:00:00.402000771 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/MediaElement.conf.ini
0:00:00.402443799 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini
0:00:00.402952686 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
0:00:00.403411471 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/UriEndpoint.conf.ini
0:00:00.403949526 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/SdpEndpoint.conf.json
0:00:00.404450739 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:192:loadModulesConfigFromDir: Loaded module config from: /etc/kurento/modules/kurento/HttpEndpoint.conf.ini
0:00:00.404520754 1 0x1a0ed80 INFO KurentoLoadConfig loadConfig.cpp:246:loadConfig: Configuration loaded successfully
0:00:00.404618365 1 0x1a0ed80 DEBUG KurentoLoadConfig loadConfig.cpp:252:loadConfig: Effective loaded config:
{
"mediaServer":
{
"resources":
{
"garbageCollectorPeriod": "240"
},
"net":
{
"websocket":
{
"port": "8888",
"path": "kurento",
"threads": "10"
}
}
},
"configPath": "\/etc\/kurento",
"modules":
{
"kurento":
{
"MediaElement":
{
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"BaseRtpEndpoint":
{
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"WebRtcEndpoint":
{
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"UriEndpoint":
{
"defaultPath": "file:\/\/\/var\/kurento\/",
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"SdpEndpoint":
{
"numAudioMedias": "1",
"numVideoMedias": "1",
"audioCodecs":
[
{
"name": "opus\/48000\/2"
},
{
"name": "PCMU\/8000"
},
{
"name": "AMR\/8000"
}
],
"videoCodecs":
[
{
"name": "VP8\/90000"
},
{
"name": "H264\/90000"
}
],
"configPath": "\/etc\/kurento\/modules\/kurento"
},
"HttpEndpoint":
{
"serverAddress": "localhost",
"port": "9091",
"configPath": "\/etc\/kurento\/modules\/kurento"
}
}
}
}
0:00:00.404814109 1 0x1a0ed80 INFO KurentoServerMethods ServerMethods.cpp:89:ServerMethods: Not enough resources exception will be raised when resources reach 0.800000
0:00:00.405296158 1 0x1a0f2a0 DEBUG KurentoWorkerPool WorkerPool.cpp:39:workerThreadLoop: Working thread starting
0:00:00.405839379 1 0x1a0ed80 INFO KurentoWebSocketTransport WebSocketTransport.cpp:209:WebSocketTransport: Secure websocket server not enabled
0:00:00.405310438 1 0x7f4c68001840 DEBUG KurentoWorkerPool WorkerPool.cpp:39:workerThreadLoop: Working thread starting
0:00:00.407012759 1 0x1a0ed80 INFO KurentoMediaServer main.cpp:256:main: Mediaserver started
0:04:00.405721382 1 0x7f4c60001780 DEBUG KurentoMediaSet MediaSet.cpp:122:doGarbageCollection: Running garbage collector
有时我忘记 Linux 指令不等于 Docker 运行 Mac 指令。
curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: 172.16.88.128:8888" -H "Origin: 127.0.0.1" http://172.16.88.128:8888/kurento
是正确的命令,其中 non-localhost IP 是我从 docker-machine ip default