1. 首页 > WebSphere教程 > 正文

WebSphere教程FG002-WebSphere 9.0.5安装与环境配置实战

本文档风哥主要介绍WebSphere Application Server 9.0.5安装前的环境准备工作,包括安装概述、安装方式介绍、系统要求、操作系统配置、内核参数调优、用户与目录设置、Java环境配置等内容,风哥教程参考WebSphere官方文档安装配置章节,适合WebSphere管理员在学习和测试中使用,如果要应用于生产环境则需要自行确认。更多视频教程www.fgedu.net.cn

Part01-基础概念与理论知识

1.1 WebSphere安装概述

IBM WebSphere Application Server 9.0.5的安装过程需要经过周密的规划和准备。安装前需要确认硬件资源、操作系统版本、网络配置、存储空间等基础条件,同时需要配置操作系统内核参数、创建专用用户、设置环境变量等。学习交流加群风哥微信: itpux-com

WebSphere安装的主要步骤:

  • 安装前环境检查和准备
  • 安装IBM Installation Manager
  • 使用Installation Manager安装WebSphere
  • 创建概要文件(Profile)
  • 安装后配置和验证
  • 安装补丁和更新

1.2 WebSphere安装方式介绍

WebSphere 9.0.5支持多种安装方式:

1.2.1 图形界面安装

  • 适用场景:首次安装、学习测试环境、有图形界面的系统
  • 优点:操作直观、配置选项清晰、适合初学者
  • 缺点:需要图形环境、不适合批量部署

1.2.2 命令行静默安装

  • 适用场景:生产环境、批量部署、无图形界面的服务器
  • 优点:可自动化、可重复执行、适合脚本化部署
  • 缺点:需要准备响应文件、配置较复杂

1.2.3 响应文件安装

# WebSphere响应文件安装示例

响应文件(response.xml)结构:
<?xml version=”1.0″ encoding=”UTF-8″?>
<agent-input>
<variables>
<variable name=’sharedLocation’ value=’/WebSphere/IBM/IMShared’/>
</variables>
<server>
<repository location=’/media/WAS’/>
</server>
<profile id=’IBM WebSphere Application Server’ installLocation=’/WebSphere/app’>
<data key=’user.select.64bit,com.ibm.websphere.BASE.v90′ value=’true’/>
<data key=’cic.selector.nl’ value=’zh’/>
</profile>
</agent-input>

# 使用响应文件安装
./install -input response.xml -log install.log

1.3 WebSphere安装系统要求

WebSphere 9.0.5对系统环境有明确的要求:

1.3.1 操作系统要求

# WebSphere 9.0.5支持的操作系统

Linux平台:
– Red Hat Enterprise Linux 7.x/8.x/9.x
– Oracle Linux 7.x/8.x/9.x
– SUSE Linux Enterprise Server 12/15
– Ubuntu 18.04/20.04/22.04 LTS

UNIX平台:
– IBM AIX 7.1/7.2/7.3
– Oracle Solaris 10/11

Windows平台:
– Windows Server 2016/2019/2022
– Windows 10/11(仅开发测试)

# 查看操作系统版本
cat /etc/os-release

NAME=”Oracle Linux Server”
VERSION=”9.3″
ID=”ol”
ID_LIKE=”fedora”
VARIANT=”Server”
VARIANT_ID=”server”
VERSION_ID=”9.3″
PLATFORM_ID=”platform:el9″
PRETTY_NAME=”Oracle Linux Server 9.3″

1.3.2 硬件要求

# WebSphere硬件要求

最小配置:
– CPU:2核
– 内存:4GB
– 磁盘:10GB

推荐配置(生产环境):
– CPU:8核以上
– 内存:16GB以上
– 磁盘:50GB以上

# 检查CPU信息
lscpu | grep -E ‘CPU\(s\)|Model name’

CPU(s): 16
Model name: Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz

# 检查内存信息
free -h

