You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2020/04/03 19:09:22 UTC
[sling-org-apache-sling-kickstart] 01/01: Created two scripts to
launch a Composite Node Store where /apps and /libs are read only
This is an automated email from the ASF dual-hosted git repository.
andysch pushed a commit to branch feature/composite-node-store
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-kickstart.git
commit 515b26f67b99412aac09248853478d55ddda14ec
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Fri Apr 3 12:08:58 2020 -0700
Created two scripts to launch a Composite Node Store where /apps and /libs are read only
---
create_seed_fm.sh | 14 ++++
explore_repo.sh | 21 ++++++
run-composite-fm.sh | 10 +++
src/main/resources/feature-sling12.json | 3 -
src/main/resources/feature-two-headed-runtime.json | 75 ++++++++++++++++++++++
src/main/resources/feature-two-headed-seed.json | 41 ++++++++++++
6 files changed, 161 insertions(+), 3 deletions(-)
diff --git a/create_seed_fm.sh b/create_seed_fm.sh
new file mode 100755
index 0000000..9f1edd1
--- /dev/null
+++ b/create_seed_fm.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+echo "-----------------------------------"
+echo "| PLEASE SHUTDOWN SLING MANUALLY |"
+echo "| AFTER STARTUP IS COMPLETE |"
+echo "-----------------------------------"
+
+set +x
+sleep 3
+
+rm -rf launcher
+rm -rf sling
+java -jar target/org.apache.sling.kickstart-0.0.1-SNAPSHOT.jar -af src/main/resources/feature-two-headed-seed.json -c sling/sling-composite
+
diff --git a/explore_repo.sh b/explore_repo.sh
new file mode 100755
index 0000000..0cbec3b
--- /dev/null
+++ b/explore_repo.sh
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+
+if [ $# -ne 1 ]; then
+ echo "Usage: $0 repo_dir"
+ exit 1
+fi
+
+repo_dir=$1
+
+if [ ! -d $repo_dir ]; then
+ echo "${repo_dir} is not a directory"
+ exit 2
+fi
+
+oak_version=1.26.0
+oak_run_jar=$HOME/.m2/repository/org/apache/jackrabbit/oak-run/${oak_version}/oak-run-${oak_version}.jar
+if [ ! -f ${oak_run_jar} ]; then
+ mvn dependency:get -Dartifact=org.apache.jackrabbit:oak-run:${oak_version}
+fi
+
+java -jar ${oak_run_jar} explore ${repo_dir}
diff --git a/run-composite-fm.sh b/run-composite-fm.sh
new file mode 100755
index 0000000..07a0594
--- /dev/null
+++ b/run-composite-fm.sh
@@ -0,0 +1,10 @@
+#!/bin/sh -ex
+
+# The name of the genrated segment store is not matching the libs segmentstore as the role is added to its name
+# so we create a symoblic link here
+cd sling/sling-composite/repository-libs
+ln -s segmentstore segmentstore-composite-mount-libs
+cd ../../..
+
+java -jar target/org.apache.sling.kickstart-0.0.1-SNAPSHOT.jar -af src/main/resources/feature-two-headed-runtime.json -c sling/sling-composite
+
diff --git a/src/main/resources/feature-sling12.json b/src/main/resources/feature-sling12.json
index 85b68c4..08d3cff 100644
--- a/src/main/resources/feature-sling12.json
+++ b/src/main/resources/feature-sling12.json
@@ -856,9 +856,6 @@
"jaas.classname":"org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule",
"jaas.ranking:Integer":"200"
},
- "org.apache.jackrabbit.oak.segment.SegmentNodeStoreService":{
- "name":"Default NodeStore"
- },
"org.apache.sling.scripting.core.impl.ScriptCacheImpl":{
"org.apache.sling.scripting.cache.additional_extensions":[
"js"
diff --git a/src/main/resources/feature-two-headed-runtime.json b/src/main/resources/feature-two-headed-runtime.json
new file mode 100644
index 0000000..1b81513
--- /dev/null
+++ b/src/main/resources/feature-two-headed-runtime.json
@@ -0,0 +1,75 @@
+{
+ "id": "org.apache.sling:org.apache.sling.feature.model.starter:slingosgifeature:two-headed:12-SNAPSHOT",
+ "configurations": {
+ "org.apache.sling.commons.log.LogManager.factory.config~oak.log": {
+ "org.apache.sling.commons.log.pattern": "%-4r [%t] %-5p %c %x - %m%n",
+ "org.apache.sling.commons.log.names": [
+ "org.apache.jackrabbit.oak"
+ ],
+ "org.apache.sling.commons.log.level": "debug",
+ "org.apache.sling.commons.log.file": "logs/oak.log"
+ },
+
+ "org.apache.sling.commons.log.LogManager.factory.config~composum.log": {
+ "org.apache.sling.commons.log.pattern": "%-4r [%t] %-5p %c %x - %m%n",
+ "org.apache.sling.commons.log.names": [
+ "com.composum.core",
+ "com.composum.sling"
+ ],
+ "org.apache.sling.commons.log.level": "debug",
+ "org.apache.sling.commons.log.file": "logs/composum.log"
+ },
+
+ "org.apache.jackrabbit.oak.composite.CompositeNodeStoreService": {
+ "seedMount": "libs",
+ "enabled": true,
+ "enableChecks": false,
+ "partialReadOnly": true
+ },
+
+ "org.apache.jackrabbit.oak.composite.CrossMountReferenceValidatorProvider": {
+ "failOnDetection": true
+ },
+
+ "org.apache.jackrabbit.oak.composite.MountInfoProviderService": {
+ "mountName": "libs",
+ "readOnlyMount": true,
+ "pathsSupportingFragments": [
+ "/oak:index/*$"
+ ],
+ "mountedPaths": [
+ "/libs",
+ "/apps",
+ "/jcr:system/rep:permissionStore/oak:mount-libs-default"
+ ]
+ },
+
+ "org.apache.jackrabbit.oak.composite.checks.NodeTypeMountedNodeStoreChecker~referenceable": {
+ "errorLabel": "referenceable node",
+ "invalidNodeType": "mix:referenceable",
+ "excludedNodeTypes": [
+ "nt:resource"
+ ]
+ },
+
+ "org.apache.jackrabbit.oak.composite.checks.NodeTypeMountedNodeStoreChecker~versionable": {
+ "errorLabel": "versionable node",
+ "invalidNodeType": "mix:versionable"
+ },
+
+ "org.apache.jackrabbit.oak.segment.SegmentNodeStoreFactory~libs": {
+ "role": "composite-mount-libs",
+ "customBlobStore": false,
+ "nodeDeduplicationCache.size": 0,
+ "repository.home": "sling/sling-composite/repository-libs"
+ },
+
+ "org.apache.jackrabbit.oak.segment.SegmentNodeStoreFactory~global": {
+ "service.ranking": 100,
+ "role": "composite-global",
+ "registerDescriptors": true,
+ "dispatchChanges": true,
+ "repository.home": "sling/sling-composite/repository-global"
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/resources/feature-two-headed-seed.json b/src/main/resources/feature-two-headed-seed.json
new file mode 100644
index 0000000..4820bf0
--- /dev/null
+++ b/src/main/resources/feature-two-headed-seed.json
@@ -0,0 +1,41 @@
+{
+ "id": "org.apache.sling:org.apache.sling.feature.model.starter:slingosgifeature:two-headed:12-SNAPSHOT",
+ "configurations": {
+ "org.apache.sling.commons.log.LogManager.factory.config~oak.log": {
+ "org.apache.sling.commons.log.pattern": "%-4r [%t] %-5p %c %x - %m%n",
+ "org.apache.sling.commons.log.names": [
+ "org.apache.jackrabbit.oak"
+ ],
+ "org.apache.sling.commons.log.level": "debug",
+ "org.apache.sling.commons.log.file": "logs/oak.log"
+ },
+
+ "org.apache.sling.commons.log.LogManager.factory.config~composum.log": {
+ "org.apache.sling.commons.log.pattern": "%-4r [%t] %-5p %c %x - %m%n",
+ "org.apache.sling.commons.log.names": [
+ "com.composum"
+ ],
+ "org.apache.sling.commons.log.level": "debug",
+ "org.apache.sling.commons.log.file": "logs/composum.log"
+ },
+
+ "org.apache.jackrabbit.oak.segment.SegmentNodeStoreService~global": {
+ "name": "Default NodeStore",
+ "repository.home": "sling/sling-composite/repository-libs"
+ },
+
+ "org.apache.jackrabbit.oak.composite.CrossMountReferenceValidatorProvider": {
+ "failOnDetection": true
+ },
+
+ "org.apache.jackrabbit.oak.composite.MountInfoProviderService": {
+ "mountName": "libs",
+ "readOnlyMount": false,
+ "pathsSupportingFragments": [],
+ "mountedPaths": [
+ "/libs",
+ "/apps"
+ ]
+ }
+ }
+}
\ No newline at end of file