Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of creating websphere Cluster

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the method of creating websphere cluster". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the method of creating websphere cluster".

The creation profile has been introduced earlier, and here we combine the previously created management node with the managed node to make a cluster.

First go to the bin directory of the management node to start the management node, and then you can enter the management console

. / startManager.sh

Go to other managed nodes to start the node, or you don't have to start, or you can create a cluster, because when we created the profile, we already added the managed node to the management node, and now we start just to facilitate subsequent operations.

. / startNode.sh

Then go to the management console, then server > Cluster > WebSphere Application Server cluster, click New Cluster, and we will fill in the name of the new cluster. We will not check the check box for configuring HTTP session memory to memory replication here. The advantage of selection is that the sessions of all nodes here are shared. If load balancer is configured, the sessions of these nodes will switch seamlessly. If these nodes are all on the same server, it is very convenient to use this option, and it will be troublesome if you are located on multiple different servers. We will not check it here because we will use another way of session management below. After the cluster name is filled in, the following is to add the members of the cluster. All the required nodes have been added and the cluster has been created.

After the cluster is created, we can create the JDBC provider and the data source, and pay attention to selecting the cluster when creating the cluster.

Here we focus on creating a data source to manage the session, the data source name: sessions,JNDI name: jdbc/sessions, the above name can be written casually, preferably easy to identify. The next step is to select the JDBC provider we created earlier. Websphere supports DB2 and Oracle by default. We use Oracle, select Oracle JDBC Driver here, and then complete the next step by filling in the URL of the database connection.

The data source is configured. What is the table structure of the database? refer to the official IBM documentation.

Https://www.ibm.com/support/knowledgecenter/zh/SSAW57_9.0.5/com.ibm.websphere.nd.multiplatform.doc/ae/uprs_rpersistence.html

Https://www.ibm.com/support/knowledgecenter/zh/SSAW57_9.0.5/com.ibm.websphere.nd.multiplatform.doc/ae/tprs_cnfp.html

Https://www.ibm.com/support/knowledgecenter/zh/SSAW57_9.0.5/com.ibm.websphere.nd.multiplatform.doc/ae/tprs_table_creation.html

For Oracle:

CREATE TABLE SESSIONS (ID VARCHAR 128NOT NULL, PROPID VARCHAR 128NOT NULL, APPNAME VARCHAR 128NOT NULL, LISTENERCNT SMALLINT, LASTACCESS INTEGER, CREATIONTIME INTEGER, MAXINACTIVETIME INTEGER, USERNAME VARCHAR, SMALL RAW (2000), MEDIUM LONG RAW, LARGE RAW (1))

If the Web container custom property UseOracleBLOB is set to true, then:

CREATE TABLE SESSIONS (ID VARCHAR 128NOT NULL, PROPID VARCHAR 128NOT NULL, APPNAME VARCHAR 128NOT NULL, LISTENERCNT SMALLINT, LASTACCESS INTEGER, CREATIONTIME INTEGER, MAXINACTIVETIME INTEGER, USERNAME VARCHAR, SMALL RAW (2000), MEDIUM BLOB, LARGE RAW (1))

It's just that the type of MEDIUM field is different, so we use the default first way to create a table in the data.

You need to restart nodeagent after creating the data source, otherwise there will be an error connecting to the database. Synchronize the nodes after the application is installed, and then start the application.

Then set the server configuration, server > server type > WebSphere Application Server > server_name > session management > distributed environment settings, click the database directly, and modify the data source JNDI name. This name is the default of the system. It needs to be changed to the jdbc/sessions created above, and the user ID and password, that is, the user name and password of the library where the SESSIONS table resides. Other configurations need not be modified, and then save the configuration. The database is selected to be valid by default. The server_name here is our node. After configuring the servers of all nodes in this way, restart all server, and then it will take effect.

You can install an application, log in to the application through the port of one node, and then open the application on the port of another node to see if the session is also valid, and the database SESSIONS table should already have data.

Note that the management of the application also has a session management > distributed environment setting, which does not need to be set here and has no effect after setting.

After the cluster is created, configure ihs to achieve the load balancing of ihs. First configure the Web server plug-in and use the command line to create it. Please refer to

Https://www.ibm.com/support/knowledgecenter/zh/SSEQTP_9.0.5/com.ibm.websphere.base.doc/ae/tins_pctcl_using.html

You need to configure a response file for the tool argument, which is required when creating a definition.

Let's just create a response file in the WCT directory

Cd / opt/IBM/WebSphere/Toolbox/WCT

There is a pct_responsefile.txt in this directory, which is the template of the response file, but it is under Windows. We need to change a lot, but we can refer to it. There are a lot of comments in it. We create a response file

Vi responsefile.txt

The contents of the file are as follows. The profile here specifies the managed node Custom01, and the specified management node is run to generate configurewebserver1.sh footer. This is not a valid node error. You can see the following subsequent tests.

ConfigType=localenableAdminServerSupport=trueenableUserAndPass=trueihsAdminUserID=adminihsAdminPassword=ihsadminihsAdminPort=8008ihsAdminCreateUserAndGroup=trueihsAdminUnixUserGroup=wasihsAdminUnixUserID=ihsmapWebServerToApplications=truewasExistingLocation=/opt/IBM/WebSphere/AppServer/profileName=Custom01webServerConfigFile1=/opt/IBM/HTTPServer/conf/httpd.confwebServerDefinition=webserver1webServerHostName=localhostwebServerOS=LinuxwebServerInstallArch=64webServerPortNumber=80webServerSelected=ihs