total used free shared buff/cache available
Mem: 62Gi 8.2Gi 48Gi 1.1Gi 6.5Gi 52Gi
Swap: 8.0Gi 0B 8.0Gi

# 检查磁盘空间
df -h /WebSphere

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/datavg-lv_data 500G 20G 480G 4% /WebSphere

1.4 WebSphere安装组件说明

WebSphere 9.0.5安装包含以下主要组件:

1.4.1 核心组件

  • IBM WebSphere Application Server:应用服务器核心运行时
  • IBM SDK Java:IBM提供的Java运行时环境
  • IBM HTTP Server:IBM提供的Web服务器(可选)
  • Web Server Plug-ins:Web服务器插件(可选)

1.4.2 版本类型

# WebSphere版本类型

Base版本(基础版):
– 单服务器部署
– 适合开发测试环境
– 不支持集群功能

Network Deployment版本(ND版):
– 支持集群部署
– 支持部署管理器
– 支持高可用功能
– 适合生产环境

# 查看已安装版本
/WebSphere/app/bin/versionInfo.sh

WVER0010I: Copyright (c) IBM Corporation 2002, 2024; All rights reserved.
WVER0012I: VersionInfo reporter version 1.15.1.48, dated 2/8/24

——————————————————————————–
IBM WebSphere Application Server Product Installation Status Report
——————————————————————————–

Report at date and time April 10, 2026 10:00:00 AM CST

Installation
——————————————————————————–
Product Directory /WebSphere/app
Version Directory /WebSphere/app/properties/version
DFT Directory /WebSphere/app/properties/version/DFT
Installation Type Product
Installation Date 2026-04-10 10:00:00

Product List
——————————————————————————–
BASE 9.0.5.15

风哥提示:生产环境建议安装Network Deployment版本,以便后续支持集群部署和高可用配置。Base版本适合单机部署和开发测试环境。

Part02-生产环境规划与建议

2.1 WebSphere安装前规划

在安装WebSphere之前,需要进行详细的规划:

2.1.1 安装规划清单

# WebSphere安装规划清单

1. 确定安装版本
– Base版本还是ND版本
– 需要安装的补丁版本

2. 确定安装路径
– 安装目录:/WebSphere/app
– 共享目录:/WebSphere/IBM/IMShared
– 数据目录:/WebSphere/fgdata

3. 确定网络配置
– 主机名:fgedu.net.cn
– IP地址:192.168.1.100
– 端口规划:9060、9080、9443等

4. 确定用户和权限
– 安装用户:websphere
– 用户组:websphere
– 目录权限:755

5. 确定Java版本
– IBM SDK 8
– 或使用系统已安装的JDK

2.2 WebSphere硬件资源规划

根据应用规模合理规划硬件资源:

2.2.1 CPU规划

# CPU规划建议

开发测试环境:
– 最小:2核
– 推荐:4核

小型生产环境:
– 最小:4核
– 推荐:8核

中型生产环境:
– 最小:8核
– 推荐:16核

大型生产环境:
– 最小:16核
– 推荐:32核或更多

# 查看CPU核心数
nproc

16

# 查看CPU详细信息
lscpu

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
CPU(s): 16
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz

2.2.2 内存规划

# 内存规划建议

开发测试环境:
– 最小:4GB
– 推荐:8GB

小型生产环境:
– 最小:16GB
– 推荐:32GB

中型生产环境:
– 最小:32GB
– 推荐:64GB

大型生产环境:
– 最小:64GB
– 推荐:128GB或更多

# JVM堆内存规划原则
– 堆内存不超过物理内存的50%
– 预留内存给操作系统和其他进程
– 例如:64GB物理内存,JVM堆内存建议32GB

# 查看内存信息
cat /proc/meminfo | head -10

MemTotal: 65893396 kB
MemFree: 50331648 kB
MemAvailable: 54525952 kB
Buffers: 524288 kB
Cached: 4194304 kB
SwapCached: 0 kB
Active: 8388608 kB
Inactive: 2097152 kB
Active(anon): 6291456 kB
Inactive(anon): 1048576 kB

