Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (101 sloc) 3.89 KB
jpsType: install
jpsVersion: '1.4.2'
name: Cyclos 4 PRO cluster
id: cyclos-cluster
categories:
- apps/clusters
type: java
startPage: ${env.url}
homepage: http://docs.jelastic.com
baseUrl: https://raw.githubusercontent.com/jelastic-jps/cyclos/master
logo: https://raw.githubusercontent.com/jelastic-jps/cyclos/master/images/cyclos.png
description:
text: /cyclos-4-cluster/texts/description.md
short: Preconfigured Cyclos 4 PRO Cluster
settings:
fields:
type: list
name: version
caption: Choose version
values:
cyclos-4.10.4: cyclos-4.10.4
cyclos-4.11: cyclos-4.11
default: cyclos-4.11
globals:
password: "${fn.password}"
env:
topology:
nodes:
- extip: false
count: 2
cloudlets: 24
nodeType: tomcat
tag: 9.0.12-jdk-11.0.1
displayName: AppServer
scalingMode: CLONE
links: sqldb:DB
- cloudlets: 8
count: 2
nodeType: postgresql
tag: 9.6.11
- nodeType: nginx
count: 1
cloudlets: 8
nodeGroup: bl
displayName: Load balancer
ha: true
onBeforeResetNodePassword[nodeGroup:sqldb]:
call:
- resetingNodePassword
- stopEvent
onInstall:
- ConfigReplication
- ConfigDB
- deploy:
archive: https://license.cyclos.org/downloads/cyclos/${settings.version}.zip
name: ${settings.version}.zip
context: ROOT
- replace
- restartNodes:
- nodeGroup: cp
actions:
resetingNodePassword:
- script:
script: https://raw.githubusercontent.com/jelastic-jps/cyclos/master/scripts/resetNodePassword.js
log: Config replication
ConfigReplication:
- cmd[sqldb]:
- wget "https://raw.githubusercontent.com/jelastic-jps/cyclos/master/scripts/execCmdScript.sh" -O /var/lib/pgsql/script.sh 2>&1
- cmd[${nodes.sqldb[0].id}]:
- bash -x /var/lib/pgsql/script.sh master ${nodes.sqldb[1].address} ${nodes.sqldb.password} ${nodes.sqldb[0].address} 1>> /var/lib/pgsql/log.log 2>>/var/lib/pgsql/log.log
- cmd[${nodes.sqldb[1].id}]:
- bash -x /var/lib/pgsql/script.sh slave ${nodes.sqldb[1].address} ${nodes.sqldb.password} ${nodes.sqldb[0].address} 1>> /var/lib/pgsql/log.log 2>>/var/lib/pgsql/log.log
ConfigDB:
- cmd[${nodes.sqldb[0].id}]: PGPASSWORD=${nodes.sqldb.password} psql -Uwebadmin postgres -c "create database cyclos4;"
- cmd[${nodes.sqldb[0].id}]: wget https://raw.githubusercontent.com/jelastic-jps/cyclos/master/cyclos-4-cluster/dumps/${settings.version}.bak -O cyclos4.bak 2>&1
- cmd[${nodes.sqldb[0].id}]: PGPASSWORD=${nodes.sqldb.password} psql -Uwebadmin cyclos4 < cyclos4.bak 2>&1
replace:
- cmd[cp]: |-
cp -fR /opt/tomcat/webapps/ROOT/${settings.version}/web/* /opt/tomcat/webapps/ROOT/
cp /opt/tomcat/webapps/ROOT/WEB-INF/classes/cyclos-release.properties /opt/tomcat/webapps/ROOT/WEB-INF/classes/cyclos.properties
- replaceInFile:
log: ${this.message}
nodeType: tomcat
path: "/opt/tomcat/webapps/ROOT/WEB-INF/classes/cyclos.properties"
replacements:
- pattern: "cyclos.datasource.jdbcUrl = jdbc:postgresql://localhost/cyclos4"
replacement: "cyclos.datasource.jdbcUrl = jdbc:postgresql://node${nodes.postgresql[0].id}-${env.domain}/cyclos4"
- pattern: "cyclos.datasource.user = cyclos"
replacement: "cyclos.datasource.user = webadmin"
- pattern: "cyclos.datasource.password = cyclos"
replacement: "cyclos.datasource.password = ${nodes.sqldb.password}"
- replaceInFile:
log: ${this.message}
nodeType: tomcat
path: "/opt/tomcat/conf/context.xml"
replacements:
- pattern: "</Context>"
replacement: '<Loader delegate="true"/>\n
</Context>'
success:
text: /cyclos-4-cluster/texts/success.md