Skip to content

Commit

Permalink
Change NFS mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
VimukthiPerera committed Dec 14, 2018
1 parent b747ed5 commit ad7d28e
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 39 deletions.
22 changes: 11 additions & 11 deletions pattern-2/bosh-release/config/blobs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
mysqldriver/mysql-connector-java-5.1.46-bin.jar:
size: 1004840
object_id: 0a7c82a6-c76d-4670-4f1e-158a88562956
sha: 0a22bced42a2f076aaa17feee67fc6b998cfd4f9
mysqldriver/mysql-connector-java-5.1.45-bin.jar:
size: 999810
object_id: cfe00951-23ea-4a63-61e9-710b798475a8
sha: 6223be933fbc8d81f819aacad0ce09346d5911c4
openjdk/jdk-8u202-ea-bin-b03-linux-x64-07_nov_2018.tar.gz:
size: 139097684
object_id: cb15cef2-fcd1-42a2-740a-af8e6d4fef06
object_id: 3cb3791e-1a9c-4536-7239-742cbadfb9b8
sha: 43df5d55fff80327cc83680cda6170f33308883c
wso2am/wso2am-2.6.0.zip:
size: 437096938
object_id: 43ce4312-d8b6-4c8c-5ff8-5f0bb9bf7265
sha: 721c82e0a54ab1dc878b19db6654a3db24837109
size: 444084271
object_id: 58aad1a7-ca6c-41af-72c1-f73f46aceae7
sha: c31c9c9dd87a6a6065779c28c6908bd76e4914f3
wso2am_analytics/wso2am-analytics-2.6.0.zip:
size: 174219759
object_id: 3bb62e85-8cea-4d0a-6200-4aaa11619995
sha: 58f7b9013efb0b76721b6b171613ae72f8a51897
size: 180832478
object_id: 902c0851-16eb-4efd-755a-45196ad4935e
sha: b60e811d5abb500f5793cc73012f1040bc2a88c0
18 changes: 9 additions & 9 deletions pattern-2/bosh-release/jobs/gateway/templates/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export JAVA_OPTS=" -Xmx${MAX_HEAP}m -Xms${MIN_HEAP}m -XX:MaxPermSize=${MAX_PERMG

export DEBUG_LOG=${log_dir}/wso2apim.log

export NFS_EXPORT_SERVER_DIR=/mnt/nfs-export/gateway/deployment/server
export NFS_EXPORT_TENANTS_DIR=/mnt/nfs-export/gateway/tenants
export NFS_EXPORT_SERVER_DIR=/mnt/nfs-export/gateway/repository/deployment
export NFS_EXPORT_TENANTS_DIR=/mnt/nfs-export/gateway/repository

export NFS_SHARE_SERVER_DIR=/mnt/nfs-share/gateway/repository/deployment/server
export NFS_SHARE_TENANTS_DIR=/mnt/nfs-share/gateway/repository/tenants
export NFS_SHARE_SERVER_DIR=/mnt/nfs-share/gateway/repository/deployment
export NFS_SHARE_TENANTS_DIR=/mnt/nfs-share/gateway/repository

touch $DEBUG_LOG
chmod -R 755 /var/vcap/sys
Expand All @@ -71,7 +71,7 @@ if [ $? -ne 0 ] ; then
fi

mkdir -p ${NFS_SHARE_SERVER_DIR}
mkdir -p ${NFS_SHARE_TENANTS_DIR}
mkdir -p ${NFS_SHARE_TENANTS_DIR}/tenants

case $1 in

