Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Redirect (302) listeners from master to slave when full

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Jens



Joined: 25 Feb 2009
Posts: 4

PostPosted: Wed Feb 25, 2009 10:47 am    Post subject: Redirect (302) listeners from master to slave when full Reply with quote

Hi,

first, thank you a lot for the work on Icecast.

I have a question about the current development of this feature. It's bothering me for quite some time and I could not find any info that worked for me.

Is it already possible to redirect (302) listeners from a master to a slave icecast automagically if the master reaches the max listeners limit?

I tried with Icecast 2.3.2 and 2.3.2-kh8 (Linux) and I couldn't make it happen. I could connect to the master or manually to the slave and I listened to the streams. But the redirection from a full master to the slave did not work.

Jens
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Feb 25, 2009 11:00 pm    Post subject: Reply with quote

firstly, it's a work in progress so it's not in the trunk codebase, it's only in the kh tree at the moment. You didn't say whether you had both servers at the same version or not, and which of the extra options you have enabled. Normally authentication is not passed for the relays and therefore won't be registered with the master for redirection.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jens



Joined: 25 Feb 2009
Posts: 4

PostPosted: Wed Feb 25, 2009 11:42 pm    Post subject: Reply with quote

Hi Karl,

I'm running Icecast 2.3.2-kh8 on master and slave.

Here is the debug of the master:
Code:

[2009-02-26  00:23:47] INFO main/main Icecast 2.3.2-kh8 server started
[2009-02-26  00:23:47] INFO slave/slave_startup max file descriptors 1024 (hard limit 8192)
[2009-02-26  00:23:47] INFO connection/connection_thread connection thread started
[2009-02-26  00:23:47] INFO connection/get_ssl_certificate No SSL capability on any configured ports
[2009-02-26  00:23:53] INFO connection/_handle_source_request Source logging in at mountpoint "/test"
[2009-02-26  00:23:53] INFO source/source_apply_mount Applying mount information for "/test"
[2009-02-26  00:23:53] INFO connection/_handle_source_request Source logging in at mountpoint "/test"
[2009-02-26  00:23:53] WARN connection/source_startup Mountpoint /test in use
[2009-02-26  00:23:53] INFO format-vorbis/initial_vorbis_page seen initial vorbis header
[2009-02-26  00:23:53] INFO source/process_listeners listener count on /test now 0
[2009-02-26  00:23:54] INFO source/source_apply_mount Applying mount information for "/test"
[2009-02-26  00:24:01] INFO auth/auth_add_listener client connected as slave
[2009-02-26  00:24:01] INFO slave/redirector_add slave (1) at 192.168.1.36:8000 added
[2009-02-26  00:24:01] INFO auth/auth_add_listener client connected as slave
[2009-02-26  00:24:01] INFO auth/add_listener_to_source client is from a slave, bypassing limits
[2009-02-26  00:24:01] INFO source/process_listeners listener count on /test now 1
[2009-02-26  00:24:11] INFO auth/auth_add_listener client connected as slave
[2009-02-26  00:24:21] INFO auth/auth_add_listener client connected as slave
[2009-02-26  00:24:23] INFO connection/_handle_source_request Source logging in at mountpoint "/test"
[2009-02-26  00:24:23] WARN connection/source_startup Mountpoint /test in use
[2009-02-26  00:24:31] INFO auth/auth_add_listener client connected as slave
[2009-02-26  00:24:41] INFO auth/auth_add_listener client connected as slave
[2009-02-26  00:24:51] INFO auth/auth_add_listener client connected as slave
[2009-02-26  00:24:53] INFO connection/_handle_source_request Source logging in at mountpoint "/test"


This is the debug of the slave:
Code:

[2009-02-26  00:24:00] INFO main/main Icecast 2.3.2-kh8 server started
[2009-02-26  00:24:00] INFO slave/slave_startup max file descriptors 1024 (hard limit 8192)
[2009-02-26  00:24:00] INFO slave/update_master_as_slave adding master 192.168.1.33:8000
[2009-02-26  00:24:00] INFO slave/redirector_add slave (1) at 192.168.1.33:8000 added
[2009-02-26  00:24:00] INFO connection/connection_thread connection thread started
[2009-02-26  00:24:00] INFO connection/get_ssl_certificate No SSL capability on any configured ports
[2009-02-26  00:24:01] INFO slave/start_relay_stream Starting relayed source at mountpoint "/test"
[2009-02-26  00:24:01] INFO slave/open_relay_connection connecting to 192.168.1.33:8000
[2009-02-26  00:24:01] INFO source/source_apply_mount Applying mount information for "/test"
[2009-02-26  00:24:01] INFO format-vorbis/initial_vorbis_page seen initial vorbis header
[2009-02-26  00:24:01] INFO source/process_listeners listener count on /test now 0
[2009-02-26  00:24:02] INFO source/source_apply_mount Applying mount information for "/test"
[2009-02-26  00:26:59] INFO format-vorbis/initial_vorbis_page seen initial vorbis header


