Use infinispan UserSession provider for docker cluster env. Don't prepare nodes during each fig start
This commit is contained in:
parent
72ec9ccb00
commit
fd0a000823
3 changed files with 36 additions and 19 deletions
|
@ -68,5 +68,11 @@
|
||||||
"dataSource": "java:jboss/datasources/KeycloakDS",
|
"dataSource": "java:jboss/datasources/KeycloakDS",
|
||||||
"databaseSchema": "update"
|
"databaseSchema": "update"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"connectionsInfinispan": {
|
||||||
|
"default": {
|
||||||
|
"cacheContainer" : "java:jboss/infinispan/Keycloak"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ for I in $(find . | grep .war$); do cp $I /opt/wildfly/standalone/deployments/;
|
||||||
# Explode wars
|
# Explode wars
|
||||||
cd /opt/wildfly/standalone/deployments/
|
cd /opt/wildfly/standalone/deployments/
|
||||||
for I in $(ls -d *.war | grep -v auth-server.war); do
|
for I in $(ls -d *.war | grep -v auth-server.war); do
|
||||||
echo "Explode dir $I";
|
echo "Configuring $I";
|
||||||
mkdir $I.tmp;
|
mkdir $I.tmp;
|
||||||
cd $I.tmp;
|
cd $I.tmp;
|
||||||
unzip -q ../$I;
|
unzip -q ../$I;
|
||||||
|
@ -25,7 +25,6 @@ sed -i -e 's/false/true/' admin-access.war/WEB-INF/web.xml
|
||||||
|
|
||||||
# Configure other examples
|
# Configure other examples
|
||||||
for I in *.war/WEB-INF/keycloak.json; do
|
for I in *.war/WEB-INF/keycloak.json; do
|
||||||
echo "Configuring $I";
|
|
||||||
sed -i -e 's/\"use-hostname-for-local-requests\": false/\"use-hostname-for-local-requests\": true/' $I;
|
sed -i -e 's/\"use-hostname-for-local-requests\": false/\"use-hostname-for-local-requests\": true/' $I;
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,34 @@
|
||||||
export MYHOST=node$(echo $MYSQL_NAME | awk -F"/dockercluster[^0-9]*|\/mysql" '{print $2 }');
|
export MYHOST=node$(echo $MYSQL_NAME | awk -F"/dockercluster[^0-9]*|\/mysql" '{print $2 }');
|
||||||
echo "MYHOST is $MYHOST. MYSQL_NAME is $MYSQL_NAME";
|
echo "MYHOST is $MYHOST. MYSQL_NAME is $MYSQL_NAME";
|
||||||
|
|
||||||
|
function prepareHost
|
||||||
|
{
|
||||||
|
if [ -d /keycloak-docker-shared/keycloak-wildfly-$MYHOST ]; then
|
||||||
|
echo "Node $MYHOST already prepared. Skiping";
|
||||||
|
return;
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Creating keycloak-wildfly-$MYHOST";
|
||||||
|
|
||||||
|
cd /opt/wildfly
|
||||||
|
cp -r /keycloak-docker-cluster/modules ./
|
||||||
|
|
||||||
|
# Deploy keycloak
|
||||||
|
cp -r /keycloak-docker-cluster/deployments/* /opt/wildfly/standalone/deployments/
|
||||||
|
|
||||||
|
# Enable Infinispan provider
|
||||||
|
sed -i "s|keycloak.userSessions.provider:mem|keycloak.userSessions.provider:infinispan|" /opt/wildfly/standalone/deployments/auth-server.war/WEB-INF/classes/META-INF/keycloak-server.json
|
||||||
|
|
||||||
|
# Deploy and configure examples
|
||||||
|
/deploy-examples.sh
|
||||||
|
|
||||||
|
# Deploy to volume
|
||||||
|
rm -rf /keycloak-docker-shared/keycloak-wildfly-$MYHOST
|
||||||
|
cp -r /opt/wildfly-8.1.0.Final /keycloak-docker-shared/keycloak-wildfly-$MYHOST
|
||||||
|
chmod -R 777 /keycloak-docker-shared/keycloak-wildfly-$MYHOST
|
||||||
|
echo "keycloak-wildfly-$MYHOST prepared and copyied to volume";
|
||||||
|
}
|
||||||
|
|
||||||
function waitForPreviousNodeStart
|
function waitForPreviousNodeStart
|
||||||
{
|
{
|
||||||
myHostNumber=$(echo $MYHOST | awk -F"node" '{ print $2 }');
|
myHostNumber=$(echo $MYHOST | awk -F"node" '{ print $2 }');
|
||||||
|
@ -42,23 +70,7 @@ function waitForMySQLStart
|
||||||
done;
|
done;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Creating keycloak-wildfly-$MYHOST";
|
prepareHost;
|
||||||
|
|
||||||
cd /opt/wildfly
|
|
||||||
cp -r /keycloak-docker-cluster/modules ./
|
|
||||||
|
|
||||||
# Deploy keycloak
|
|
||||||
cp -r /keycloak-docker-cluster/deployments/* /opt/wildfly/standalone/deployments/
|
|
||||||
|
|
||||||
# Deploy and configure examples
|
|
||||||
/deploy-examples.sh
|
|
||||||
|
|
||||||
# Deploy to volume
|
|
||||||
rm -rf /keycloak-docker-shared/keycloak-wildfly-$MYHOST
|
|
||||||
cp -r /opt/wildfly-8.1.0.Final /keycloak-docker-shared/keycloak-wildfly-$MYHOST
|
|
||||||
chmod -R 777 /keycloak-docker-shared/keycloak-wildfly-$MYHOST
|
|
||||||
echo "keycloak-wildfly-$MYHOST prepared and copyied to volume";
|
|
||||||
|
|
||||||
|
|
||||||
waitForPreviousNodeStart;
|
waitForPreviousNodeStart;
|
||||||
waitForMySQLStart;
|
waitForMySQLStart;
|
||||||
|
|
Loading…
Reference in a new issue