Expand Down Expand Up @@ -101,17 +101,17 @@ case $1 in
cp /var/vcap/packages/mysqldriver/* ${WSO2_APIM_HOME}/repository/components/lib/

mkdir /tmp/gateway
mv $WSO2_APIM_HOME/repository/deployment/server/synapse-configs/ /tmp/gateway
mv $WSO2_APIM_HOME/repository/deployment/server/ /tmp/gateway/

mount -t nfs <%= link("nfs-server").instances[0].address %>:${NFS_EXPORT_SERVER_DIR} ${NFS_SHARE_SERVER_DIR}
mount -t nfs <%= link("nfs-server").instances[0].address %>:${NFS_EXPORT_TENANTS_DIR} ${NFS_SHARE_TENANTS_DIR}

if [ -z "$(ls -A ${NFS_SHARE_SERVER_DIR})" ]; then
cp -Tr /tmp/gateway/repository/deployment/server/ ${NFS_SHARE_SERVER_DIR}/
cp -r /tmp/gateway/* ${NFS_SHARE_SERVER_DIR}/
fi

# ln -s ${NFS_SHARE_SERVER_DIR} $WSO2_APIM_HOME/repository/deployment/server/synapse-configs/
# ln -s ${NFS_SHARE_TENANTS_DIR} $WSO2_APIM_HOME/repository/tenants
ln -s ${NFS_SHARE_SERVER_DIR}/server $WSO2_APIM_HOME/repository/deployment
ln -sf ${NFS_SHARE_TENANTS_DIR}/tenants $WSO2_APIM_HOME/repository

$WSO2_APIM_HOME/bin/wso2server.sh start

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@
getting this node to join the cluster.
-->
<clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent"
enable="true">
enable="false">

<!--
This parameter indicates whether the cluster has to be automatically initalized
Expand Down
2 changes: 0 additions & 2 deletions pattern-2/bosh-release/jobs/keymanager/spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ templates:
repository/conf/log4j.properties: repository/conf/log4j.properties
repository/conf/user-mgt.xml: repository/conf/user-mgt.xml
repository/conf/tomcat/catalina-server.xml: repository/conf/tomcat/catalina-server.xml
repository/deployment/server/jaggeryapps/store/site/conf/site.json: repository/deployment/server/jaggeryapps/store/site/conf/site.json
repository/deployment/server/jaggeryapps/publisher/site/conf/site.json: repository/deployment/server/jaggeryapps/publisher/site/conf/site.json
repository/resources/security/client-truststore.jks: repository/resources/security/client-truststore.jks
repository/resources/security/wso2carbon.jks: repository/resources/security/wso2carbon.jks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@
getting this node to join the cluster.
-->
<clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent"
enable="true">
enable="false">

<!--
This parameter indicates whether the cluster has to be automatically initalized
Expand Down
21 changes: 12 additions & 9 deletions pattern-2/bosh-release/jobs/nfs_server/templates/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ pid_file=${run_dir}/pid
mkdir -p ${run_dir} ${log_dir}
chown -R vcap:vcap ${run_dir} ${log_dir}

export NFS_EXPORT_SERVER_DIR=/mnt/nfs-export/wso2am/deployment-server
export NFS_EXPORT_TENANTS_DIR=/mnt/nfs-export/wso2am/tenants
export NFS_EXPORT_SERVER_DIR_APIM=/mnt/nfs-export/wso2am/repository/deployment
export NFS_EXPORT_SERVER_DIR_GATEWAY=/mnt/nfs-export/gateway/repository/deployment
export NFS_EXPORT_TENANTS_DIR_GATEWAY=/mnt/nfs-export/gateway/repository

export DEBUG_LOG=${log_dir}/nfs_server.log

Expand All @@ -57,18 +58,20 @@ fi

# create the share directory and set permission

mkdir -p ${NFS_EXPORT_SERVER_DIR}
mkdir -p ${NFS_EXPORT_SERVER_DIR}/jaggeryapps
mkdir -p ${NFS_EXPORT_TENANTS_DIR}
mkdir -p ${NFS_EXPORT_SERVER_DIR_APIM}
mkdir -p ${NFS_EXPORT_SERVER_DIR_GATEWAY}
mkdir -p ${NFS_EXPORT_TENANTS_DIR_GATEWAY}/tenants

chown nobody:nogroup ${NFS_EXPORT_SERVER_DIR}
chown nobody:nogroup ${NFS_EXPORT_TENANTS_DIR}
chown nobody:nogroup ${NFS_EXPORT_SERVER_DIR_APIM}
chown nobody:nogroup ${NFS_EXPORT_SERVER_DIR_GATEWAY}
chown nobody:nogroup ${NFS_EXPORT_TENANTS_DIR_GATEWAY}

# configure the exports

if [ -z "$(cat /etc/exports | grep wso2am )" ]; then
echo "${NFS_EXPORT_SERVER_DIR} *(rw,sync,no_subtree_check)" >> /etc/exports
echo "${NFS_EXPORT_TENANTS_DIR} *(rw,sync,no_subtree_check)" >> /etc/exports
echo "${NFS_EXPORT_SERVER_DIR_APIM} *(rw,sync,no_subtree_check)" >> /etc/exports
echo "${NFS_EXPORT_SERVER_DIR_GATEWAY} *(rw,sync,no_subtree_check)" >> /etc/exports
echo "${NFS_EXPORT_TENANTS_DIR_GATEWAY} *(rw,sync,no_subtree_check)" >> /etc/exports
fi

exportfs -a
Expand Down
1 change: 1 addition & 0 deletions pattern-2/bosh-release/jobs/wso2apim/spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ templates:
repository/conf/log4j.properties: repository/conf/log4j.properties
repository/conf/user-mgt.xml: repository/conf/user-mgt.xml
repository/conf/tomcat/catalina-server.xml: repository/conf/tomcat/catalina-server.xml
repository/deployment/server/jaggeryapps/admin/site/conf/site.json: repository/deployment/server/jaggeryapps/admin/site/conf/site.json
repository/deployment/server/jaggeryapps/store/site/conf/site.json: repository/deployment/server/jaggeryapps/store/site/conf/site.json
repository/deployment/server/jaggeryapps/publisher/site/conf/site.json: repository/deployment/server/jaggeryapps/publisher/site/conf/site.json
repository/resources/security/client-truststore.jks: repository/resources/security/client-truststore.jks
Expand Down
10 changes: 5 additions & 5 deletions pattern-2/bosh-release/jobs/wso2apim/templates/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export JAVA_OPTS=" -Xmx${MAX_HEAP}m -Xms${MIN_HEAP}m -XX:MaxPermSize=${MAX_PERMG

export DEBUG_LOG=${log_dir}/wso2apim.log

export NFS_EXPORT_SERVER_DIR=/mnt/nfs-export/wso2am/deployment-server
export NFS_EXPORT_SERVER_DIR=/mnt/nfs-export/wso2am/repository/deployment

export NFS_SHARE_SERVER_DIR=/mnt/nfs-share/wso2am/repository/deployment/server
export NFS_SHARE_SERVER_DIR=/mnt/nfs-share/wso2am/repository/deployment

touch $DEBUG_LOG
chmod -R 755 /var/vcap/sys
Expand Down Expand Up @@ -98,15 +98,15 @@ case $1 in
cp /var/vcap/packages/mysqldriver/* ${WSO2_APIM_HOME}/repository/components/lib/

mkdir /tmp/wso2am
mv $WSO2_APIM_HOME/repository/deployment/server/ /tmp/wso2am
mv $WSO2_APIM_HOME/repository/deployment/server/ /tmp/wso2am/

mount -t nfs <%= link("nfs-server").instances[0].address %>:${NFS_EXPORT_SERVER_DIR} ${NFS_SHARE_SERVER_DIR}

if [ -z "$(ls -A ${NFS_SHARE_SERVER_DIR})" ]; then
cp -r /tmp/wso2am/server/* ${NFS_SHARE_SERVER_DIR}
cp -r /tmp/wso2am/* ${NFS_SHARE_SERVER_DIR}/
fi

ln -s ${NFS_SHARE_SERVER_DIR} $WSO2_APIM_HOME/repository/deployment/
ln -s ${NFS_SHARE_SERVER_DIR}/server $WSO2_APIM_HOME/repository/deployment

$WSO2_APIM_HOME/bin/wso2server.sh start

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@
getting this node to join the cluster.
-->
<clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent"
enable="true">
enable="false">

<!--
This parameter indicates whether the cluster has to be automatically initalized
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"theme": {
"base": "wso2",
"subtheme": "modern"
},
"context": "/admin",
"request_url": "READ_FROM_REQUEST",
"tasksPerPage": 10,
"allowedPermission": "/permission/admin/manage/apim_admin",
"workflows": {
"workFlowServerURL": "https://<BPSHost>:<BPSPort>/services/",
},
"ssoConfiguration": {
"enabled": "false",
"issuer": "API_WORKFLOW_ADMIN",
"identityProviderURL": "https://localhost:9443/samlsso",
"keyStorePassword": "",
"identityAlias": "",
"keyStoreName": "",
"verifyAssertionValidityPeriod": "true",
"audienceRestrictionsEnabled": "true",
"responseSigningEnabled": "true",
"assertionSigningEnabled": "true",
"assertionEncryptionEnabled": "false",
"signRequests" : "true",
"idpInit" : "false",
"idpInitSSOURL" : "https://localhost:9443/samlsso?spEntityID=API_WORKFLOW_ADMIN",
"externalLogoutPage" : "https://localhost:9443/samlsso?slo=true",
"loginUserNameAttribute" : ""
},
"reverseProxy" : {
"enabled" : true, // values true , false , "auto" - will look for X-Forwarded-* headers
"host" : "<%= p('route_registrar.routes')[0]['uris'][0] %>", // If reverse proxy do not have a domain name use IP
"context": "/admin",
"regContext": "" // Use only if different path is used for registry
},
"whiteListedHostNames" : ["localhost"],
"enableLogAnalyzer" : false
}

0 comments on commit ad7d28e

Please sign in to comment.