You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by kay <go...@gmail.com> on 2020/04/03 08:55:17 UTC

remote ignite server and L4(for loadbalacing) with java thin client

Hello, 
I have two nodes in each remote server and using java thin client for
put/get/remove caching at my application.
I'd like to put L4 or webserver between application server and Ignite Server
for loadbalancing.

there are informations of ports for my description and if IP is all same.

1) node1 
      - client connect port 12000
      - server port 12001

2) node2
      - client connect port 12002
      - server port 12003

3) L4(Webserver)
      - port number : 13000

I used before in my source
ClientConfiguration cfg = new ClientConfiguration().setAddresses(IP:12000,
IP:12002);

I already chage like this 

ClientConfiguration cfg = new ClientConfiguration().setAddresses(IP:13000);

but it was got a ClientConnectionException: Ignite cluster is unavailable
[sock=Socket[addr[..... and so on...

is it possible to use like this?? or Is there another way??? 

Thank you








  



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by kay <go...@gmail.com>.
Thank you so much!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by Alex Plehanov <pl...@gmail.com>.
Hello,

Currently, there is no way to add a new address without the client restart.
But there is a feature under development [1], perhaps, it will be useful
for your case.

[1]:
https://cwiki.apache.org/confluence/display/IGNITE/IEP-44%3A+Thin+client+cluster+discovery

ср, 6 мая 2020 г. в 10:48, kay <go...@gmail.com>:

> Hello, Thank you so much!.
>
> I have 1 more question.
>
> I use IgniteClient API in my application.(singleton)
> when i start my application I regist IgniteClient bean using
> SpringFramework
> and declare ClientConfiguration  address like
>
> ClientConfiguration cfg = new
> ClientConfiguration().setAddresses("34.1.21.122:12800",
> "34.1.21.122:12800");
>
>  Is there any way to add new ClientConfiguration address without my
> application restart??
> I'm considering using L4 between my application and ignite server node..
> but
> also L4 should be restart.
>
> Is it possible to auto scale out java client thin level??
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by kay <go...@gmail.com>.
Hello, Thank you so much!.

I have 1 more question.

I use IgniteClient API in my application.(singleton)
when i start my application I regist IgniteClient bean using SpringFramework
and declare ClientConfiguration  address like  

ClientConfiguration cfg = new
ClientConfiguration().setAddresses("34.1.21.122:12800",
"34.1.21.122:12800");

 Is there any way to add new ClientConfiguration address without my
application restart??
I'm considering using L4 between my application and ignite server node.. but
also L4 should be restart.

Is it possible to auto scale out java client thin level??






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by Alex Plehanov <pl...@gmail.com>.
Hello,

1. Yes, the same way as with the thick client.
2. Here [1] is a short description of partition awareness future for .NET
thin client (but this description also relevant to other thin clients,
including java thin client). Here [2] is a low-level description (mostly
for Apache Ignite developers).
3. Yes, java thin client stay connected with the selected server node until
connection lost (network segmented, server node is shut down, etc.). Only
after losing connection, client tries to connect to the next server node

[1] https://apacheignite-net.readme.io/docs/thin-client#partition-awareness
[2]
https://cwiki.apache.org/confluence/display/IGNITE/IEP-23%3A+Best+Effort+Affinity+for+thin+clients

вт, 5 мая 2020 г. в 10:15, kay <go...@gmail.com>:

> Hello, I'm waiting for reply :)
>
> I use java thin clien.
>
> 1. Can I use java thin client with 'Affinity Collocation'?
> 2. Is there any information about 'partition awareness' ? like, example
> link.
> 3. Ignite thin client on startup select's random server to connect
> available
> address.
> This selection(connect to server node) is not going to be change before
> server node is shut down?? or my application restart?
> I mean if I have only one Ignite thin client Object( like singleton ) in my
> application.
> Is it only use one server node?
>
>
> Thank you so much
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by kay <go...@gmail.com>.
Hello, I'm waiting for reply :)

I use java thin clien.

1. Can I use java thin client with 'Affinity Collocation'?
2. Is there any information about 'partition awareness' ? like, example
link.
3. Ignite thin client on startup select's random server to connect available
address.
This selection(connect to server node) is not going to be change before
server node is shut down?? or my application restart?
I mean if I have only one Ignite thin client Object( like singleton ) in my
application.
Is it only use one server node?


Thank you so much



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by kay <go...@gmail.com>.
Hi, Could you share about "partition awareness" detail information? 
like, example link.

And  you said Ignite thin client on startup select's random server to
connect available address.
This selection(connect to server node) is not going to be change before
server node is shut down?? or my application restart? 

I mean if I have only one Ignite thin client Object( like singleton ) in my
application. 
Is it only use one server node?

I use java thin client now 



Thank you



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by kay <go...@gmail.com>.
Ah.. Thank you so much!!
I will not use Apache for loadbalancer..



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by Alex Plehanov <pl...@gmail.com>.
Hello,

AFAIK apache webserver load balancer it's a balancer only for HTTP
requests. Ignite thin client protocol it's not a HTTP based protocol.
Moreover, it's async (you can send several requests on the same channel
before receiving the first response) and it's stateful (for example, if you
start query on one node you can't get the next page for this query on
another node). Webserver load balancer can't be used here.

Ignite thin client on startup select's random server to connect from
available addresses. So, there is already some kind of load balancer on
per-client level (but not per-request).
Also, the "partition awareness" feature (disabled by default) allows to
connect to several nodes at the same time and send some types of requests
to the affinity node.


пн, 6 апр. 2020 г. в 03:33, kay <go...@gmail.com>:

> Hi,
>
> I'm using Apache Webserver for loadbalancer.
>
> I got this access log at binding port.
>
>
>
>
> - myIp(xx.xx.xx.xxx) [06/Apr/2020:09:00:50 +0900] 13000 "-" 408 - 12 0 - -
>
>
>
>
> I think it was a timeout.
>
> Here is my httpd.conf set.
>
>
>
>
> <Proxy balancer://cache-cluster>
>          BalancerMember "http://IP:PORT" loadfactor=1 hcpasses=3
> hcfails=3
> hcmethod=GET  hcinterval=5
>          BalancerMember "http://IP:PORT" loadfactor=1 hcpasses=3
> hcfails=3
> hcmethod=GET  hcinterval=5
>          ProxySet  lbmethod=byrequests
>  </Proxy>
>
> <VirtualHost *:13000>
>          ProxyRequests    Off
>         ProxyPreserveHost       On
>
>   ProxyPass               "/"  "balancer://cache-cluster/"
>          ProxyPassReverse        "/"  "balancer://cache-cluster/"
>  </VirtualHost>
>
>
>
>
>
>
>
> and this is a stacktrace for connection
>
> Exception in thread "main"
> org.apache.ignite.client.ClientConnectionException: Ignite cluster is
> unavailable [sock=Socket[addr=intdev01/IP,port=13000,localport=50216]]
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel.handleIOError(TcpClientChannel.java:499)
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel.handleIOError(TcpClientChannel.java:491)
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel.access$100(TcpClientChannel.java:92)
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel$ByteCountingDataInput.read(TcpClientChannel.java:542)
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel$ByteCountingDataInput.readInt(TcpClientChannel.java:572)
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel.handshakeRes(TcpClientChannel.java:428)
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel.handshake(TcpClientChannel.java:401)
>   at
>
> org.apache.ignite.internal.client.thin.TcpClientChannel.<init>(TcpClientChannel.java:153)
>   at
>
> org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.getOrCreateChannel(ReliableChannel.java:450)
>   at
>
> org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.getOrCreateChannel(ReliableChannel.java:439)
>   at
>
> org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.access$100(ReliableChannel.java:395)
>   at
>
> org.apache.ignite.internal.client.thin.ReliableChannel.<init>(ReliableChannel.java:120)
>   at
>
> org.apache.ignite.internal.client.thin.TcpIgniteClient.<init>(TcpIgniteClient.java:99)
>   at
>
> org.apache.ignite.internal.client.thin.TcpIgniteClient.<init>(TcpIgniteClient.java:81)
>   at
>
> org.apache.ignite.internal.client.thin.TcpIgniteClient.start(TcpIgniteClient.java:208)
>   at org.apache.ignite.Ignition.startClient(Ignition.java:581)
>  at sfmi.framework.nexus.app.Application.main(Application.java:51)
>
>
>
>
>
>
>
> Is is right to use loadbalancer to access Ignite server??
>
>
>
>
> Thank you
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by kay <go...@gmail.com>.
Hi,

I'm using Apache Webserver for loadbalancer.

I got this access log at binding port.




- myIp(xx.xx.xx.xxx) [06/Apr/2020:09:00:50 +0900] 13000 "-" 408 - 12 0 - -




I think it was a timeout.

Here is my httpd.conf set.




<Proxy balancer://cache-cluster>
         BalancerMember "http://IP:PORT" loadfactor=1 hcpasses=3  hcfails=3 
hcmethod=GET  hcinterval=5
         BalancerMember "http://IP:PORT" loadfactor=1 hcpasses=3  hcfails=3 
hcmethod=GET  hcinterval=5 
         ProxySet  lbmethod=byrequests
 </Proxy>

<VirtualHost *:13000>
         ProxyRequests    Off
        ProxyPreserveHost       On

  ProxyPass               "/"  "balancer://cache-cluster/"
         ProxyPassReverse        "/"  "balancer://cache-cluster/"
 </VirtualHost>







and this is a stacktrace for connection 

Exception in thread "main"
org.apache.ignite.client.ClientConnectionException: Ignite cluster is
unavailable [sock=Socket[addr=intdev01/IP,port=13000,localport=50216]]
  at
org.apache.ignite.internal.client.thin.TcpClientChannel.handleIOError(TcpClientChannel.java:499)
  at
org.apache.ignite.internal.client.thin.TcpClientChannel.handleIOError(TcpClientChannel.java:491)
  at
org.apache.ignite.internal.client.thin.TcpClientChannel.access$100(TcpClientChannel.java:92)
  at
org.apache.ignite.internal.client.thin.TcpClientChannel$ByteCountingDataInput.read(TcpClientChannel.java:542)
  at
org.apache.ignite.internal.client.thin.TcpClientChannel$ByteCountingDataInput.readInt(TcpClientChannel.java:572)
  at
org.apache.ignite.internal.client.thin.TcpClientChannel.handshakeRes(TcpClientChannel.java:428)
  at
org.apache.ignite.internal.client.thin.TcpClientChannel.handshake(TcpClientChannel.java:401)
  at
org.apache.ignite.internal.client.thin.TcpClientChannel.<init>(TcpClientChannel.java:153)
  at
org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.getOrCreateChannel(ReliableChannel.java:450)
  at
org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.getOrCreateChannel(ReliableChannel.java:439)
  at
org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.access$100(ReliableChannel.java:395)
  at
org.apache.ignite.internal.client.thin.ReliableChannel.<init>(ReliableChannel.java:120)
  at
org.apache.ignite.internal.client.thin.TcpIgniteClient.<init>(TcpIgniteClient.java:99)
  at
org.apache.ignite.internal.client.thin.TcpIgniteClient.<init>(TcpIgniteClient.java:81)
  at
org.apache.ignite.internal.client.thin.TcpIgniteClient.start(TcpIgniteClient.java:208)
  at org.apache.ignite.Ignition.startClient(Ignition.java:581)
 at sfmi.framework.nexus.app.Application.main(Application.java:51)







Is is right to use loadbalancer to access Ignite server??




Thank you




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: remote ignite server and L4(for loadbalacing) with java thin client

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

It's hard to say, what kind of load balancer it is? Can you dump network
packets on that port when you try to connect? Can you provide complete
stack trace?

Regards,
-- 
Ilya Kasnacheev


пт, 3 апр. 2020 г. в 11:55, kay <go...@gmail.com>:

> Hello,
> I have two nodes in each remote server and using java thin client for
> put/get/remove caching at my application.
> I'd like to put L4 or webserver between application server and Ignite
> Server
> for loadbalancing.
>
> there are informations of ports for my description and if IP is all same.
>
> 1) node1
>       - client connect port 12000
>       - server port 12001
>
> 2) node2
>       - client connect port 12002
>       - server port 12003
>
> 3) L4(Webserver)
>       - port number : 13000
>
> I used before in my source
> ClientConfiguration cfg = new ClientConfiguration().setAddresses(IP:12000,
> IP:12002);
>
> I already chage like this
>
> ClientConfiguration cfg = new ClientConfiguration().setAddresses(IP:13000);
>
> but it was got a ClientConnectionException: Ignite cluster is unavailable
> [sock=Socket[addr[..... and so on...
>
> is it possible to use like this?? or Is there another way???
>
> Thank you
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>