[Server:server-one] 12:33:37,761 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-2,ee,master:server-one) ISPN000094: Received new cluster view for channel server: [master:server-one|1] (2) [master:server-one, slave1:server-two]
[Server:server-one] 12:33:38,411 INFO [org.infinispan.CLUSTER] (remote-thread--p8-t6) ISPN000310: Starting cluster-wide rebalance for cache realms, topology CacheTopology{id=1, rebalanceId=1, currentCH=ReplicatedConsistentHash{ns = 60, owners = (1)[master:server-one: 60]}, pendingCH=ReplicatedConsistentHash{ns = 60, owners = (2)[master:server-one: 30, slave1:server-two: 30]}, unionCH=null, actualMembers=[master:server-one, slave1:server-two]}
[Server:server-one] 12:33:38,419 INFO [org.infinispan.CLUSTER] (remote-thread--p8-t4) ISPN000336: Finished cluster-wide rebalance for cache users, topology id = 1
SLAVE NODE LOG:
[Server:server-two] 12:33:38,179 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-6) ISPN000094: Received new cluster view for channel server: [master:server-one|1] (2) [master:server-one, slave1:server-two]
THE ISSUE IS NOW how to test this working cluster.It looks like the the content of the Keycloak string pattern generated by the master's Keycloak instance( and added to each microservice's keycloak.json file) HAS NOT CHANGED : I still get the same "auth-server-url" info as before when I had was not working cluster; no reference to the the other node members of the working cluster :
{
"realm": "SearchMicroservices",
"realm-public-key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh",
"auth-server-url": "http://masterKCInstance.ourcompanyname.com:8230/auth",
"ssl-required": "external",
"resource": "LDAPSearch-Microservice",
"credentials": {
"secret": "235b2960-1b6f-48bd-a5c4-069b5fc5cc16"
},
"use-resource-role-mappings": true
}
If I stop the Keycloak instance running on the master node(from the WildFly management interface) and, I send a client search request message to one of my running application registered in the realm as clients, I was expecting the request to be be redirected by the load-balancer to the running state slave Keycloak instance (node: "http://slaveKCInstance.ourcompanyname.com:8230/auth"); get a valid access_token from it ,then my client request message(along with generated bearer token) sent to my targeted resource should get a a response message. It does not happen like this.What I get is this :
{"path":"\/v1\/ldap\/DBResource\/resourceName","error":"Unauthorized","message":"Unable to authenticate bearer token","timestamp":1474566606034,"status":401}
The same outcome as described in my initial message sent to you. Can you please tell me what is wrong in my testing procedure?
Thanks,
Ioan
From: "Stian Thorgersen" <sthorger@redhat.com>
To: "i pop" <i.pop@centurylink.net>
Cc: "keycloak-user" <keycloak-user@lists.jboss.org>
Sent: Tuesday, September 20, 2016 3:03:09 AM
Subject: Re: [keycloak-user] Setting up a Keycloak Domain Cluster