Configuring Distributed Shared Storage for Omni Gateway in Connected Mode
Enable distributed shared storage for distributed caching, gateway configuration caching (Connected Mode), and rate limiting policies.
Distributed shared storage enables multiple gateway replicas to share state across a distributed deployment.
Distributed shared storage isn’t persistent and data is lost when all replicas go down (scaled to zero replicas). For persistent shared storage, configure Redis shared storage.
You configure distributed shared storage via a storage YAML file.
The following steps demonstrate distributed shared storage support for Omni Gateway running in a Docker container, as a Linux service, or as a Kubernetes cluster.
Configure Shared Storage for Omni Gateway as a Linux service
-
Create a folder in the
/usr/local/share/mulesoft/flex-gateway/conf.ddirectory and name itstorage:sudo mkdir /usr/local/share/mulesoft/flex-gateway/conf.d/storage -
Create a YAML configuration file in the
storagefolder:sudo touch /usr/local/share/mulesoft/flex-gateway/conf.d/storage/shared-storage-config.yaml -
Update the file with your distributed shared storage configuration details. For example:
sudo vi /usr/local/share/mulesoft/flex-gateway/conf.d/storage/shared-storage-config.yaml -
Apply this configuration to all Omni Gateway replicas for them to share data. Sample configuration for adding distributed shared storage:
apiVersion: gateway.mulesoft.com/v1alpha1 kind: Configuration metadata: name: api-shared-storage spec: sharedStorage: objectStore: url: distributed://0.0.0.0:30001?join=flex.hostname.com:30001
You can specify multiple host names in the join parameter by separating them with commas. For example: distributed://0.0.0.0:30001?join=node1.example.com:30001,node2.example.com:30001,192.168.1.10:30001. The hostname must resolve to the IPs of the Omni Gateway replicas. Firewall rules must allow Omni Gateway replicas to create connections between each other on port 30001.
|
Configure Shared Storage for Omni Gateway in a Docker Container
| If you have already added a volume for a folder with your Omni Gateway configuration files, skip to the last step. |
-
Stop your Omni Gateway and any replicas.
-
Create a folder named
appin the directory with your Omni Gateway configuration files. -
Restart your Omni Gateway with an additional volume for the new
appdirectory:docker run --rm \ -v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \ -p 8080:8080 \ mulesoft/flex-gatewaySpecify an optional name you want to assign to your Omni Replica by including the following: -e FLEX_NAME=<name-for-flex-replica> \. -
Create and save a YAML configuration file in your
appfolder with your shared storage details. -
Apply this configuration to all Omni Gateway replicas for them to share data.
Sample configuration for adding distributed shared storage:
apiVersion: gateway.mulesoft.com/v1alpha1 kind: Configuration metadata: name: api-shared-storage spec: sharedStorage: objectStore: url: distributed://0.0.0.0:30001?join=flex.hostname.com:30001
You can specify multiple host names in the join parameter by separating them with commas. For example: distributed://0.0.0.0:30001?join=node1.example.com:30001,node2.example.com:30001,192.168.1.10:30001. The hostname must resolve to the IPs of the Omni Gateway replicas. Firewall rules must allow Omni Gateway replicas to create connections between each other on port 30001.
|
Configure Shared Storage for Omni Gateway in a Kubernetes Cluster
-
Create a new resource using a YAML configuration file with your storage details.
-
Apply this configuration to all Omni Gateway replicas for them to share data.
Sample configuration for adding distributed shared storage:
apiVersion: gateway.mulesoft.com/v1alpha1
kind: Configuration
metadata:
name: api-shared-storage
spec:
sharedStorage:
objectStore:
url: distributed://0.0.0.0:30001?join=flex.hostname.com:30001
You can specify multiple host names in the join parameter by separating them with commas. For example: distributed://0.0.0.0:30001?join=node1.example.com:30001,node2.example.com:30001,192.168.1.10:30001. The hostname must resolve to the IPs of the Omni Gateway replicas. Firewall rules must allow Omni Gateway replicas to create connections between each other on port 30001.
|