2.3 WebSphere网络规划

WebSphere网络规划需要考虑端口分配和主机名配置:

2.3.1 端口规划

# WebSphere默认端口规划

管理端口:
– 管理控制台HTTP:9060
– 管理控制台HTTPS:9043
– SOAP连接器:8880
– RMI连接器:2809
– IPC连接器:9632

应用端口:
– HTTP端口:9080
– HTTPS端口:9443
– 虚拟主机:根据应用配置

集群端口:
– DRS客户端:9402
– DRS服务端:9403
– SIB端点:7276、7286、5558、5578

# 检查端口占用
netstat -tlnp | grep -E ‘9060|9080|9443|8880’

# 如果端口被占用,可以修改默认端口
# 在创建Profile时指定端口

2.3.2 主机名配置

# 主机名配置要求

1. 设置主机名
hostnamectl set-hostname fgedu.net.cn

# 验证主机名
hostname

fgedu.net.cn

2. 配置hosts文件
vi /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.100 fgedu.net.cn fgedu
192.168.1.101 fgedu02.net.cn fgedu02
192.168.1.102 fgedu03.net.cn fgedu03

3. 验证主机名解析
ping -c 2 fgedu.net.cn

PING fgedu.net.cn (192.168.1.100) 56(84) bytes of data.
64 bytes from fgedu.net.cn (192.168.1.100): icmp_seq=1 ttl=64 time=0.021 ms
64 bytes from fgedu.net.cn (192.168.1.100): icmp_seq=2 ttl=64 time=0.032 ms
— fgedu.net.cn ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.021/0.026/0.032/0.007 ms

# 重要提示:主机名必须能正确解析
# 否则WebSphere启动会失败

2.4 WebSphere存储规划

WebSphere存储规划需要考虑安装目录、日志目录、数据目录等:

2.4.1 目录规划

# WebSphere目录规划

安装目录:
– WAS_HOME=/WebSphere/app
– 大小:20GB以上
– 用途:WebSphere程序文件

共享目录:
– IMShared=/WebSphere/IBM/IMShared
– 大小:10GB以上
– 用途:Installation Manager共享文件

概要文件目录:
– PROFILE_HOME=/WebSphere/app/profiles
– 大小:根据应用规模
– 用途:服务器配置和应用

日志目录:
– LOG_DIR=/WebSphere/logs
– 大小:50GB以上
– 用途:运行日志、诊断日志

数据目录:
– DATA_DIR=/WebSphere/fgdata
– 大小:根据应用规模
– 用途:应用数据、临时文件

备份目录:
– BACKUP_DIR=/WebSphere/backup
– 大小:根据备份策略
– 用途:配置备份、应用备份

# 查看磁盘空间
df -h

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-lv_root 200G 15G 185G 8% /
/dev/mapper/datavg-lv_data 500G 20G 480G 4% /WebSphere

Part03-生产环境项目实施方案

3.1 WebSphere操作系统配置

在安装WebSphere之前,需要对操作系统进行必要的配置:

3.1.1 检查操作系统版本

# 检查操作系统版本
cat /etc/os-release

NAME=”Oracle Linux Server”
VERSION=”9.3″
ID=”ol”
ID_LIKE=”fedora”
VARIANT=”Server”
VARIANT_ID=”server”
VERSION_ID=”9.3″
PLATFORM_ID=”platform:el9″
PRETTY_NAME=”Oracle Linux Server 9.3″

# 检查内核版本
uname -r

5.15.0-101.103.2.1.el9uek.x86_64

# 检查系统架构
uname -m

x86_64

# 检查系统位数
getconf LONG_BIT

64

3.1.2 安装必要软件包

# 安装必要的软件包

# 检查已安装的软件包
rpm -qa | grep -E ‘glibc|libaio|unzip|tar|gzip’

