Centos7 部署FZS Web Server

1.系统架构及配置

FZS Web Server 需要部署在装有数据库的本地环境

  • x86_64
  • 2 CPU
  • 4 GB 内存
  • 20 GB 硬盘
  • 数据库:oracle

2. 创建系统用户

(1)在 oracle 所在机器上创建和 oracle同组用户fzs,执行脚本自动创建用户:

#!/bin/sh
echo "please input system username to create(default:fzs):"
read sysuser
if [ ! -n "$sysuser" ]; then
  sysuser=fzs
fi
SYSTEM=$(uname -s)
case $SYSTEM in
Linux | AIX)
  j=3
  ;;
SunOS | HP-UX)
  j=1
  ;;
*)
  echo unknow system
  exit 1
  ;;
esac

if id -u grid >/dev/null 2>&1; then
  grp=$(groups grid | awk '{for(i=3;i<=NF;i++) if(i!=NF) printf $i","; else printf $i;}')
else
  grp=$(groups oracle | awk '{for(i=3;i<=NF;i++) if(i!=NF) printf $i","; else printf $i;}')
fi
if [ $SYSTEM = "AIX" ]; then
  UserExists=17
else
  UserExists=9
fi
if [ $SYSTEM = "SunOS" ]; then
  ONLY_SUN="-s /bin/bash"
fi

useradd $ONLY_SUN -G $grp -m $sysuser
if [ $? = $UserExists ]; then
  echo "user $sysuser already exists,continue?(y/n) (default:n)"
  read cont
  case $cont in
  "y")
    cont=y
    ;;

  "n")
    cont=n
    ;;

  "")
    cont=n
    ;;

  *)
    echo "error parameter"
    exit 1
    ;;

  esac
  if [ "$cont" = "n" ]; then
    exit 1
  else
    usermod -G $grp $sysuser
  fi
else
  passwd $sysuser
fi

echo "where is your oracle environment file(default:/home/oracle/.bash_profile):"
read oracle_environment
if [ ! -n "$oracle_environment" ]; then
  oracle_environment=/home/oracle/.bash_profile
fi
env_file=$(echo "$oracle_environment" | awk '{split($0,a,".");print a[2]}')
cp $oracle_environment /home/$sysuser/
if [ $? != 0 ]; then
  echo "parameter $oracle_environment is error,may no such file"
  exit 1
fi

chown -R $sysuser /home/$sysuser/.$env_file
echo "ulimit -c unlimited" >>/home/$sysuser/.$env_file
su - $sysuser

(2)创建oracle用户并赋予权限

源端:由于权限问题,普通用户无法直接查询下面几个表,因此需要创建视图来代替

数据库增量相关,fzs 通过下面两个视图判断当前的增量位点信息:

create or replace view XKCCLE as select * from sys.x$kccle;
create or replace view XKCCCP as select * from sys.x$kcccp;

redo 格式相关,不同的 redo 格式,需要不同的解析方法:

create or replace view FZS_XKSPPI as select * from X$KSPPI;
create or replace view FZS_XKSPPSV as select * from X$KSPPSV;

补全日志信息:

alter database force logging;
alter database add supplemental log data;
alter database add supplemental log data (primary key, unique index) columns;
create user fzs1 identified by fzs1;
create role fzs_role identified by fzs_role;
grant connect,lock any table,select any table,select any dictionary,alter system,execute any type to fzs_role,fzs1;
grant fzs_role to fzs1;
grant execute on dbms_flashback to fzs_role,fzs1;

fzs 查询数据需要使用一些表空间,这里给 fzs1 用户分配 2M 的表空间:

alter user  fzs1 quota 2m on users;

rac 多节点环境下,fzs 会定期向 fzstemp 表写入数据,非 rac 环境可以不创建:

create table fzs1.fzstemp (f1 int);

注:12c 以上版本源端还需要执行以下授权

创建 fzs_pdbs 表用于查询 PDB 信息

create table sys.fzs_pdbs as select * from sys.v$pdbs;

由于 12c 以上的数据库权限管理方式改变,select any table 权限不足以查询一些系统表,因此需要单独赋权

grant create session to fzs1;
grant select on sys.ts$ to fzs1;
grant select on sys.tabsubpart$ to fzs1;
grant select on sys.obj$ to fzs1;
grant select on sys.seg$ to fzs1;
grant select on sys.coltype$ to fzs1;
grant select on sys.xkccle to fzs1;
grant select on sys.xkcccp to fzs1;
grant select on sys.seq$ to fzs1;
grant select on sys.user$ to fzs1;
grant select on sys.col$ to fzs1;
grant select on sys.ind$  to fzs1;
grant select on sys.tab$ to fzs1;
grant select on sys.lob$ to fzs1;
grant select on sys.indpart$ to fzs1;
grant select on sys.lobfrag$ to fzs1;
grant select on sys.user$ to fzs1;
grant select on sys.source$ to fzs1;
grant select on sys.view$  to fzs1;
grant select on sys.ts$  to fzs1;
grant select on sys.profname$ to fzs1;
grant select on sys.profile$  to fzs1;
grant select on sys.sysauth$ to fzs1;
grant select on sys.props$ to fzs1;
grant select on sys.idl_ub1$ to fzs1;
grant select on sys.user$ to fzs1;
grant select on sys.ntab$  to fzs1;
grant select on sys.sum$ to fzs1;
grant select on sys.com$ to fzs1;
grant select on sys.partlob$ to fzs1;
grant select on sys.attrcol$ to fzs1;
grant select on sys.ccol$ to fzs1;
grant select on sys.subpartcol$ to fzs1;
grant select on sys.tabpart$ to fzs1;
grant select on sys.indpart$ to fzs1;
grant select on sys.indcompart$ to fzs1;
grant select on sys.defrole$ to fzs1;
grant select on sys.v_$instance to fzs1;
grant select on SYS.v_$database to fzs1;
grant select on sys.v_$datafile to fzs1;
grant select on sys.V_$SESSION  to fzs1;
grant select on sys.v_$log  to fzs1;
grant select on sys.v_$logfile  to fzs1;
grant select on sys.gv_$logfile  to fzs1;

