When you add or update a template on one cluster node, other nodes do not automatically receive it — each node reads templates from its own localDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ohemilyy/universe/llms.txt
Use this file to discover all available pages before exploring further.
./templates/ directory. Template sync solves this by zipping the template directory on the source node, dispatching it to the target node via Hazelcast IExecutorService, and extracting it on the other side. You need to run a sync any time you update a template on the Master and want Wrapper nodes to use the new files when creating instances.
Template sync is a push operation: you run it from the node that has the files and push to the node that needs them. Both the
nodeId attribute and the raw Hazelcast member UUID are accepted as the target identifier.How template sync works
TheTemplateSyncService handles the full lifecycle of a sync operation:
- Resolve — The pattern is matched against the local
./templates/directory tree to produce a list of(group, name)pairs. - Zip — Each matched template directory is recursively walked and written into an in-memory ZIP archive (
ByteArrayOutputStream). - Dispatch — The ZIP bytes are embedded in a
TemplateSyncTask(serialized as a Gson JSON string) and submitted to the target Hazelcast member viaIExecutorService.submitToMember(). - Extract — The target node receives the task, calls
receiveSync(), and extracts the ZIP into./templates/<group>/<name>/. Existing files at the destination are overwritten. The extractor guards against zip-slip path traversal attacks by verifying every entry resolves within the target directory.
Pattern syntax
The<pattern> argument controls which templates are included in a single sync operation.
| Pattern | Resolves to |
|---|---|
<group>/<name> | The single template at ./templates/<group>/<name>/ |
<group>/* | All subdirectory templates inside ./templates/<group>/ |
* | Every template in every group under ./templates/ |
Patterns are resolved against the source node’s local filesystem at the time the command runs. If a pattern matches no directories, the command prints
No templates found matching pattern: <pattern> and exits without dispatching any tasks.Syncing templates
Place templates on the source node
Templates must be present at If you are running inside Docker, copy files into the container’s
./templates/<group>/<name>/ on the node you are running the command from. The directory structure is:/data/templates/ volume path before syncing.Identify the target node
Use Use the
cluster nodes to find the nodeId values (or Hazelcast UUIDs) of all connected members:nodeId value (e.g. node-2) as the <targetNode> argument. The raw UUID also works.Run the sync command
Execute The console prints one line per template:
template sync with your chosen pattern and the target node ID:What happens on the receiving node
When the Hazelcast executor task arrives, the target node callsTemplateSyncService.receiveSync():
- The ZIP bytes are extracted into
./templates/<group>/<name>/usingZipInputStream. - Missing parent directories are created automatically.
- Existing files at the destination are replaced (via
StandardCopyOption.REPLACE_EXISTING). - Any ZIP entry that resolves outside the target directory is skipped and a warning is logged (zip-slip protection).
Failure cases
| Situation | Behaviour |
|---|---|
| Pattern matches no local directories | Command exits with “No templates found matching pattern” — nothing is dispatched |
| Target node not found in cluster | syncTemplate returns false; a warning is logged; the failure is counted in the summary |
| ZIP extraction fails on target | receiveSync returns false; an error is logged on the target node |
| Source directory disappears mid-zip | An exception is thrown; the failure is counted in the summary |
S3 storage as an alternative
For clusters with many nodes, pushing templates to each node individually adds operational overhead. Thestorage-s3 extension provides a centralized template backend: templates are uploaded to an S3 bucket once and downloaded by any node on demand, without running template sync at all.
See S3 Storage Extension for setup and configuration details.