glibc-2.34-83.0.1.el9.x86_64
glibc-common-2.34-83.0.1.el9.x86_64
libaio-0.3.111-13.el9.x86_64
unzip-6.0-56.el9.x86_64
tar-1.34-6.el9.x86_64
gzip-1.12-1.el9.x86_64

# 如果缺少软件包,使用yum安装
yum install -y glibc libaio unzip tar gzip

# 对于AIX系统,使用installp安装
# installp -aY -d /dev/cd0 bos.adt.lib bos.adt.libm

# 检查libstdc++库
rpm -qa | grep libstdc++

libstdc++-11.4.1-2.1.el9.x86_64

3.2 WebSphere内核参数调优

WebSphere生产环境需要优化操作系统内核参数:

3.2.1 配置内核参数

# 编辑内核参数配置文件
vi /etc/sysctl.conf

# WebSphere内核参数优化配置

# 文件描述符限制
fs.file-max = 6815744

# 共享内存设置
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096

# 信号量设置
kernel.sem = 250 32000 100 128

# 网络参数优化
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 4194304
net.core.netdev_max_backlog = 30000
net.core.somaxconn = 65535

# TCP参数优化
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1

# 应用内核参数
sysctl -p

fs.file-max = 6815744
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 4194304
net.core.netdev_max_backlog = 30000
net.core.somaxconn = 65535

3.2.2 配置用户限制

# 编辑用户限制配置文件
vi /etc/security/limits.conf

# WebSphere用户限制配置
websphere soft nofile 65536
websphere hard nofile 65536
websphere soft nproc 65536
websphere hard nproc 65536
websphere soft stack 10240
websphere hard stack 32768
websphere soft memlock unlimited
websphere hard memlock unlimited

# 查看当前用户限制
su – websphere
ulimit -a

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63469
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 65536
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

3.2.3 关闭透明大页

# 查看透明大页状态
cat /sys/kernel/mm/transparent_hugepage/enabled

[always] madvise never

# 临时关闭透明大页
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

# 永久关闭透明大页
vi /etc/rc.d/rc.local

# 添加以下内容
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

# 添加执行权限
chmod +x /etc/rc.d/rc.local

# 验证透明大页已关闭
cat /sys/kernel/mm/transparent_hugepage/enabled

always madvise [never]

3.3 WebSphere用户与目录设置

WebSphere安装需要创建专用用户和目录:

3.3.1 创建WebSphere用户

# 创建WebSphere用户组
groupadd -g 1000 websphere

# 创建WebSphere用户
useradd -u 1000 -g websphere -d /home/websphere -s /bin/bash -c “WebSphere Admin User” websphere

# 设置用户密码
passwd websphere

Changing password for user websphere.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

# 验证用户创建
id websphere

uid=1000(websphere) gid=1000(websphere) groups=1000(websphere)

# 切换到WebSphere用户
su – websphere

$ whoami
websphere

3.3.2 创建WebSphere目录

# 创建WebSphere安装目录
mkdir -p /WebSphere/app
mkdir -p /WebSphere/IBM/IMShared
mkdir -p /WebSphere/fgdata
mkdir -p /WebSphere/logs
mkdir -p /WebSphere/backup
mkdir -p /WebSphere/scripts

# 设置目录权限
chown -R websphere:websphere /WebSphere
chmod -R 755 /WebSphere

# 验证目录创建
ls -la /WebSphere/

total 0
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 app
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 backup
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 fgdata
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 logs
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 scripts

# 创建IBM目录
mkdir -p /WebSphere/IBM
chown -R websphere:websphere /WebSphere/IBM

3.3.3 配置用户环境变量

# 配置用户环境变量
vi /home/websphere/.bash_profile

# WebSphere环境变量
export WAS_HOME=/WebSphere/app
export JAVA_HOME=/WebSphere/app/java/8.0
export PATH=$WAS_HOME/bin:$JAVA_HOME/bin:$PATH
export WAS_LOG=/WebSphere/logs

# 使环境变量生效
source /home/websphere/.bash_profile

