In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to configure Session sharing through the database in WebLogic. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
1. Configuration preparation
1) to configure JDBC to copy Session, there are three main steps
(1) create a table in the database
(2) create a connection pool with read / write permissions to the database
(3) configure session persistence in the weblogic.xml deployment descriptor
2) an example of configuring session persistence is as follows:
Jdbc MYSQL wl_servlet_sessions
The optional parameters are as follows.
① memory-- disables persistent session storage.
② replicated-- is the same as memory, but session data is replicated between cluster servers.
③ replicated_if_clustered-- if the Web application is deployed on a clustered server, replicate by valid persistentstore-type; otherwise, replicate by default memory.
④ sync-replication-across-cluster-- replication will occur synchronously within the cluster.
⑤ async-replication-across-cluster-- replication will occur asynchronously within the cluster.
3) JDBC persistence table configuration must have a database table named WL_SERVLET_SESSIONS with read / write access, as shown in the table below.
Column header
Column data type
WL_ID
Variable width, up to 100 characters
WL_CONTEXT_PATH
WL_IS_NEW
Numeric,20 bit
WL_ACCESS_TIME
Numeric,20 bit
WL_SESSION_VALUES
BLOB, very big.
WL_IS_VALID
Char,1 characters
WL_CREATE_TIME
Numeric,20 bit
In the database that maps to the session persistence connection pool, you need to configure a table called WL_SERVLET_ SESSIONS that will contain the values of all active session objects. Specifies that the user who has access to this table requires read / write / insert / delete access to the table to effectively manage objects. The table needs to have the following 8 columns.
WL_ID-- session ID, used with WL_CONTEXT_PATH as the database primary key. Variable width alphanumeric data type, up to 100 characters.
WL_CONTEXT_PATH-- context, this column is used with WL_ID as the primary key. Variable width alphanumeric data type, up to 100 characters.
WL_IS_NEW-- this value is True as long as the Servlet engine classifies the session as "new". A column containing one character.
When the session was originally created by WL_CREATE_TIME--. Numeric data type column, 20 bits.
This value is True when WL_IS_VALID--Servlet can access the session. Used for concurrent access. A column containing one character.
WL_SESSION_VALUES-- actual session data. BLOB column.
Time when WL_ACCESS_TIME-- last accessed the session. Numeric data type column, 20 bits.
The time, in seconds, between the time the WL_MAX_INACTIVE_INTERVAL-- requests from the client and the session expires. A negative time value indicates that the session never times out. Integer data type column.
two。 Create a database and data table that holds the Session
Here we choose to use the MySQL database
Create the weblogic database and create the wl_servlet_ sessions table under weblogic
Create database weblogic;SET FOREIGN_KEY_CHECKS=0;-close the foreign key constraint-Table structure for `wl_servlet_ sessions`-DROP TABLE IF EXISTS `wl_servlet_ sessions` CREATE TABLE `wl_servlet_ sessions` (`wl_ id` varchar (100,100) NOT NULL DEFAULT', `wl_is_ path`varchar (2) DEFAULT NULL, `wl_create_ bigint (20) DEFAULT NULL, `wl_is_ valid`varchar (2) DEFAULT NULL, `wl_session_ values` blob, `wl_access_ time`bigint (20) DEFAULT NULL, `wl_max_inactive_ interval`bigint (20) DEFAULT NULL, PRIMARY KEY (`wl_ id`, `wl_context_ path`) ENGINE=InnoDB DEFAULT CHARSET=utf8 3. Create a database connection account
Create a weblogic user and grant all permissions to all tables in the weblogic database. The account password is weblogic. The account can connect to the server from any host.
Grant all on weblogic.* to 'weblogic'@'%' identified by' weblogic';4. Configure weblogic cluster server
As shown in the figure below, managed servers app1 and app2 belong to the same cluster. For the cluster configuration of load balancer, please refer to the previous article.
5. Configure JDBC data sources
6. Configure the weblogic.xml file jdbc MYSQL wl_servlet_sessions 7. 0 for the web project. Access after the deployment project is started
8. View the database for verification
Let's take a look at the database and write the Session information to the database so that we can share the Session.
On how to configure Session sharing in WebLogic through the database to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.