Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #107

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,51 @@ xsite:
port: 7200
```

Next the (local) port 7900 must be mapped to the port defined in the configuration (7200). On Docker for example by using `-p 7200:7900`
shivan marked this conversation as resolved.
Show resolved Hide resolved

Note: Caches won't be created automatically on the other side. So these must be created manually with the same name.
shivan marked this conversation as resolved.
Show resolved Hide resolved

So create a new cache either using the console (http://localhost:11222) or curl (or similar tool)
shivan marked this conversation as resolved.
Show resolved Hide resolved
`curl -XPOST -u <user>:<password> -H "Content-Type: application/xml" -d "@<path/to/cache.xml>" http://localhost:11222/rest/v2/caches/xsite-cache`

LON-Site:
```
<infinispan>
<cache-container>
<replicated-cache name="xsite-cache" statistics="true">
<backups>
<backup site="NYC" strategy="SYNC"/>
oraNod marked this conversation as resolved.
Show resolved Hide resolved
</backups>
</replicated-cache>
</cache-container>
</infinispan>
```

NYC-Site:
```
<infinispan>
<cache-container>
<replicated-cache name="xsite-cache" statistics="true">
<backups>
<backup site="LON" strategy="SYNC"/>
oraNod marked this conversation as resolved.
Show resolved Hide resolved
</backups>
</replicated-cache>
</cache-container>
</infinispan>
```

To test the replication, simply create a key on one site and search for it on the other site, where it will be available then, too.
shivan marked this conversation as resolved.
Show resolved Hide resolved

Docker command example for two sites on same system (but you have to use different ports for both sites):
shivan marked this conversation as resolved.
Show resolved Hide resolved

Infinispan 1 - in network "bridge" - admin port 11222, jgroups port 7300:

`docker run --rm -p 11222:11222 -p 7300:7900 -v c:/work/InfiniSpan:/user-config --name infinispan1 -e IDENTITIES_PATH="/user-config/identities.yaml" -e CONFIG_PATH="/user-config/config1.yaml" --network bridge infinispan/server:11.0.4.Final-2`
shivan marked this conversation as resolved.
Show resolved Hide resolved

Infinispan 2 - in network "Bridge2" (created by `docker network create -d bridge Bridge2`) - admin port 12222, jgroups port 7200:

`docker run --rm -p 12222:11222 -p 7200:7900 -v c:/work/InfiniSpan:/user-config --name infinispan2 -e IDENTITIES_PATH="/user-config/identities.yaml" -e CONFIG_PATH="/user-config/config2.yaml" --network Bridge2 infinispan/server:11.0.4.Final-2`
shivan marked this conversation as resolved.
Show resolved Hide resolved

## Java Properties
It's possible to provide additional java properties and JVM options to all of the images via the `JAVA_OPTIONS` env variable.
For example, to quickly configure CORS without providing a server.yaml file, it's possible to do the following:
Expand Down