# 验证环境变量
echo $WAS_HOME

/WebSphere/app

echo $JAVA_HOME

/WebSphere/app/java/8.0

3.4 WebSphere Java环境配置

WebSphere自带IBM SDK,也可以使用系统已安装的Java:

3.4.1 检查系统Java环境

# 检查系统是否已安装Java
which java

/usr/bin/java

# 查看Java版本
java -version

java version “1.8.0_401”
Java(TM) SE Runtime Environment (build 1.8.0_401-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.401-b10, mixed mode)

# 查看Java安装路径
readlink -f $(which java)

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.401.b10-1.el9.x86_64/jre/bin/java

# 检查JAVA_HOME环境变量
echo $JAVA_HOME

/WebSphere/app/java/8.0

3.4.2 配置Java环境(可选)

# 如果需要使用系统Java,配置JAVA_HOME

# 查找Java安装路径
find /usr -name “java” -type f 2>/dev/null

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.401.b10-1.el9.x86_64/jre/bin/java

# 设置JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.401.b10-1.el9.x86_64

# 添加到环境变量配置文件
vi /home/websphere/.bash_profile

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.401.b10-1.el9.x86_64
export PATH=$JAVA_HOME/bin:$PATH

# 注意:WebSphere安装时会自带IBM SDK
# 通常不需要单独配置Java环境

风哥提示:WebSphere安装包中包含IBM SDK,建议使用自带的IBM SDK,以确保兼容性和性能优化。如果使用系统Java,需要确保版本兼容。学习交流加群风哥QQ113257174

Part04-生产案例与实战讲解

4.1 WebSphere安装前检查脚本

使用脚本自动检查安装环境:

#!/bin/bash
# websphere_prereq_check.sh
# from:www.itpux.com.qq113257174.wx:itpux-com
# web: http://www.fgedu.net.cn

# WebSphere安装前环境检查脚本

echo “==========================================”
echo ” WebSphere 9.0.5 安装前环境检查”
echo “==========================================”
echo “”

# 检查操作系统
echo “1. 操作系统检查”
echo “—————————————-”
cat /etc/os-release | grep -E ‘NAME|VERSION’
echo “”

# 检查内核版本
echo “2. 内核版本检查”
echo “—————————————-”
uname -r
echo “”

# 检查系统架构
echo “3. 系统架构检查”
echo “—————————————-”
uname -m
echo “”

# 检查CPU信息
echo “4. CPU信息检查”
echo “—————————————-”
lscpu | grep -E ‘CPU\(s\)|Model name|Thread|Core’
echo “”

# 检查内存信息
echo “5. 内存信息检查”
echo “—————————————-”
free -h
echo “”

# 检查磁盘空间
echo “6. 磁盘空间检查”
echo “—————————————-”
df -h / /WebSphere 2>/dev/null || df -h /
echo “”

# 检查主机名
echo “7. 主机名检查”
echo “—————————————-”
hostname
echo “”

# 检查hosts文件
echo “8. Hosts文件检查”
echo “—————————————-”
cat /etc/hosts | grep -v “^#” | grep -v “^$”
echo “”

# 检查必要软件包
echo “9. 必要软件包检查”
echo “—————————————-”
rpm -qa | grep -E ‘glibc|libaio|unzip|tar|gzip’ | head -10
echo “”

# 检查端口占用
echo “10. 端口占用检查”
echo “—————————————-”
netstat -tlnp 2>/dev/null | grep -E ‘9060|9080|9443|8880’ || echo “WebSphere默认端口未被占用”
echo “”

# 检查防火墙状态
echo “11. 防火墙状态检查”
echo “—————————————-”
systemctl status firewalld 2>/dev/null | grep -E ‘Active|Loaded’ || echo “防火墙服务未安装”
echo “”

# 检查用户
echo “12. WebSphere用户检查”
echo “—————————————-”
id websphere 2>/dev/null || echo “websphere用户不存在”
echo “”