This is the master config (Skipping path, logging & security):
Code:

<icecast>
    <location>UK</location>
    <admin>webmaster@localhost</admin>

    <limits>
        <clients>5</clients>
        <sources>4</sources>
        <queue-size>524288</queue-size>
        <client-timeout>30</client-timeout>
        <header-timeout>15</header-timeout>
        <source-timeout>10</source-timeout>
        <burst-size>65535</burst-size>
    </limits>
<authentication>
        <!-- Sources log in with username 'source' -->
        <source-password>123</source-password>
        <!-- Relays log in username 'relay' -->
        <relay-password>456</relay-password>
<relay-user>relay</relay-user>
        <!-- Admin logs in with the username given below -->
        <admin-user>admin</admin-user>
        <admin-password>123</admin-password>
    </authentication>
<hostname>192.168.1.33</hostname>
<listen-socket>
        <port>8000</port>
</listen-socket>
<max-redirect-slaves>10</max-redirect-slaves>
    <mount>
        <mount-name>/test</mount-name>
        <hidden>0</hidden>
        <public>1</public>
    </mount>


This is the config of the slave (Skipping path, logging & security):
Code:

    <limits>
        <clients>2</clients>
        <sources>2</sources>
        <queue-size>524288</queue-size>
        <client-timeout>30</client-timeout>
        <header-timeout>15</header-timeout>
        <source-timeout>10</source-timeout>
        <burst-size>65535</burst-size>
    </limits>
    <authentication>
        <!-- Sources log in with username 'source' -->
        <source-password>222</source-password>
        <!-- Relays log in username 'relay' -->
        <relay-password>333</relay-password>
        <admin-user>admin</admin-user>
        <admin-password>444</admin-password>
    </authentication>
<hostname>192.168.1.36</hostname>
    <listen-socket>
        <port>8000</port>
    </listen-socket>
    <master-server>192.168.1.33</master-server>
    <master-server-port>8000</master-server-port>
    <master-update-interval>10</master-update-interval>
    <master-username>relay</master-username>
    <master-password>456</master-password>
  <master-relay-auth>1</master-relay-auth>
<master-redirect>1</master-redirect>
        <mount>
         <mount-name>/test</mount-name>
<public>1</public>
<hidden>0</hidden>
        </mount>


I start Master, ices and then slave.

If I start Master, Slave and then ices, I get the error:
Code:

[2009-02-26  00:30:35] INFO ices-core/main IceS 2.0.1 started...
[2009-02-26  00:30:35] INFO signals/signal_usr1_handler Metadata update requested
[2009-02-26  00:30:35] INFO playlist-basic/playlist_basic_get_next_filename Loading playlist from file "/home/ttt/public_html/ttt/radio/playlist.txt"
[2009-02-26  00:30:35] INFO playlist-builtin/playlist_read Currently playing "/home/ttt/test.ogg"
[2009-02-26  00:30:35] EROR stream/ices_instance_stream Failed initial connect to 192.168.1.33:8000 (Login failed: Success)
[2009-02-26  00:30:36] DBUG input/input_loop An instance died, removing it
[2009-02-26  00:30:36] DBUG input/input_flush_queue Input queue flush requested
[2009-02-26  00:30:36] INFO input/input_loop All instances removed, shutting down...
[2009-02-26  00:30:36] INFO ices-core/main Shutdown complete


Thanks a lot!
Jens
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Feb 26, 2009 1:05 am    Post subject: Reply with quote

There is a failed source connect, maybe you have 2 source clients running, but from the log that I can see, the slave has registered correctly with the master. I don't see any listener connects though.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jens



Joined: 25 Feb 2009
Posts: 4

PostPosted: Thu Feb 26, 2009 8:37 pm    Post subject: Reply with quote

Hi Karl,

thanks for the reply, you give me hope Wink

Now I have attached the logfiles with listeners trying to hear something. The only change I made to the setup above is reducing the clients limit of the master to 2.

Master-Log:
Code:

