-
公共服务服务器搭建配置
1.
网络拓扑
1.1
逻辑拓扑
说明:
两个
apache
做
HA
,
每个
apache
下
连接
4
个东方通。
每台服务器配置
p>
1
个
apache
,
2
个
tongweb
。
172.24.186.82
为
apache
的
MASTER
,<
/p>
172.24.186.83
为
BACK
UP
。虚拟
IP
地址
< br>为
:
图
1
1.2
工作原理
通过
apache
实现对东方通负载均衡,
需要在
apache
下安装可以
调用东方通的
JK
插件,并且以创建
AJP
通道方式实现负载均衡。
Apache
之间的
< br>HA
(高可用)通过
tongweb
下的
nodeagent
代理方式
实现集中管理。
2.
服务器配置
1.3
硬件配置
曙光
I620-G10
CPU
:
2.0*2
内存:
4*4G=16G
1.4
软件配置
操作系统:红旗
asianux3-sp4-x86_64
Apache:2.2.24
此
ap
ache
为源码包
中间件:
TongWeb5.0(
东方通
)
集群版。
JK
插件:
jakarta-
tomcat-connectors-1.2.15
JDK
:
1.6.0_33
3.
安装使用
1.5
安装目录设定
安装主目录:
/home/
东方通安装目录:
tongweb1
为
/home/tongwebone/
tongweb2
为
/home/tongwebtwo/
Apa
che
安装目录
/home/tongweb/apache/
JDK
安装目录
/home/tong
web/jdk
安装文件存放目录:
/home/tongw
eb/software/
部署的程序目录
/home/to
ngweb/webpage/
1.6
安装前准备
建立两个帐户分别为:<
/p>
tongwebone,tongwebtwo;
并设置密码
p>
以建立的帐户登陆,
安装
JDK
到指定的目录,
修改家目录下的环
境变量以让
tongweb
可以识别
JDK
,具体修改家目录下
.base_profil
e.
加入下列字段:
JAVA_HO
ME=/home/tongwebone/jdk1.6.0_33(tongwebtwo
< br>也要安装
)
PATH=$$PATH:$$HOME/bin:$$JAVA_HOME/bin
1.7
安装
TongWeb5.0
安装到指
定目录即可,具体安装过程请参照
TongWeb5.0.
用户
使
用手册,安装
TongWebtwo
时修改端口号,在
TongWebone
的基础上
加
1
,如
TongWebo
ne
为
8080
即
TongWebtwo
为
8081
。依此类推
1.8
安装
Apache(
需两台服务器部署
)
1. apache
的下载网址
/
p>
,下载
;
2.
安装
Apache
,
tar -zxvf
;
3.
到
httpd-2.2.15
p>
目
录
下
,
运
行
./configure
--prefix=/home/apache/apache
--enable-modules=most --enable-mods-
shared=all --enable-so
其中
/
p>
home/apache
/
是
apache
的
安装目录
4.
httpd-2.2.15
目录:
make
5.
httpd-2.2.15
目录:
make install
1.9
安
装
AJP
插件
(
需两台服务器部署
)
tar xzvf
;
cd jakarta-
tomcat-connectors-1.2.15-src/jk/native
chmod 755
./
./configure --with-
apxs=/home/apache/bin/apxs #
这里指定的是
apache
安装目录中
apxs
的位置
make
make
install
查看是否有
mod
_
文件,在
/home/apache/modules
目录下
1.10
配置
AJP
插件
(
需两台服务器部署
)
?
在
下创建
mod
_
文件和
ties
文件。具体内容
p>
如下:
Mod_
文件
LoadModulejk_module modules/mod_
JkWorkersFile
JkLogFile
JkLogLevel info
JkLogStampFormat
JkOptions
+ForwardKeySize +ForwardURICompat
-ForwardDirectories
JkRequestLogFormat
JkMount /ggfw/* loadbalancer
JkMount /status mystatus
ties
文件如下:
=loadbalancer
=ajp13
=172.24.186.82
=7400
or=1
_keepalive=1
_timeout=300
ct=server3
=ajp13
=172.24.186.82
=7401
or=1
_keepalive=1
_timeout=300
ct=server4
=ajp13
=172.24.186.83
=7400
or=1
_keepalive=1
_timeout=300
ct=server1
=ajp13
=172.24.186.83
=7401
or=1
_keepalive=1
_timeout=300
ct=server4
=lb
e_
workers=server1,server2,server3,server4
_session=false
_session_force=true
=mystatus
=status
?
p>
修改
/home/apache/conf/
文件,在最后一行增加如下内容:
Include
conf/mod_
这两个文件可
以实现
apache
调用
TongWe
b
。并且可以实现负载
均衡。