# 检查目录
echo “13. WebSphere目录检查”
echo “—————————————-”
ls -la /WebSphere 2>/dev/null || echo “/WebSphere目录不存在”
echo “”

# 检查内核参数
echo “14. 内核参数检查”
echo “—————————————-”
sysctl -a 2>/dev/null | grep -E ‘fs.file-max|kernel.shmmax|kernel.sem’ | head -5
echo “”

# 检查用户限制
echo “15. 用户限制检查”
echo “—————————————-”
ulimit -a 2>/dev/null | head -10
echo “”

echo “==========================================”
echo ” 环境检查完成”
echo “==========================================”

4.1.2 执行检查脚本

# 执行检查脚本
chmod +x websphere_prereq_check.sh
./websphere_prereq_check.sh

==========================================
WebSphere 9.0.5 安装前环境检查
==========================================

1. 操作系统检查
—————————————-
NAME=”Oracle Linux Server”
VERSION=”9.3″

2. 内核版本检查
—————————————-
5.15.0-101.103.2.1.el9uek.x86_64

3. 系统架构检查
—————————————-
x86_64

4. CPU信息检查
—————————————-
CPU(s): 16
Thread(s) per core: 2
Core(s) per socket: 8
Model name: Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz

5. 内存信息检查
—————————————-
total used free shared buff/cache available
Mem: 62Gi 8.2Gi 48Gi 1.1Gi 6.5Gi 52Gi
Swap: 8.0Gi 0B 8.0Gi

6. 磁盘空间检查
—————————————-
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-lv_root 200G 15G 185G 8% /
/dev/mapper/datavg-lv_data 500G 20G 480G 4% /WebSphere

7. 主机名检查
—————————————-
fgedu.net.cn

8. Hosts文件检查
—————————————-
127.0.0.1 localhost localhost.localdomain
192.168.1.100 fgedu.net.cn fgedu

9. 必要软件包检查
—————————————-
glibc-2.34-83.0.1.el9.x86_64
glibc-common-2.34-83.0.1.el9.x86_64
libaio-0.3.111-13.el9.x86_64
unzip-6.0-56.el9.x86_64
tar-1.34-6.el9.x86_64
gzip-1.12-1.el9.x86_64

10. 端口占用检查
—————————————-
WebSphere默认端口未被占用

11. 防火墙状态检查
—————————————-
Active: active (running)

12. WebSphere用户检查
—————————————-
uid=1000(websphere) gid=1000(websphere) groups=1000(websphere)

13. WebSphere目录检查
—————————————-
total 0
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 app
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 backup
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 fgdata
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 logs
drwxr-xr-x. 2 websphere websphere 6 Apr 10 10:30 scripts

14. 内核参数检查
—————————————-
fs.file-max = 6815744
kernel.shmmax = 68719476736
kernel.sem = 250 32000 100 128

15. 用户限制检查
—————————————-
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63469
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 65536

==========================================
环境检查完成
==========================================

4.2 WebSphere环境验证实战

验证WebSphere安装环境是否满足要求:

4.2.1 验证操作系统兼容性

# 验证操作系统是否在支持列表中
cat /etc/os-release | grep -E ‘NAME|VERSION_ID’

NAME=”Oracle Linux Server”
VERSION_ID=”9.3″

# Oracle Linux 9.3在WebSphere 9.0.5支持列表中
# 如果操作系统不在支持列表,需要查阅IBM官方兼容性矩阵

# 验证内核版本
uname -r

5.15.0-101.103.2.1.el9uek.x86_64

# 内核版本需要满足最低要求

4.2.2 验证硬件资源

# 验证CPU资源
echo “CPU核心数: $(nproc)”

CPU核心数: 16

# 验证内存资源
echo “总内存: $(free -h | awk ‘/^Mem:/{print $2}’)”

总内存: 62Gi

# 验证磁盘空间
echo “根分区可用空间: $(df -h / | awk ‘NR==2{print $4}’)”

