Keycloak standalone cluster on Cloud Foundry

前端 未结 1 1855
滥情空心
滥情空心 2020-12-18 16:42

How to configure Keycloak standalone cluster on Cloud Foundry?

I tried to use docker image jboss/keycloak:4.5.0.Final with internal routing:

    <
相关标签:
1条回答
  • 2020-12-18 16:53

    I finally found the answer to my own question.

    Go to this keycloak4cf repo if you are looking for a quick solution.


    Main problems that I had to face:

    Keycloak minimal version

    Use the jboss/keycloak:5.0.0 or newer/latest

    There is hardcoded .svc.cluster.local DNS query suffix removed with JGRP-2295.

    This fix was released in JGroups 4.0.15.Final, that is used in Infinispan Core 9.4.0.Final., released with Keycloak 5.0.0 (included inifnispan-core 9.4.3.Final).

    Clustering

    Clustering have to be done with TCP instead of multicast UDP (there is no multicast on Cloud Foundry - thank you @DanielMikusa for the tip).

    To change this config use dns.DNS_PING.cli:

    embed-server --server-config=standalone-ha.xml --std-out=echo
    batch
    /subsystem=jgroups:write-attribute(name=default-stack,value=tcp)
    /subsystem=jgroups/channel=ee:write-attribute(name=stack,value=tcp)
    /subsystem=jgroups/stack=udp/protocol=PING:remove()
    /subsystem=jgroups/stack=udp/protocol=$keycloak_jgroups_discovery_protocol:add(add-index=0, properties=$keycloak_jgroups_discovery_protocol_properties)
    /subsystem=jgroups/stack=tcp/protocol=MPING:remove()
    /subsystem=jgroups/stack=tcp/protocol=$keycloak_jgroups_discovery_protocol:add(add-index=0, properties=$keycloak_jgroups_discovery_protocol_properties)
    run-batch
    stop-embedded-server
    

    Add network policy to allow connections between cluster nodes:

    cf add-network-policy keycloak-cluster-poc --destination-app keycloak-cluster-poc --protocol tcp --port 7600
    
    0 讨论(0)
提交回复
热议问题