diff --git a/all/embedded/pom.xml b/all/embedded/pom.xml index c1b6b8617985..799dde9bb97b 100644 --- a/all/embedded/pom.xml +++ b/all/embedded/pom.xml @@ -32,6 +32,12 @@ ${uberjar.deps.optional} + + org.infinispan + infinispan-cloud + ${uberjar.deps.optional} + + org.infinispan infinispan-cachestore-jdbc @@ -132,6 +138,22 @@ c3p0 ${uberjar.deps.optional} + + + org.jboss + jboss-dmr + ${uberjar.deps.optional} + + + org.jgroups.kubernetes + dns + ${uberjar.deps.optional} + + + org.jgroups.kubernetes + kubernetes + ${uberjar.deps.optional} + @@ -251,6 +273,14 @@ true + + org.jboss.dmr + infinispan.org.jboss.dmr + + + net.oauth + infinispan.net.oauth + com.google infinispan.com.google @@ -322,12 +352,16 @@ !org.jgroups.*, !org.jboss.logmanager, !org.jboss.modules, + !org.jboss.dmr, !org.iq80.snappy, !org.jboss.marshalling.*, !org.xerial.snappy, !sun.misc, !sun.reflect, !sun.nio.ch, + !__redirected, + com.sun.net.httpserver;resolution:=optional, + io.undertow.*;resolution:=optional, * * diff --git a/as-modules/embedded/build.xml b/as-modules/embedded/build.xml index 989ce1b95026..35d1877d49e7 100644 --- a/as-modules/embedded/build.xml +++ b/as-modules/embedded/build.xml @@ -161,6 +161,13 @@ + + + + + + + diff --git a/as-modules/embedded/pom.xml b/as-modules/embedded/pom.xml index 8c98c96cd0c8..f2ad26904ba6 100644 --- a/as-modules/embedded/pom.xml +++ b/as-modules/embedded/pom.xml @@ -158,6 +158,23 @@ provided + + org.jgroups.kubernetes + kubernetes + + + org.jgroups.kubernetes + common + + + org.jgroups.kubernetes + dns + + + net.oauth.core + oauth + + diff --git a/as-modules/embedded/src/main/resources/org/jgroups/kubernetes/main/module.xml b/as-modules/embedded/src/main/resources/org/jgroups/kubernetes/main/module.xml new file mode 100644 index 000000000000..d341938cbf4a --- /dev/null +++ b/as-modules/embedded/src/main/resources/org/jgroups/kubernetes/main/module.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/bom/pom.xml b/bom/pom.xml index f9e3ecbc4dd8..e2912869d87c 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -184,6 +184,11 @@ infinispan-core ${project.version} + + ${project.groupId} + infinispan-cloud + ${project.version} + ${project.groupId} infinispan-osgi diff --git a/cloud/pom.xml b/cloud/pom.xml new file mode 100644 index 000000000000..abddec32d0ab --- /dev/null +++ b/cloud/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + + org.infinispan + infinispan-parent + 9.0.0-SNAPSHOT + ../parent/pom.xml + + + infinispan-cloud + Infinispan Cloud + Infinispan cloud integration module + + + + org.infinispan + infinispan-core + + + + org.jgroups.kubernetes + kubernetes + + + + diff --git a/core/src/main/resources/default-configs/default-jgroups-ec2.xml b/cloud/src/main/resources/default-configs/default-jgroups-ec2.xml similarity index 100% rename from core/src/main/resources/default-configs/default-jgroups-ec2.xml rename to cloud/src/main/resources/default-configs/default-jgroups-ec2.xml diff --git a/core/src/main/resources/default-configs/default-jgroups-google.xml b/cloud/src/main/resources/default-configs/default-jgroups-google.xml similarity index 100% rename from core/src/main/resources/default-configs/default-jgroups-google.xml rename to cloud/src/main/resources/default-configs/default-jgroups-google.xml diff --git a/cloud/src/main/resources/default-configs/default-jgroups-kubernetes.xml b/cloud/src/main/resources/default-configs/default-jgroups-kubernetes.xml new file mode 100644 index 000000000000..af85fef63a3b --- /dev/null +++ b/cloud/src/main/resources/default-configs/default-jgroups-kubernetes.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/pom.xml b/core/pom.xml index c4f375e70eb3..cdd2284ac2cf 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -30,6 +30,10 @@ jgroups + + org.jgroups.kubernetes + kubernetes + org.jboss.spec.javax.transaction diff --git a/documentation/src/main/asciidoc/upgrading/upgrading.asciidoc b/documentation/src/main/asciidoc/upgrading/upgrading.asciidoc index c97d6aabd0f7..235cf05b3766 100644 --- a/documentation/src/main/asciidoc/upgrading/upgrading.asciidoc +++ b/documentation/src/main/asciidoc/upgrading/upgrading.asciidoc @@ -8,6 +8,9 @@ The Infinispan community This guide walks you through the process of upgrading Infinispan. == Upgrading from 8.x to 9.0 +=== New Cloud module for library mode +In Infinispan 8.x, cloud related configuration were added to `infinispan-core` module. Since 9.0 they were moved to `infinispan-cloud` module. + === Entry Retriever is now removed The entry retriever feature has been removed. Please update to use the new Streams feature detailed in the User Guide. The `org.infinispan.filter.CacheFilters` class can be used to convert `KeyValueFilter` and `Converter` instances diff --git a/documentation/src/main/asciidoc/user_guide/cloud_aws.adoc b/documentation/src/main/asciidoc/user_guide/cloud_aws.adoc index f2864a9bfcd6..033cb71aac3d 100644 --- a/documentation/src/main/asciidoc/user_guide/cloud_aws.adoc +++ b/documentation/src/main/asciidoc/user_guide/cloud_aws.adoc @@ -1,5 +1,19 @@ == Running on Cloud Services +In order to turn on Cloud support for Infinispan library mode, one needs to add a new dependency to the classpath: + +.Cloud support in library mode +[source,xml] +---- + + org.infinispan + infinispan-cloud + ${infinispan.version} + +---- + +The above dependency adds `infinispan-core` to the classpath as well as some default configurations. + === Amazon Web Services Infinispan can be used on the Amazon Web Service (AWS) platform and similar cloud based environment in several ways. As Infinispan uses JGroups as the underlying communication technology, the majority of the configuration work is done JGroups. The default auto discovery won't work on EC2 as multicast is not allowed, but JGroups provides several other discovery protocols so we only have to choose one. @@ -60,5 +74,37 @@ Finally you can configure your JGroups instances to use a shared storage to exch ---- ==== JDBC_PING -A similar approach to S3_PING, but using a JDBC connection to a shared database. On EC2 that is quite easy using Amazon RDS. See the link:$$http://community.jboss.org/wiki/JDBCPING$$[JDBC_PING Wiki page] for details. +A similar approach to S3_PING, but using a JDBC connection to a shared database. On EC2 that is quite easy using Amazon RDS. See the link:$$http://community.jboss.org/wiki/JDBCPING$$[JDBC_PING Wiki page] for details. + +== Kubernetes and OpenShift + +Since OpenShift uses Kubernetes underneath both of them can use the same discovery protocol - link:$$https://github.com/jgroups-extras/jgroups-kubernetes$$[Kube_PING]. The configuration is very straightforward: + +.Sample KUBE_PING configuration +[source,xml] +---- + + +    +    +... +... + + +---- + +The most important thing is to bind JGroups to `eth0` interface, which is link:$$https://docs.docker.com/engine/userguide/networking/dockernetworks/$$[used by Docker containers for network communication]. + +KUBE_PING protocol is configured by environmental variables (which should be available inside a container). The most important thing is to set `OPENSHIFT_KUBE_PING_NAMESPACE` to proper namespace. It might be either hardcoded or populated via link:$$https://github.com/kubernetes/kubernetes/tree/release-1.0/docs/user-guide/downward-api$$[Kubernetes' Downward API]. + +Since KUBE_PING uses Kubernetes API for obtaining available Pods, OpenShift requires adding additional privileges. Assuming that `oc project -q` returns current namespace and `default` is the service account name, one needs to run: + +.Adding additional OpenShift privileges +[source,bash] +---- + +oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default -n $(oc project -q) + +---- +After performing all above steps, the clustering should be enabled and all Pods should automatically form a cluster within a single namespace. \ No newline at end of file diff --git a/documentation/src/main/asciidoc/user_guide/configuration.adoc b/documentation/src/main/asciidoc/user_guide/configuration.adoc index 2e9a02e51fe8..311e52ca1056 100644 --- a/documentation/src/main/asciidoc/user_guide/configuration.adoc +++ b/documentation/src/main/asciidoc/user_guide/configuration.adoc @@ -361,6 +361,7 @@ The configurations available are: * default-jgroups-udp.xml - Uses UDP as a transport, and UDP multicast for discovery. Usually suitable for larger (over 100 nodes) clusters _or_ if you are using link:http://community.jboss.org/docs/DOC-14853#replicated[replication or invalidation] . Minimises opening too many sockets. * default-jgroups-tcp.xml - Uses TCP as a transport and UDP multicast for discovery. Better for smaller clusters (under 100 nodes) _only if_ you are using link:http://community.jboss.org/docs/DOC-14853#distribution[distribution] , as TCP is more efficient as a point-to-point protocol * default-jgroups-ec2.xml - Uses TCP as a transport and link:http://community.jboss.org/docs/DOC-15925[S3_PING] for discovery. Suitable on link:http://aws.amazon.com/ec2/[Amazon EC2] nodes where UDP multicast isn't available. +* default-jgroups-kubernetes.xml - Uses TCP as a transport and link:https://github.com/jgroups-extras/jgroups-kubernetes[KUBE_PING] for discovery. Suitable on link:http://kubernetes.io/[Kubernetes] and link:https://www.openshift.org/[OpenShift] nodes where UDP multicast is not always available. ===== Tuning JGroups settings The settings above can be further tuned without editing the XML files themselves. @@ -398,6 +399,13 @@ $ java -cp ... -Djgroups.tcp.port=1234 -Djgroups.tcp.address=10.11.12.13 |jgroups.s3.bucket|Name of the Amazon S3 bucket to use. Must be unique and must already exist| |No |=============== +.default-jgroups-kubernetes.xml +|=============== +| _System Property_ | _Description_ | _Default_ | _Required?_ +|jgroups.tcp.address|IP address to use for the TCP transport.|eth0|No +|jgroups.tcp.port|Port to use for TCP socket|7800|No +|=============== + ==== Further reading JGroups also supports more system property overrides, details of which can be found on this page: link:http://community.jboss.org/docs/12352[SystemProps] diff --git a/parent/pom.xml b/parent/pom.xml index 6a9ad373b74c..d1f5beeadb67 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -171,6 +171,8 @@ 2.0.1 2.3.4.Final 2.3.4.Final + 0.9.0 + 20090531 10.0.0.Final 2.0.10.Final @@ -983,6 +985,32 @@ import pom + + org.jgroups.kubernetes + kubernetes + ${version.groups.kubernetes} + + + org.jgroups.kubernetes + common + ${version.groups.kubernetes} + + + io.undertow + undertow-core + + + + + org.jgroups.kubernetes + dns + ${version.groups.kubernetes} + + + net.oauth.core + oauth + ${version.oauth.core} + diff --git a/pom.xml b/pom.xml index b58640cc737b..de2f78dac02a 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,7 @@ commons commons-test core + cloud extended-statistics tools query diff --git a/server/integration/feature-pack/pom.xml b/server/integration/feature-pack/pom.xml index 7cd31e117be7..f2d33629f49a 100644 --- a/server/integration/feature-pack/pom.xml +++ b/server/integration/feature-pack/pom.xml @@ -575,6 +575,42 @@ xpp3 xpp3 + + + org.jgroups.kubernetes + kubernetes + + + * + * + + + + + org.jgroups.kubernetes + common + + + * + * + + + + + org.jgroups.kubernetes + dns + + + * + * + + + + + net.oauth.core + oauth + + diff --git a/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/extension/main/module.xml b/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/extension/main/module.xml index 6d7371401db1..4c63bd81e046 100644 --- a/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/extension/main/module.xml +++ b/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/extension/main/module.xml @@ -29,6 +29,7 @@ + diff --git a/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/kubernetes/kubernetes/main/module.xml b/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/kubernetes/kubernetes/main/module.xml new file mode 100644 index 000000000000..d341938cbf4a --- /dev/null +++ b/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/kubernetes/kubernetes/main/module.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/main/module.xml b/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/main/module.xml index e1ce514af09f..cc6fff737df6 100644 --- a/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/main/module.xml +++ b/server/integration/feature-pack/src/main/resources/modules/system/layers/base/org/jgroups/main/module.xml @@ -9,6 +9,7 @@ + diff --git a/server/integration/jgroups/src/main/resources/subsystem-templates/cloud-jgroups.xml b/server/integration/jgroups/src/main/resources/subsystem-templates/cloud-jgroups.xml index 3ecee604190d..31286b890549 100644 --- a/server/integration/jgroups/src/main/resources/subsystem-templates/cloud-jgroups.xml +++ b/server/integration/jgroups/src/main/resources/subsystem-templates/cloud-jgroups.xml @@ -104,6 +104,22 @@ + + + + + + + + + false + + + + + + +