目标端:

目标端需要写入数据,因此需要的权限比较大

create user fzs2 identified by fzs2;
grant dba to fzs2;

用于对 sequence 的同步

grant all on sys.seq$ to fzs2;
create or replace directory fzs_lobdir as '/tmp';
grant read,write on directory fzs_lobdir to fzs2;

 注:12c 以上版本目标端还需要执行以下授权

grant create session to fzs2;
grant all on sys.user$ to fzs2;
grant select on sys.ts$ to fzs2;
grant select on sys.tabsubpart$ to fzs2;
grant select on sys.obj$ to fzs2;
grant select on sys.seg$ to fzs2;
grant select on sys.coltype$ to fzs2;
grant select on sys.xkccle to fzs2;
grant select on sys.xkcccp to fzs2;
grant select on sys.seq$ to fzs2;
grant select on sys.col$ to fzs2;
grant select on sys.ind$  to fzs2;
grant select on sys.tab$ to fzs2;
grant select on sys.lob$ to fzs2;
grant select on sys.indpart$ to fzs2;
grant select on sys.lobfrag$ to fzs2;
grant select on sys.source$ to fzs2;
grant select on sys.view$  to fzs2;
grant select on sys.ts$  to fzs2;
grant select on sys.profname$ to fzs2;
grant select on sys.profile$  to fzs2;
grant select on sys.sysauth$ to fzs2;
grant select on sys.props$ to fzs2;
grant select on sys.idl_ub1$ to fzs2;
grant select on sys.user$ to fzs2;
grant select on sys.ntab$  to fzs2;
grant select on sys.sum$ to fzs2;
grant select on sys.com$ to fzs2;
grant select on sys.partlob$ to fzs2;
grant select on sys.attrcol$ to fzs2;
grant select on sys.ccol$ to fzs2;
grant select on sys.subpartcol$ to fzs2;
grant select on sys.tabpart$ to fzs2;
grant select on sys.indpart$ to fzs2;
grant select on sys.indcompart$ to fzs2;
grant select on sys.defrole$ to fzs2;
grant select on sys.v_$instance to fzs2;
grant select on SYS.v_$database to fzs2;
grant select on sys.v_$datafile to fzs2;
grant select on sys.V_$SESSION  to fzs2;
grant select on sys.v_$log  to fzs2;
grant select on sys.v_$logfile  to fzs2;
grant select on sys.gv_$logfile  to fzs2;

 3.部署FZS

fzs用户解压fzsweb.ae03013.x86_64-0.3.4-Linux.tar.gz软件包

进入fszweb/run目录

执行启动:

./start.sh

 检查容器是否启动成功:

ps x

 

停止:

./stop.sh

 

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
CentOS 7是一种可靠的操作系统,被广泛用于Web服务器的部署。以下是CentOS 7部署Web服务器的基本步骤: 1. 安装LAMP或LEMP堆栈:你可以选择使用Apache+MySQL+PHP(LAMP)或Nginx+MySQL+PHP(LEMP)来搭建Web服务器。你可以在CentOS 7上使用yum命令来安装这些软件。例如,要安装LAMP,你可以输入以下命令:sudo yum install httpd mariadb-server mariadb php php-mysql 2. 配置防火墙:默认情况下,CentOS 7的防火墙会阻止HTTP和HTTPS流量。你需要配置防火墙以允许这些流量。可以通过输入以下命令来打开HTTP和HTTPS端口:sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reload 3. 配置虚拟主机:如果你需要在同一台服务器上托管多个网站,你需要配置虚拟主机。在Apache中,你可以通过编辑/etc/httpd/conf/httpd.conf文件来配置虚拟主机。在Nginx中,你可以通过编辑/etc/nginx/conf.d/default.conf文件来配置虚拟主机。 4. 配置SSL:如果你需要启用HTTPS,你需要配置SSL证书。你可以使用自签名证书或购买第三方SSL证书。在Apache中,你可以通过编辑/etc/httpd/conf.d/ssl.conf文件来配置SSL。在Nginx中,你可以通过编辑/etc/nginx/conf.d/default.conf文件来配置SSL。 5. 测试Web服务器:一旦你完成了上述步骤,你可以使用浏览器测试你的Web服务器。在浏览器中输入服务器的IP地址或域名,应该会看到默认的Apache或Nginx欢迎页面。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柠檬不酸z

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值