根分区可用空间: 185G

echo “WebSphere分区可用空间: $(df -h /WebSphere 2>/dev/null | awk ‘NR==2{print $4}’)”

WebSphere分区可用空间: 480G

# 硬件资源验证结果
# CPU: 16核 ✓
# 内存: 62GB ✓
# 磁盘: 480GB可用 ✓

4.2.3 验证网络配置

# 验证主机名解析
ping -c 2 $(hostname)

PING fgedu.net.cn (192.168.1.100) 56(84) bytes of data.
64 bytes from fgedu.net.cn (192.168.1.100): icmp_seq=1 ttl=64 time=0.021 ms
64 bytes from fgedu.net.cn (192.168.1.100): icmp_seq=2 ttl=64 time=0.032 ms
— fgedu.net.cn ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1001ms

# 验证端口可用性
for port in 9060 9080 9443 8880 2809; do
if netstat -tlnp 2>/dev/null | grep -q “:$port “; then
echo “端口 $port 已被占用”
else
echo “端口 $port 可用”
fi
done

端口 9060 可用
端口 9080 可用
端口 9443 可用
端口 8880 可用
端口 2809 可用

# 验证防火墙配置
firewall-cmd –list-ports 2>/dev/null || echo “防火墙未配置”

9060/tcp 9043/tcp 9080/tcp 9443/tcp 8880/tcp 2809/tcp

4.3 WebSphere安装介质准备

准备WebSphere安装介质:

4.3.1 下载安装介质

# WebSphere安装介质通常包括:

1. IBM Installation Manager
– 文件名:agent.installer.linux.gtk.x86_64_*.zip
– 用途:安装管理器

2. WebSphere Application Server
– 文件名:WAS_ND_V9.0.5_*.zip(ND版本)
– 或:WAS_V9.0.5_*.zip(Base版本)
– 用途:应用服务器

3. IBM SDK Java
– 通常包含在WebSphere安装包中
– 或单独下载:IBM_SDK_Java*.zip

4. 补丁包(可选)
– 文件名:9.0.5.*-WS-WAS-*.zip
– 用途:更新补丁

# 创建安装介质目录
mkdir -p /WebSphere/media
chown websphere:websphere /WebSphere/media

# 上传安装介质到服务器
# 使用scp、ftp或其他方式上传

# 验证安装介质
ls -lh /WebSphere/media/

total 4.5G
-rw-r–r–. 1 websphere websphere 500M Apr 10 10:00 agent.installer.linux.gtk.x86_64_1.9.0.zip
-rw-r–r–. 1 websphere websphere 4.0G Apr 10 10:00 WAS_ND_V9.0.5_Linux_x86_64.zip

4.3.2 解压安装介质

# 切换到websphere用户
su – websphere

# 解压Installation Manager
cd /WebSphere/media
unzip -q agent.installer.linux.gtk.x86_64_1.9.0.zip -d IM

# 查看解压结果
ls -la IM/

total 16
drwxr-xr-x. 2 websphere websphere 4096 Apr 10 10:05 .
drwxr-xr-x. 3 websphere websphere 54 Apr 10 10:05 ..
-rwxr-xr-x. 1 websphere websphere 1234 Apr 10 10:05 install
-rwxr-xr-x. 1 websphere websphere 5678 Apr 10 10:05 userinst
-rw-r–r–. 1 websphere websphere 9012 Apr 10 10:05 repository.xml

# 解压WebSphere安装包
unzip -q WAS_ND_V9.0.5_Linux_x86_64.zip -d WAS

# 查看解压结果
ls -la WAS/

total 8
drwxr-xr-x. 2 websphere websphere 4096 Apr 10 10:05 .
drwxr-xr-x. 3 websphere websphere 54 Apr 10 10:05 ..
-rw-r–r–. 1 websphere websphere 1234 Apr 10 10:05 repository.xml
drwxr-xr-x. 3 websphere websphere 4096 Apr 10 10:05 was

