Re: [jgroups-users] Chat doesn't work for specific user
Questions/problems related to using JGroups <[email protected]> Thu, 18 May 2017 09:09:28 +0200
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <[email protected]> |
The thing is that you *need* to pick an interface for sending, or else
JGroups will pick one for you. This doesn't need to be the
dotted-decimal notation but you can also use symbolic names, e.g.
bind_addr="match-interface:eth1" etc (see [1] for details).
In 4.x, you can also define the name of a class which picks the right
interface (not available in3.6.x though).
Alternatively, you could set the bind address programmatically, e.g.
JChannel ch=new JChannel(...);
InetAddress bind_addr=// pick one
ch.getProtocolStack().getTransport().setBindAddress(bind_addr);
...
ch.connect("cluster");
Note that you can set receive_on_all_interfaces to true if you wanted to
bind the receive socket to all available interfaces.
[1] http://www.jgroups.org/manual4/index.html#Transport
On 18/05/17 08:24, Questions/problems related to using JGroups wrote:
> Hi,
>
> When I use org.jgroups.demos.Chat from jgroups-3.6.5.Final.jar on two
> hosts then this works when the program is started by user a but not if
> it started by user b (neither a or b are root). Only for user b I see an
> error message like this:
>
>> May 17, 2017 10:08:07 AM org.jgroups.protocols.TP
> <http://org.jgroups.protocols.TP>$BaseBundler sendSingleMessage
> SEVERE: JGRP000029: <host_x>-51650: failed sending message to
> <host_y>-53536 (114 bytes): java.io.IOException: errno: 1 (Operation not
> permitted), error: sendto failed (local port 58186 to address
> <ip_of_host_x_restricted> (<host_x_restricted>), remote port 57239 to
> address <ip_of_host_y_restricted> (<host_y_restricted>)), headers: PING:
> [type=GET_MBRS_RSP], UDP: [cluster_name=ChatCluster]
>
> I am not an admin on these hosts but I know that these host have
> multiple network interfaces and on one interface there are user specific
> restrictions for user b implemented with AppArmour. I do understand that
> I see such errors when user b does specific network communication on the
> restricted interface but why is the channel not build over the other
> working interfaces? Can I configure JGroups to ignore such errors and
> continue with the other interfaces?
>
> When I use MCastReceiver/Sender test everything works with both users.
>
> When I force JGroups to bind to a specific address also everything works
> with both users. But I would like not to be forced to do this
> configuration because I don't know in advance the correct
> interface/address. These are machines in a cloud and I don't have much
> influence on which hosts my apps are deployed and how they are
> configured regarding the network. But I can specify system properties to
> be set for my apps.
>
> I use JGroups 3.6.5. because I am bound to a Java 7 environment.
>
> Ciao
> Chris
--
Bela Ban | http://www.jgroups.org
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot