Facing 401 unauthorized Issue in load balancer

Our Working Scenario :

We have Keycloak application (Identify Access management application) in both zones with load-balancer. it has configured based on the domain clustered mode and we have common shared Database for this both keycloak (DB Name- safwa_keycloak in mysql8).

We register the Keycloak user within our application. Keycloak allows to create a user based on an authentication token. So, every time we create an authentication token and try to register the user, but most of the time it throws an error like “401 unauthorized” and sometimes the data is stored correctly.

So, we’re stopped one zone and tried. At that time our application worked properly without any issues. but when try to run both zones in the load balancer, we encounter the problem that the token unauthorized .

Could you please let us know how to resolve this at the earliest?

Thanks & Regards,

PathuvaiRajan A