-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation on hosting in multiple servers #1
Comments
Thanks, this is my mistake. I have removed LISTEN_HOST env Client only call api of master server, then master server will call api of slave server. You can check in examples/rooms folder. In example, nextjs server create a proxy to master server
|
Thanks for the response. Let me elaborate more on the config file so that it may help others who is looking for the same kind of solution. I am running the applicaiton/ master from 3 different machines in same network.
and in config of master server has the API_HOST = '127.0.0.1' // in this case which IP address do I need to mention. As per my understanding I can run the applicaiton in 3 different hosts/machine as long as they are in the same local network. |
So, I understand you confusion. I have changed API_HOST to LISTEN_HOST
|
Yes added the LISTEN_HOST in 3 different machines. master server 192.168.0.2 => LISTEN_HOST = '192.168.0.2' ==> UI is running in port 3000 All 3 instances are in same VPC subnet and same region. But getting 500 error while creating the room from frontend. Got following errorlog from master server. =============================================================================== ============================================================================== |
Do you run |
I did I am accesing the applicaiton from http://ip:3000 |
Does content of file |
Yes it has. import 'node-fetch'; Using node v16.20.1 npm 8.19.4 in ubuntu 20.04 AWS Ec2 instance. |
You should remove |
Still same. I have Postgres in RDS and all microservices are registering in media_worker table. I am getting this below log in UI POST http://IP:3000/api/rooms 500 (Internal Server Error) ==================================== ========================================================= |
Must update
|
Added. async rewrites() { Cleared localcache from browser. still getting page-e0c2a778d0d27552.js:1 POST http://IP:3000/api/rooms 500 (Internal Server Error). //not sure why it is hitting 3000 port In master server .env Error: listen EADDRNOTAVAIL: address not available PUBLIC ACCESS IP:3010 in master server following services are running. Active Internet connections (only servers) ERROR LOG IN MASTER 3010 ============================= ================================================ mediasoup ip config MEDIASOUP_WEBRTC_TRANSPORT_LISTEN_IPS = '[ |
Do you try to fix error
|
I did reinstalling the node_modules and removed the package-lock.json file before npm installation. Still facing the same issue. Can you update the .env sample file once for a 3 host cluster. I will redeploy once again and update you. |
Your error is caused by npm installation, not involved in .env file. |
Upgraded the node version to 18 and node-fetch error resolved. Now I am getting port bind failed error. All 3 servers are in same subnet and UDP ports are open. ====================== following is the .env of servers, master server //do we need MEDIASOUP_WEBRTC_TRANSPORT_LISTEN_IPS in this server as it is master http server?? in consumer server in producer server |
You don't need set MEDIASOUP_WEBRTC_TRANSPORT_LISTEN_IPS in .env file for master server You should set env for slave server as below
|
Did above changes but still getting the same issue. In 52.xx.xx.yy there is nothing running on port 32372 {"statusCode":500,"error":"Internal Server Error","message":"port bind failed due to address not available [transport:udp, ip:'52.xx.xx.yy', port:32372, attempt:1/20001] [method:router.createWebRtcTransport]"} |
Is 52.xx.xx.yy public ip of your slave server? |
Yes. It is the PUBLIC IP of the slave consumer server where the consumer is running. I gone through the document. I think I have understood and implemented same. But still I am seeing the issue. the UDP and TCP ports in that range are allowed and accessable from public. |
Do you have any .env config for the multiple host or can you please help me in confirming whether the following configuration is correct.
|
You should set
Example
|
Thanks for the update. It worked after making the following change LISTEN_HOST = 192.168.1.3 Just curious on how can we add/scale the slave producer or consumer? Is it possible. |
Yes it's scalable. You only add producer or consumer server with above config |
Thank you so much @woody146 for the elaborated help on this. This is a wonderful project which you created. Cheers :) |
query: SELECT * FROM current_schema() Error: [pid:4101, code:null, signal:SIGSEGV] Node.js v19.7.0 |
You can check at this link https://www.geeksforgeeks.org/segmentation-fault-sigsegv-vs-bus-error-sigbus/. Maybe your problem is your hardware |
thinks for your patience,I solved the above error by upgraded nodejs,but I got another error. {"level":30,"time":1719386132999,"pid":504647,"hostname":"huangqb-KVM","reqId":"req-c","req":{"method":"POST","url":"/rooms","hostname":"10.21.19.136:3010","remoteAddress":"10.21.19.136","remotePort":55712},"msg":"incoming request"} |
check your config |
1、master: 10.21.19.136 and .env list PORT = 3000LISTEN_HOST = '10.21.19.136' SLAVE_FOR = producerSLAVE_MAX_TRANSPORT_PER_WORKER = 500 MEDIASOUP_LOG_LEVEL = warn must open port range on internet for client to connectMEDIASOUP_RTC_MIN_PORT = 20000 MEDIASOUP_WEBRTC_TRANSPORT_MAX_INCOMING_BITRATE = 1500000 2、slave:producer:10.21.19.84 and .env PORT = 3000LISTEN_HOST = '10.21.19.84' SLAVE_FOR = producerSLAVE_MAX_TRANSPORT_PER_WORKER = 5 MEDIASOUP_LOG_LEVEL = warn must open port range on internet for client to connectMEDIASOUP_RTC_MIN_PORT = 20000 MEDIASOUP_WEBRTC_TRANSPORT_MAX_INCOMING_BITRATE = 1500000 PORT = 3000LISTEN_HOST = '10.21.19.12' SLAVE_FOR = producerSLAVE_MAX_TRANSPORT_PER_WORKER = 5 MEDIASOUP_LOG_LEVEL = warn must open port range on internet for client to connectMEDIASOUP_RTC_MIN_PORT = 20000 MEDIASOUP_WEBRTC_TRANSPORT_MAX_INCOMING_BITRATE = 1500000 4、and slave next.config.js list |
You must set |
Check at comment #1 (comment) |
At next.config.js file should update
Currently, you set |
thanks!!!! |
Does it matter if the hostnames of the three hosts are the same? |
Yes, they can be same |
In the .env file, I configured the port to 3000. Why is the listening port still 3010 when starting? {"level":30,"time":1719391499691,"pid":3024,"hostname":"huangqb-KVM1","msg":"Server listening at http://10.21.19.136:3010"} |
I got answer from package.json, here... |
Hi,
Can you provide more details on the steps in config.js file to connect the master and slave nodes in different hosts.
The parameters
API_HOST = '127.0.0.1'
LISTEN_HOST = ::
are confusing while configuring the server in multi host environment.
The text was updated successfully, but these errors were encountered: