Build và vận hành hệ thống Webadmin, Report, Webservice

Một phần của tài liệu Tài liệu vận hành hệ thống SMS (Trang 39 - 52)

Ứng dụng Webadmib, Report dùng để cấu hình các tham số gateway, Alert hệ thống qua SMS, qua mail cho người quản trị, và Report sản lượng MO, MT, MP theo các tùy biến khác nhau và có kết xuất ra file exel, ứng dụng Webservice để đón MT của đối tác.

 Cấu hình và cài đặt:

o Cài đặt ứng dụng tomcat Tomcat được download tại

#cd /home #wget http://apache.seekmeup.com/tomcat/tomcat- 5/v5.5.26/bin/apache-tomcat-5.5.26.tar.gz Giải nén: #tar -zxcf apache-tomcat-5.5.26.tar.gz Link thư mục #ln –s apache-tomcat-5.5.26 tomcat o Cấu hình

Cấu hình file startup.sh trong thư mục /home/tomcat/bin, thêm biến môi trường JAVA #!/bin/sh os400=false darwin=false case "`uname`" in CYGWIN*) cygwin=true;;

2009 VietNamNet ICOM @ All rights reserved. 40 OS400*) os400=true;;

Darwin*) darwin=true;; esac

export JAVA_HOME=/usr/java/jdk1.6.0_05 # resolve links - $0 may be a softlink

PRG="$0"

while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"`

link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`/"$link" fi done PRGDIR=`dirname "$PRG"` EXECUTABLE=catalina.sh

# Check that target executable exists if $os400; then

# -x will Only work on the os400 if the files are: # 1. owned by the user

# 2. owned by the PRIMARY group of the user

# this will not work if the user belongs in secondary groups eval

2009 VietNamNet ICOM @ All rights reserved. 41 else

if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then echo "Cannot find $PRGDIR/$EXECUTABLE" echo "This file is needed to run this program" exit 1

fi fi

exec "$PRGDIR"/"$EXECUTABLE" start "$@" Add thêm vào file /home/tomcat/bin/catalina.sh:

#vi /home/tomcat/bin/catalina.sh

JAVA_HOME="/usr/java/jdk1.6.0_05 " CATALINA_HOME="/home/tomcat" JAVA_OPTS="-server -Xmx1024m"

Cấu hình file /home/tomcat/conf/server.xml đổi port mặc định là 8080 thành 80 <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->

<Connector port="80" maxHttpHeaderSize="8192"

maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" /> <!-- Note : To disable connection timeouts, set connectionTimeout value Port để shutdown tomcat

<Server port="8005" shutdown="SHUTDOWN">

<!-- Comment these entries out to disable JMX MBeans support used for the administration web application -->

2009 VietNamNet ICOM @ All rights reserved. 42 <Listener className="org.apache.catalina.core.AprLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/> <!-- Global JNDI resources -->

<GlobalNamingResources> Còn các port khác thì disable.

 Cấu hình hệ thống Webadmin và Report:

Toàn bộ WebsAdmin deploy được đặt tại thư mục: /home/tomcat/webapps. Thư mục trang Admin, report có tên là WebsAdmin.

Cấu hình các tham số kết nối đến database tại file /home/tomcat/webapps/webadmin/WEB-INF/database.config

Cấu trúc khai báo một database (dựa vào Pool proxool) #Database jdbc-0.proxool.alias=default jdbc-0.proxool.driver-class=com.mysql.jdbc.Driver jdbc-0.proxool.driver- url=jdbc:mysql://localhost:3306/smsgwttx?useUnicode=true&characterEncoding=utf8 jdbc-0.user=smsgwttx jdbc-0.password=smsgw1122334455 jdbc-0.proxool.house-keeping-sleep-time=60000 jdbc-0.proxool.maximum-connection-count=30 jdbc-0.proxool.minimum-connection-count=5 jdbc-0.proxool.recently-started-threshold=40000

2009 VietNamNet ICOM @ All rights reserved. 43 jdbc-0.proxool.overload-without-refusal-lifetime=50000 jdbc-0.proxool.maximum-active-time=60000 jdbc-0.proxool.prototype-count=4 jdbc-0.proxool.maximum-connection-lifetime=100000 jdbc-0.proxool.fatal-sql-exception=OFF jdbc-0.proxool.prototype-count=2 jdbc-0.proxool.statistics-log-level=ERROR  Cấu hình Webservice:

Toàn bộ WebsAdmin deploy được đặt tại thư mục: /home/tomcat/webapps. Thư mục trang Admin, report có tên là WebsAdmin.

Cấu hình các tham số kết nối đến database tại file /home/tomcat/webapps/wsttx/WEB- INF/database.config #Database jdbc-0.proxool.alias=mt jdbc-0.proxool.driver-class=com.mysql.jdbc.Driver jdbc-0.proxool.driver- url=jdbc:mysql://localhost:3306/smsgwttx?useUnicode=true&characterEncoding=utf8 jdbc-0.user=smsgwttx jdbc-0.password=smsgwttx1122334455 jdbc-0.proxool.maximum-connection-count=40 jdbc-0.proxool.minimum-connection-count=15 jdbc-0.proxool.house-keeping-sleep-time=40000 jdbc-0.proxool.recently-started-threshold=40000 jdbc-0.proxool.overload-without-refusal-lifetime=50000 jdbc-0.proxool.maximum-active-time=60000

2009 VietNamNet ICOM @ All rights reserved. 44 jdbc-0.proxool.maximum-connection-lifetime=100000 jdbc-0.proxool.prototype-count=4 jdbc-0.proxool.house-keeping-test-sql=select current_date jdbc-0.proxool.verbose=true jdbc-0.proxool.trace=true jdbc-0.proxool.statistics-log-level=ERROR

Cấu trúc khai báo một database (dựa vào Pool proxool) tương tự như trang webadmin.  Vận hành hệ thống Tomcat:

Start ứng dụng tomcat:

#/home/tomcat/bin/startup.sh Check ứng dụng tomcat đã chạy chưa

#ps –ef |grep tomcat

#netstat –an |grep 80  phải LISTENNING Stop ứng dụng tomcat:

#/home/tomcat/bin/shutdown.sh Hoặc sử dụng lệnh:

#ps –ef |grep tomcat để xác định pid của tiến trình tomcat rồi sử dụng lệnh kill

#kill -9 pid

#ps –ef |grep tomcat  check lai process

Log tomcat tại thư mục /home/tomcat/logs. File log catalina.out, tail file log này để debug webservice và các ứng dụng webadmin khi có vấn đề.

 Cấu hình account mới cho webservice nhận MT khi có đối tác Vào file /home/tomcat/tomcat-users.xml, add thêm account như sau: <user username="ttx" password="123ttx4321" roles="user"/>

2009 VietNamNet ICOM @ All rights reserved. 45 Sau khi add xong vao file cần restart lại ứng dụng tomcat.

 Sử dụng trang quản trị:

o Tab Report: để thống kê sản lượng tin nhắn MO (bản tin từ telcos về), MT (bản tin gửi sangtelcos), CDR là ghi cước để đối soát với telcos.

Phần thống kê sản lượng MO/MT/CDR Ví dụ phần Report MO:

2009 VietNamNet ICOM @ All rights reserved. 46 Phần thống kê sản lượng MO

Trong phần thống kê MO này có các options để tùy chọn: Month/Year: chọn tháng/năm

From (Day-Hour): chọn bắt đầu từ ngày To (Day-Hour): chọn tới ngày

Day: kết quả ra sẽ group theo ngày Hour: kết quả ra sẽ group theo giờ

Service number: kết quả ra sẽ group theo service_id( 6043, 6143, 6243…) CP: kết quả ra group theo CP (đối tác thứ ba cung cấp nội dung)

Keyword: kết quả ragroup theo đầu mã

Ví dụ phần report MT (các options tương tự report MO):

Phần thống kê sản lượng MT Phần report CDR (các options tương tự MO/MT)

2009 VietNamNet ICOM @ All rights reserved. 47 Phần thống kê sản lượng CDR

o Tab Alert System:

Phần Alert System

Phần này hiện các cảnh báo về hệ thống như gateway mất kết nối telcos, mất kết nối database, các lỗi trên hệ thống process, cdr,…

Các tin alert này sẽ được send tới Email và SMS tới admin hệ thống. o Tab Mobile Traffice:

2009 VietNamNet ICOM @ All rights reserved. 48 Phần debug bản tin SMS

o Tab simulator để gửi tin từ web

Phần simulator để test tin từ web o Tab admin

2009 VietNamNet ICOM @ All rights reserved. 49 Phần admin để quản trị dịch vụ

2009 VietNamNet ICOM @ All rights reserved. 50 Phần Group và User

Phần SMSC, Gateway properties, config gateway là phần cấu hình tham số kết nối SMSC của telcos (hiện tại không sử dụng do cấu hình nhiều telcos)

Phần keyword: để cấu hình dịch vụ

2009 VietNamNet ICOM @ All rights reserved. 51 Phần Data cho nội dung trả về

Phần service_number: cấu hình đầu số (6043, 6143, 6243, 6343 …)

Phần Service number Phần CP để cấu hình cho đối tác thứ 3

Phần alert user: để cấu hình email, số điện thoại người admin để alert khi có sự cố Phần mobile simulator: để cấu hình số điện thoại cho test trên web

2009 VietNamNet ICOM @ All rights reserved. 52

Một phần của tài liệu Tài liệu vận hành hệ thống SMS (Trang 39 - 52)