风哥提示:安装介质需要从IBM官方渠道获取,确保下载的版本与操作系统兼容。解压后检查文件完整性,避免安装过程中出现错误。更多学习教程公众号风哥教程itpux_com

Part05-风哥经验总结与分享

5.1 WebSphere安装检查清单

WebSphere安装前检查清单:

# WebSphere安装前检查清单

□ 操作系统检查
□ 操作系统版本在支持列表中
□ 内核版本满足要求
□ 系统架构为64位

□ 硬件资源检查
□ CPU核心数满足要求
□ 内存大小满足要求
□ 磁盘空间充足

□ 网络配置检查
□ 主机名已正确设置
□ hosts文件已正确配置
□ 主机名可以正确解析
□ WebSphere端口未被占用

□ 用户和权限检查
□ websphere用户已创建
□ 用户目录权限正确
□ 安装目录权限正确

□ 内核参数检查
□ 文件描述符限制已配置
□ 共享内存参数已配置
□ 用户限制已配置

□ 软件依赖检查
□ 必要的软件包已安装
□ Java环境已配置(可选)

□ 安装介质检查
□ Installation Manager已准备
□ WebSphere安装包已准备
□ 安装介质已解压

□ 防火墙配置检查
□ WebSphere端口已开放
□ 防火墙规则已配置

5.2 WebSphere安装常见问题

WebSphere安装过程中常见的问题及解决方案:

5.2.1 主机名解析问题

# 问题现象:安装或启动时报主机名解析错误

# 解决方案:
# 1. 检查主机名
hostname

# 2. 配置hosts文件
vi /etc/hosts

127.0.0.1 localhost
192.168.1.100 fgedu.net.cn fgedu

# 3. 验证解析
ping $(hostname)

# 4. 确保主机名不是localhost
hostnamectl set-hostname fgedu.net.cn

5.2.2 端口占用问题

# 问题现象:安装时报端口被占用

# 解决方案:
# 1. 检查端口占用
netstat -tlnp | grep -E ‘9060|9080|9443’

# 2. 停止占用端口的服务
systemctl stop httpd

# 3. 或者在创建Profile时指定不同端口
# 使用管理控制台或命令行指定端口

5.2.3 权限问题

# 问题现象:安装时报权限不足

# 解决方案:
# 1. 检查目录权限
ls -la /WebSphere

# 2. 修改目录所有者
chown -R websphere:websphere /WebSphere

# 3. 检查用户权限
id websphere

# 4. 使用正确的用户执行安装
su – websphere

5.3 WebSphere安装最佳实践

基于多年WebSphere运维经验,总结以下安装最佳实践:

5.3.1 安装前准备

  • 环境检查:使用检查脚本全面检查安装环境
  • 介质验证:验证安装介质的完整性和版本
  • 备份配置:备份现有的配置文件和数据
  • 文档记录:记录安装过程中的所有配置参数

5.3.2 安装过程

  • 专用用户:使用专用用户安装和运行WebSphere
  • 标准路径:使用标准化的安装路径
  • 日志记录:保存安装日志以便问题排查
  • 版本选择:生产环境建议使用ND版本

5.3.3 安装后配置

  • 安全配置:启用管理安全,配置用户认证
  • 参数优化:根据应用特点优化JVM参数
  • 日志配置:配置日志轮转,避免日志文件过大
  • 备份策略:制定配置备份策略
生产环境建议:WebSphere安装前务必进行充分的环境检查和规划,确保硬件资源、网络配置、用户权限等满足要求。安装过程中记录所有配置参数,便于后续维护和问题排查。from WebSphere视频:www.itpux.com

本文档详细介绍了WebSphere 9.0.5安装前的环境准备工作,包括安装概述、系统要求、操作系统配置、内核参数调优、用户与目录设置、Java环境配置等内容。通过学习本文档,读者可以全面了解WebSphere安装前的准备工作,为后续的安装配置打下坚实基础。更多视频教程www.fgedu.net.cn

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息