1、启动mgt结点的tomcat服务:

[root@mgt zmq]# /home/geohpc/softwares/apache-tomcat-7.0.34/bin/startup.sh

关闭为

[root@mgt zmq]# /home/geohpc/softwares/apache-tomcat-7.0.34/bin/shutdown.sh

 

2、正在每个结点启动/home/geohpc/bin/webservice.sh脚本:

#!/bin/bash

mapscapeservice='netstat -an | grep LISTEN | grep :9527'
if [ "$mapscapeservice" == "" ];then
        echo "mapScapeService is not running"
else

        tomcat='netstat -an | grep LISTEN | grep :8080'
        tomcat_bin_path='/home/geohpc/softwares/apache-tomcat-7.0.34/bin'
        if [ "$tomcat" != "" ];then
                "$tomcat_bin_path/shutdown.sh"
        fi
        "$tomcat_bin_path/startup.sh"
fi

以node05为例结果如下:

[root@node05 ~]# /home/geohpc/bin/webservice.sh
Using CATALINA_BASE:   /home/geohpc/softwares/apache-tomcat-7.0.34
Using CATALINA_HOME:   /home/geohpc/softwares/apache-tomcat-7.0.34
Using CATALINA_TMPDIR: /home/geohpc/softwares/apache-tomcat-7.0.34/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/geohpc/softwares/apache-tomcat-7.0.34/bin/bootstrap.jar:/home/geohpc/softwares/apache-tomcat-7.0.34/bin/tomcat-juli.jar
Dec 11, 2013 6:29:14 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
        at java.net.Socket.connect(Socket.java:546)
        at java.net.Socket.connect(Socket.java:495)
        at java.net.Socket.<init>(Socket.java:392)
        at java.net.Socket.<init>(Socket.java:206)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:499)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:453)
Using CATALINA_BASE:   /home/geohpc/softwares/apache-tomcat-7.0.34
Using CATALINA_HOME:   /home/geohpc/softwares/apache-tomcat-7.0.34
Using CATALINA_TMPDIR: /home/geohpc/softwares/apache-tomcat-7.0.34/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/geohpc/softwares/apache-tomcat-7.0.34/bin/bootstrap.jar:/home/geohpc/softwares/apache-tomcat-7.0.34/bin/tomcat-juli.jar

查看tomcat是否启动(8080端口是否被监听):

[root@node05 ~]# lsof -i:8080
COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
java    14240 root   40u  IPv6 2316043      0t0  TCP *:webcache (LISTEN)

3、测试,访问http://192.168.253.110:8080/GdosMapService/gdos.html,可看到一个后台由集群支持,C++实现/Java封装的,前端由openlayer展现的WMS地图服务(支持矢量查询):

后端集群各个节点收到的绘图请求(webcache,其实为tomcat的8080端口):

node01、02、03有三个正在运行的绘图作业,各个节点分别有7个左右的已完成绘图作业,绘图任务分发状态与集群权重设置相符(wrr为加权轮询策略,Weighted Round-Robin)。

关于LVS的任务调度算法,可参见此文档

posted on 2013-12-11 17:16  yeahgis  阅读(1158)  评论(0编辑  收藏  举报