此内容没有您所选择的语言版本。
Chapter 9. Multi-tenancy
Multi-tenancy allows accessing multiple containers as shown below:
Currently there are two supported protocols for accessing the data - using Hot Rod client and using REST interface.
9.1. Using REST interface 复制链接链接已复制到粘贴板!
Multi-tenancy router uses URL prefixes to separate containers using the following template: https://<server_ip>:<server_port>/rest/<rest_connector_name>/<cache_name>/<key>. All HTTP operations remain exactly the same as using standard rest-connector.
The REST connector by default support both HTTP/1.1 and HTTP/2 protocols. The switching from HTTP/1.1 to HTTP/2 procedure involves either using TLS/ALPN negotiation or HTTP/1.1 upgrade procedure. The former requires proper encryption to be enabled. The latter is always enabled.
9.2. Using Hot Rod client 复制链接链接已复制到粘贴板!
Multi-tenant routing for binary protocols requires using a standard, transport layer mechanism such as SSL/TLS Server Name Indication. The server needs to be configured to support encryption and additional SNI routing needs to be added to the router-connector.
In order to connect to a secured Hot Rod server, the client needs to use configuration similar to this:
9.2.1. Multi-tenant router 复制链接链接已复制到粘贴板!
The Multi-tenant router endpoint works as a facade for one or more REST/Hot Rod connectors. Its main purpose is to forward client requests into proper container.
In order to properly configure the routing, socket-binding attributes of other connectors must be disabled and additional attribute name must be used as shown below:
<rest-connector name="rest-1" cache-container="local"/> <rest-connector name="rest-2" cache-container="local"/> <hotrod-connector name="hotrod-1" cache-container="local" /> <hotrod-connector name="hotrod-2" cache-container="local" />
<rest-connector name="rest-1" cache-container="local"/>
<rest-connector name="rest-2" cache-container="local"/>
<hotrod-connector name="hotrod-1" cache-container="local" />
<hotrod-connector name="hotrod-2" cache-container="local" />
The next step is to add a new router-connector endpoint and configure how other containers will be accessed. Note that Hot Rod connectors require using TLS/SNI and REST connectors require using prefix in the URL:
With the following configuration, Hot Rod clients will access hotrod-1 connector when using SNI Host Name "hotrod-1". REST clients will need to use the following URL to access "rest-1" connector - https://<server_ip>:<server_port>/rest/rest-1.