After we have created the response file, we can configure it.

. / wctcmd.sh-tool pct\-createDefinition\-defLocPathname / opt/IBM/WebSphere/Plugins\-defLocName WebServerPlugins\-response / opt/IBM/WebSphere/Toolbox/WCT/responsefile.txt

If the creation fails, check whether there is something wrong with the parameter settings, such as the parameter path, whether the system is Linux, whether the system is version 64, and then modify the response parameters. There may also be some lack of 32-bit class library support. Try downloading the following software

Yum install ld-linux.so.2 libgcc.i686

After successful creation, a configurewebserver1.sh script is generated in the / opt/IBM/WebSphere/Plugins/bin/ directory, because the server name defined by our response file is webserver1.

We copy this script file to the bin directory of the management node

Cp / opt/IBM/WebSphere/Plugins/bin/configurewebserver1.sh / opt/IBM/WebSphere/AppServer/bin/

Then run the script under AppServer/bin/

. / configurewebserver1.sh

Follow-up:

In the configurewebserver1.sh created by the command above, if the specified profile is a management node, the runtime will report that the node is not a valid node, and the one created through the graphical interface, which is also the management node, will not report an error, so we can manually edit the configurewebserver1.sh script ourselves. Compared with the two generated scripts, the only difference is the parameters of the last line, one is unmanaged ihs-node, the other is managed Dmgr01Node It may be that the generated Dmgr01Node name duplicates the existing node name, a Bug of the command line tool.

#! / bin/shbinDir= `dirname "$0" `. "$binDir/setupCmdLine.sh" COMMAND_INVOKED= "$0" PROFILE_NAME_PARAMETER=WSADMIN_USERID_PARAMETER=WSADMIN_PASSWORD_PARAMETER=IHS_ADMIN_PASSWORD_PARAMETER=printUsage () {echo "" echo "" echo "Usage: $COMMAND_INVOKED" echo "[- profileName profile_name]" echo "[- user WAS_Admin_userID]" echo "[- password WAS_Admin_password] "echo" [- ihsAdminPassword IHS_Admin_password] "echo" [- help | -?] " Echo "" echo "Where:" echo "\" profileName\ "is the name of the profile in which" echo "web server should be created" echo "\" user\ "is the WebSphere Administration userID" echo "\" password\ "is the WebSphere Administration password" echo "\" ihsAdminPassword\ "is the password to access the IHS Adminstration server" echo " Echo "Example:" echo "$COMMAND_INVOKED-profileName AppSrv01-user admin-password admin1" echo "echo"exit 0} printError () {echo" ERROR: $1 "printUsage} while [$#-gt 0] Do case $1 in-help | -? PrintUsage exit 0;-profileName) shift echo "Using the profile $1" PROFILE_NAME_PARAMETER= "- profileName $1" -user) shift echo "Using WAS admin userID $1" WSADMIN_USERID_PARAMETER= "- user $1";;-password) shift WSADMIN_PASSWORD_PARAMETER= "- password $1" -ihsAdminPassword) shift IHS_ADMIN_PASSWORD_PARAMETER= "$1";;-*) echo "Unsupported option" echo "$1" printUsage exit 0 Esac shiftdone "$binDir/wsadmin.sh" $PROFILE_NAME_PARAMETER $WSADMIN_USERID_PARAMETER $WSADMIN_PASSWORD_PARAMETER-f $WAS_HOME/bin/configureWebserverDefinition.jacl webserver1 IHS'/ opt/IBM/HTTPServer''/ opt/IBM/HTTPServer/conf/httpd.conf' 80 MAP_ALL'/ opt/IBM/WebSphere/Plugins' unmanaged ihs-node localhost linux 8008 admin ihsadmin

If there are other changes, just compare the parameters in the script above. Add run permissions after creation

Chmod + x configurewebserver1.sh

Then run it under the AppServer/bin/ directory. After running, you will create a separate ihs-node node, which can be seen in the topology diagram.

To start and stop ihs in the administrative console, you need to start the administrative service of ihs

/ opt/IBM/HTTPServer/bin/adminctl start

Note that you are editing the configurewebserver1.sh generated after running the generation script wctcmd.sh. If you do not run the above wctcmd.sh, it is normal to write a configurewebserver1.sh execution directly, but starting the ihs console adminctl start will report an error.

Syntax error on line 7 of / opt/IBM/HTTPServer/conf/admin.conf:Port must be specified

Because you do not run the build script, some environment variables are not set, and variables such as management ports cannot find the correct values.

Note:

If you are using the graphical interface of the Web plug-in management tool, click the menu does not respond, generally Linux server will be this situation, due to the lack of software packages, or 64-bit operating system, lack of support for 32 system packages, you can run wct.sh under the terminal to see what errors, or check the error log

Cat / root/.ibm/WebSphere/workspaces/WCT85/.metadata/.log

Or try to install the package directly.

Yum install libgcc libgcc.i686 ld-linux.so.2 gtk2.i686 PackageKit-gtk3-module PackageKit-gtk3-module.i686

Provide two more commands

# delete server definition. / wctcmd.sh-tool pct-deleteDefinition webserver1-defLocName WebServerPlugins# delete plug-in location definition. / wctcmd.sh-tool pct-removeDefinitionLocation-defLocName WebServerPlugins Thank you for reading. The above is the content of "how to create a websphere cluster". After the study of this article, I believe you have a deeper understanding of the method of creating a websphere cluster, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report