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 all commits
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
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,96 @@ xsite:
port: 7200
```

Map the local port `7900` to the port defined in the configuration (`7200`). On Docker, for example, use `-p 7200:7900`

Note: Caches aren't created automatically on the other site. You must manually create caches with identical names.

To create a new cache, use the console (http://localhost:11222) or a tool such as curl:
`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 replication, create a key on one site then search for it on the other site.

Docker command example for two sites using different ports on the same host:

Config1:

```
jgroups:
diagnostics: true
encrypt: false
xsite:
address: <ip of infinispan nyc>
name: NYC
port: 7300
backups:
- address: <ip of infinispan lon>
name: LON
port: 7200
oraNod marked this conversation as resolved.
Show resolved Hide resolved
logging:
console:
level: debug
categories:
com.arjuna: warn
org.jgroups: debug
```


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

`docker run --rm -p 11222:11222 -p 7300:7900 -v <path/to/config-folder>:/user-config --name infinispan1 -e IDENTITIES_PATH="/user-config/identities.yaml" -e CONFIG_PATH="/user-config/config1.yaml" --network bridge infinispan/server

Config2:

```
jgroups:
diagnostics: true
encrypt: false
xsite:
address: <ip of infinispan lon>
name: LON
port: 7200
backups:
- address: <ip of infinispan nyc>
name: NYC
port: 7300
oraNod marked this conversation as resolved.
Show resolved Hide resolved
logging:
console:
level: debug
categories:
com.arjuna: warn
org.jgroups: debug
```

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 <path/to/config-folder>:/user-config --name infinispan2 -e IDENTITIES_PATH="/user-config/identities.yaml" -e CONFIG_PATH="/user-config/config2.yaml" --network Bridge2 infinispan/server`

## 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