If you created a domain with Oracle WebLogic Server for OCI, and your web applications require session persistence, you can update the load balancer for the domain.
Session persistence is a method to direct all requests originating from a single
logical client to a single backend server. By default, session persistence is
enabled on the load balancer with the
Enable load balancer cookie
persistence option, but you can update the load balancer after creating
Oracle Cloud Infrastructure Load Balancing supports two types of session persistence (stickiness):
- Application cookie persistence - The load balancer activates session persistence when a backend server sends a
Set-Cookieresponse header containing a recognized cookie name.
- Load balancer cookie persistence - The load balancer inserts a cookie into the response, which enables session persistence. This method is useful when you have applications that cannot generate their own cookies.
To configure session persistence:
- Sign in to the Oracle Cloud Infrastructure Console.
- From the navigation menu, click Networking, and then click Load Balancers.
- Select the Compartment in which the network resources for your domain were created.Depending on how the stack is initially created, this is the compartment that contains the compute instances and network resources for the domain, or this is the network compartment that has only the network resources for the domain.
- Click the name of the load balancer that's associated with your domain.The load balancer has
-lbappended to the domain name. For example:
- Click Backend Sets.
- Click the backend set for this load balancer.
- Click Edit.
- Modify the Session Persistence configuration.For example, if you select Enable Application Cookie Persistence, and set Cookie Name to
'*', then responses that contain any cookie will be directed to the same server in the domain.
Enable Session Affinity or Sticky Sessions
If you have clustered JMS resources and you access it by using an external client through a load balancer by rmi-tunneling, then you need to enable session affinity or sticky sessions.
- Access the WebLogic console of the clone instance. See Access the WebLogic Console.
- Under Domain Structure, expand Environment > Clusters, and then click Cluster-1.
- In the right pane, change the Default Load Algorithm property to
- Click Save.
- Restart the WebLogic Server instances.