[2009-02-26  21:25:37] INFO main/main Icecast 2.3.2-kh8 server started
[2009-02-26  21:25:37] INFO slave/slave_startup max file descriptors 1024 (hard limit 8192)
[2009-02-26  21:25:37] INFO connection/connection_thread connection thread started         
[2009-02-26  21:25:37] INFO connection/get_ssl_certificate No SSL capability on any configured ports
[2009-02-26  21:25:42] INFO connection/_handle_source_request Source logging in at mountpoint "/test"
[2009-02-26  21:25:42] INFO source/source_apply_mount Applying mount information for "/test"         
[2009-02-26  21:25:42] INFO format-vorbis/initial_vorbis_page seen initial vorbis header             
[2009-02-26  21:25:42] INFO source/process_listeners listener count on /test now 0                   
[2009-02-26  21:25:42] INFO source/source_apply_mount Applying mount information for "/test"
[2009-02-26  21:25:52] INFO auth/auth_add_listener client connected as slave
[2009-02-26  21:25:52] INFO slave/redirector_add slave (1) at 192.168.1.36:8000 added
[2009-02-26  21:25:52] INFO auth/auth_add_listener client connected as slave
[2009-02-26  21:25:52] INFO auth/add_listener_to_source client is from a slave, bypassing limits
[2009-02-26  21:25:52] INFO source/process_listeners listener count on /test now 1
[2009-02-26  21:26:00] WARN connection/_handle_get_request server client limit reached (2/3)
[2009-02-26  21:26:01] WARN connection/_handle_get_request server client limit reached (2/3)
[2009-02-26  21:26:02] WARN connection/_handle_get_request server client limit reached (2/3)
[2009-02-26  21:26:02] INFO auth/auth_add_listener client connected as slave
[2009-02-26  21:26:12] WARN connection/_handle_get_request server client limit reached (2/3)
[2009-02-26  21:26:12] INFO auth/auth_add_listener client connected as slave


Slave-Log:
Code:

[2009-02-26  21:25:51] INFO main/main Icecast 2.3.2-kh8 server started
[2009-02-26  21:25:51] INFO slave/slave_startup max file descriptors 1024 (hard limit 8192)
[2009-02-26  21:25:51] INFO slave/update_master_as_slave adding master 192.168.1.33:8000
[2009-02-26  21:25:51] INFO slave/redirector_add slave (1) at 192.168.1.33:8000 added
[2009-02-26  21:25:51] INFO connection/connection_thread connection thread started
[2009-02-26  21:25:51] INFO connection/get_ssl_certificate No SSL capability on any configured ports
[2009-02-26  21:25:52] INFO slave/start_relay_stream Starting relayed source at mountpoint "/test"
[2009-02-26  21:25:52] INFO slave/open_relay_connection connecting to 192.168.1.33:8000
[2009-02-26  21:25:52] INFO source/source_apply_mount Applying mount information for "/test"
[2009-02-26  21:25:52] INFO source/process_listeners listener count on /test now 0
[2009-02-26  21:25:52] INFO format-vorbis/initial_vorbis_page seen initial vorbis header
[2009-02-26  21:25:53] INFO source/source_apply_mount Applying mount information for "/test"


Output from audio client (vlc)
Code:

[00000465] access_http access error: error: HTTP/1.0 403 Too many clients connected
[00000465] access_http access error: error: HTTP/1.0 403 Too many clients connected
[00000465] access_mms access error: error: HTTP/1.0 403 Too many clients connected
[00000463] main input error: open of `http://localhost:8000/test' failed: could not create access


As you see, I tried with one audio client and I got rejected. Also when loading the master admin page now (with clients limit 2), I get a blank screen and the log also states that the server clients limit has been reached (2/3). Everything is on Linux.

Jens
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Feb 27, 2009 1:20 am    Post subject: Reply with quote

set max-listeners for the mountpoint on the master, the registered slave relays will bypass that limit but the global clients setting is a hard limit.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jens



Joined: 25 Feb 2009
Posts: 4

PostPosted: Fri Feb 27, 2009 9:24 pm    Post subject: Reply with quote

Hi Karl,

thanks a lot for your help and your last post. This solved the problems, the redirection works fine now. Icecast-kh rocks! Wink

Just for curiosity... Let's say I have one master and 2 slaves. Does the master know if one slave is full and redirects to the other one?

Jens
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Feb 27, 2009 9:28 pm    Post subject: Reply with quote

currently no, I think the best idea is to get the stats client interface working fully to allow for this sort of information to pass around. At the moment the selection of slave to redirect to is random.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
liveatc



Joined: 22 Sep 2007
Posts: 4
Location: Boston, MA

PostPosted: Wed Mar 04, 2009 11:56 pm    Post subject: Reply with quote

karlH wrote:
currently no, I think the best idea is to get the stats client interface working fully to allow for this sort of information to pass around. At the moment the selection of slave to redirect to is random.

karl.


This does sound like the best approach.

In an earlier kh version I thought it was possible to specify another slave server on the slave server itself. So one could send clients back to the master for redirection if the slave was full.

Did that really work in an earlier version or am I dreaming?

Dave
LiveATC.net
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Mar 05, 2009 12:34 am    Post subject: Reply with quote

That was one approach made in earlier releases (easier from an implementation point of view, but good enough for testing), the issue with that approach was that redirecting is fine but the master was not really aware of the slave being available.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber