无ifconfig问题
-
修改配置文件
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
NBOOT= yes -
重新启动网络
service network restart
-
安装ifconfig
yum install net-tools
-
执行ifconfig
#静态地址 配置导致无法联网 暂不处理
查看网卡配置
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=7c2a468c-5165-4f37-945b-cf615538b8b8
DEVICE=enp0s3
ONBOOT=yes
[root@localhost network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
IPADDR=192.168.100.217 # 指定IP地址
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=7c2a468c-5165-4f37-945b-cf615538b8b8
DEVICE=enp0s3
ONBOOT=yes
[root@localhost network-scripts]#
防火墙
systemctl status firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-12-16 23:02:11 EST; 25min ago
Docs: man:firewalld(1)
Main PID: 717 (firewalld)
CGroup: /system.slice/firewalld.service
└─717 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
Dec 16 23:02:09 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Dec 16 23:02:11 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
#关闭防火墙
systemctl stop firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Mon 2019-12-16 23:29:04 EST; 34s ago
Docs: man:firewalld(1)
Process: 717 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 717 (code=exited, status=0/SUCCESS)
Dec 16 23:02:09 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Dec 16 23:02:11 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Dec 16 23:29:03 dbserver systemd[1]: Stopping firewalld - dynamic firewall daemon...
Dec 16 23:29:04 dbserver systemd[1]: Stopped firewalld - dynamic firewall daemon.
#前面操作重启之后失效 永久关闭防火墙
systemctl disable firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
安装vim问题
yum -y install vim*
vim /etc/vimrc
# 任意选一个位置配置如下参数
set nu " 设置显示行号
set showmode " 设置在命令行界面最下面显示当前模式等
set ruler " 在右下角显示光标所在的行数等信息
set autoindent " 设置每次单击Enter键后,光标移动到下一行时与上一行的起始字符对齐
syntax on " 即设置语法检测,当编辑C或者Shell脚本时,关键字会用特殊颜色显示
立即关闭
shutdown -h now
其他工具
yum -y install unzip
yum -y install lrzsz
yum -y update
配置系统时间
sudo yum install ntp ntpdate
sudo systemctl start ntpd
sudo systemctl enable ntpd
timedatectl set-timezone "Asia/Shanghai"
静默安装oracle
https://blog.51cto.com/mflag/2300909
yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static glibc glibc-common glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel numactl-devel sysstat unixODBC unixODBC-devel kernel-headers ksh pcre-devel readline*
# 上传jar包 rlwrap-0.42.tar.gz
tar -xvf rlwrap-0.42.tar.gz
cd rlwrap-0.42
./configure
make && make install
# 添加用户以及群组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo "123456" | passwd --stdin oracle
# 配置相应的文件简爱
mkdir -p /data/u01/app/oracle/product/11.2.0/dbhome_1
mkdir /data/u01/app/oracle/{oradata,inventory,fast_recovery_area}
chown -R oracle:oinstall /data/u01/app/oracle
chmod -R 775 /data/u01/app/oracle
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# echo "123456" | passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@localhost ~]# mkdir -p /data/u01/app/oracle/product/11.2.0/dbhome_1
[root@localhost ~]# mkdir /data/u01/app/oracle/{oradata,inventory,fast_recovery_area}
[root@localhost ~]# chown -R oracle:oinstall /data/u01/app/oracle
[root@localhost ~]# chmod -R 775 /data/u01/app/oracle
# 创建存放安装包的文件路径
mkdir -p /data/u01/software
mv /usr/local/src/linux.x64_11gR2_database_1of2.zip /data/u01/software/
mv /usr/local/src/linux.x64_11gR2_database_2of2.zip /data/u01/software/
cd /data/u01/software
# 进行安装包解压
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
# 修改内核文件
vim /etc/sysctl.conf
# 添加如下内容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
# 使配置生效
sysctl -p
# 修改用户限制
vim /etc/security/limits.conf
# 添加内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
修改配置文件
vim /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so
vim /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
su - oracle
[root@localhost software]# su - oracle
[oracle@localhost ~]$ vim .bash_profile
[oracle@localhost ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export ORACLE_BASE=/data/u01/app/oracle
export ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=$ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH
export NLS_LANG=american_america.AL32UTF8
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
# 使配置生效
source .bash_profile
[oracle@localhost ~]$ cp -R /data/u01/software/database/response/ .
[oracle@localhost ~]$ cd response/
[oracle@localhost response]$ vim db_install.rsp
# 修改配置
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=centos # 填写自己主机的名称
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/u01/app/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/data/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true
# 切换到压缩包目录
cd /data/u01/software/database/
./runInstaller -silent -responseFile /home/oracle/response/db_install.rsp -ignorePrereq
安装完成 sqlplus连接
退出sqlplus
配置响应文件
vim /home/oracle/response/dbca.rsp
# 修改配置文件
GDBNAME = "orcl"
SID = "orcl"
SYSPASSWORD = "root"
SYSTEMPASSWORD = "root"
SYSMANPASSWORD = "root"
DBSNMPPASSWORD = "root"
DATAFILEDESTINATION =/data/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/data/u01/app/oracle/fast_recovery_area
CHARACTERSET = "AL32UTF8"
TOTALMEMORY = "2048"
# 检查配置
egrep -v "(^#|^$)" /home/oracle/response/dbca.rsp
# 安装创建
dbca -silent -responseFile /home/oracle/response/dbca.rsp
# 查看静默实例
env|grep ORACLE_UNQNAME
# 进入sqlplus启动实例
[oracle@localhost database]$ vim /home/oracle/response/dbca.rsp
[oracle@localhost database]$ egrep -v "(^#|^$)" /home/oracle/response/dbca.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "orcl"
SID = "orcl"
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "root"
SYSTEMPASSWORD = "root"
SYSMANPASSWORD = "root"
DBSNMPPASSWORD = "root"
DATAFILEDESTINATION =/data/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/data/u01/app/oracle/oradata
CHARACTERSET = "AL32UTF8"
TOTALMEMORY = "2048"
[createTemplateFromDB]
SOURCEDB = "myhost:1521:orcl"
SYSDBAUSERNAME = "system"
TEMPLATENAME = "My Copy TEMPLATE"
[createCloneTemplate]
SOURCEDB = "orcl"
TEMPLATENAME = "My Clone TEMPLATE"
[DELETEDATABASE]
SOURCEDB = "orcl"
[generateScripts]
TEMPLATENAME = "New Database"
GDBNAME = "orcl11.us.oracle.com"
[CONFIGUREDATABASE]
[ADDINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
NODELIST=
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
INSTANCENAME = "orcl11g"
SYSDBAUSERNAME = "sys"
[oracle@localhost database]$ dbca -silent -responseFile /home/oracle/response/dbca.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/data/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
[oracle@localhost database]$ env|grep ORACLE_UNQNAME
ORACLE_UNQNAME=orcl
# 通过navicat连接
主机名:192.168.100.217
端口:1521
SID:ORCL
用户名:system
密码:root
# 切换到root用户 删除所有用户
[oracle@centos database]$ su root
Password:
[root@centos database]#cd /data/u01/software
[root@centos software]# ll
total 2295592
drwxr-xr-x. 8 root root 128 Aug 21 2009 database
-rw-r--r--. 1 root root 1239269270 Dec 17 15:02 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 root root 1111416131 Dec 17 15:07 linux.x64_11gR2_database_2of2.zip
[root@centos software]# rm -rf *
# 修改启动配置文件(该操作可以不进行)
vim /data/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
23 LISTENER =
24 (ADDRESS_LIST=
25 (ADDRESS=
26 (PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)
27 )
28 (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
29 )
30
31 # SID_LIST_<lsnr>
32 # List of services the listener knows about and can connect
33 # clients to. There is no default. See the Net8 Administrator's
34 # Guide for more information.
35 #
36 SID_LIST_LISTENER=
37 (SID_LIST=
38 (SID_DESC=
39 # BEQUEATH CONFIG
40 (GLOBAL_DBNAME=orcl)
41 (SID_NAME=orcl)
42 #(ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1)
43 # PRESPAWN CONFIG
44 #(PRESPAWN_MAX=20)
45 #(PRESPAWN_LIST=
46 #(PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
47 #)
48 )
49 )
50
# 永久关闭防火墙
systemctl disable firewalld.service
# 创建表空间
--1.//建表空间XIR_TRD
CREATE TABLESPACE "XIR_TRD_DAT" DATAFILE
'/data/u01/app/oracle/oradata/XIR_TRD_DAT01.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_TRD_DAT02.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_TRD_DAT03.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_TRD_DAT04.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_TRD_DAT05.dbf' SIZE 1G REUSE autoextend on next 100m LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE "XIR_TRD_IDX" DATAFILE
'/data/u01/app/oracle/oradata/XIR_TRD_IDX01.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_TRD_IDX02.dbf' SIZE 1G REUSE autoextend on next 100m LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--2.//建表空间XIR_MD_J
CREATE TABLESPACE "XIR_MD_DAT" DATAFILE
'/data/u01/app/oracle/oradata/XIR_MD_DAT01.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_MD_DAT02.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_MD_DAT03.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_MD_DAT04.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_MD_DAT05.dbf' SIZE 1G REUSE autoextend on next 100m LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE "XIR_MD_IDX" DATAFILE
'/data/u01/app/oracle/oradata/XIR_MD_IDX01.dbf' SIZE 1G REUSE autoextend on next 100m,
'/data/u01/app/oracle/oradata/XIR_MD_IDX02.dbf' SIZE 1G REUSE autoextend on next 100m LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
# sqlplus /nolog
# conn /as sysdba
# 创建用户
create user XIR_TRDJ identified by xpar;
create user XIR_MDJ identified by xpar;
grant dba to XIR_TRDJ;
grant dba to XIR_MDJ;
grant all privileges to XIR_TRDJ;
grant all privileges to XIR_MDJ;
select * from dba_directories;
SYS ORACLE_OCM_CONFIG_DIR /data/u01/app/oracle/product/11.2.0/dbhome_1/ccr/state
SYS DATA_PUMP_DIR /data/u01/app/oracle/admin/orcl/dpdump/
SYS XMLDIR /ade/b/2125410156/oracle/rdbms/xml
# 切换到root用户下
# 拷贝备份文件到DATA_PUMP_DIR中
[root@centos src]# mv /usr/local/src/191213_XIR_MDJ.DMP /data/u01/app/oracle/admin/orcl/dpdump/
[root@centos src]# mv /usr/local/src/191213_XIR_TRDJ.DMP /data/u01/app/oracle/admin/orcl/dpdump/
[root@dbserver ~]# cd /data/u01/app/oracle/admin/orcl/dpdump/
[root@dbserver dpdump]# ll
total 603364
-rw-r--r--. 1 root root 352137216 Dec 17 12:48 191213_XIR_MDJ.DMP
-rw-r--r--. 1 root root 265703424 Dec 17 12:50 191213_XIR_TRDJ.DMP
-rw-r-----. 1 oracle oinstall 116 Dec 17 11:05 dp.log
# 在root用户下执行
[root@localhost ~]# chown -R oracle:oinstall /data/u01/app/oracle/admin/orcl/dpdump/
[root@dbserver dpdump]# ll
total 603364
-rw-r--r--. 1 oracle oinstall 352137216 Dec 17 12:48 191213_XIR_MDJ.DMP
-rw-r--r--. 1 oracle oinstall 265703424 Dec 17 12:50 191213_XIR_TRDJ.DMP
-rw-r-----. 1 oracle oinstall 116 Dec 17 11:05 dp.log
impdp xir_mdj/xpar@192.168.100.217/orcl dumpfile=191213_XIR_MDJ.DMP;
impdp xir_trdj/xpar@192.168.100.217/orcl dumpfile=191213_XIR_TRDJ.DMP;
安装apache服务器
# 创建pptp程序部署用户(本次以xquant用户为例)
useradd -m xquant
# 将installapache2.4.17.sh、installapache2.4.17.tar两个文件上传到xquant目录下(可以在xquant用户下新建文件夹,本次直接使用xquant根目录)
# 需要确保文件的拥有者
chown xquant.xquant -R /home/xquant/
# 添加installapache2.4.17.sh执行权限
chmod +x installapache2.4.17.sh
[xquant@centos ~]$ pwd
/home/xquant
[xquant@centos ~]$ ll
total 74428
-rwxr-xr-x. 1 xquant xquant 6228 Dec 20 09:57 installapache2.4.41.sh
-rw-r--r--. 1 xquant xquant 76206080 Dec 20 09:57 installapache2.4.41.tar
# 运行installapache2.4.17.sh(安装过程中
./installapache2.4.17.sh
输入部署的路径(全路径):若不输入内容直接回车,则默认取当前所在目录
输入Apache启动端口号:若不输入内容直接回车,则默认取9090作为端口号
输入Apache启动脚本、停止脚本的放置目录(全路径):若不输入内容直接回车,则默认为部署目录
以上操作建议按照默认配置执行
[xquant@centos ~]$ ./installapache2.4.41.sh
Start deploy Apache and axis2c......
input deployment path(default: current path):
input Apache port(default:9090):
input start/stop scripts path (default: deploy path):
....
......Sucess to change file httpd.conf
Start to change and move file start/stop scripts......
......Sucess to change file start_Httpd.sh and stop_Httpd.sh
......Sucess to move file start_httpd.sh and stop_httpd.sh
......Deploy Apache and axis2c Sucess
#安装成功之后xquant下会出现Apache2以及axis2c-1.6.0两个文件夹以及start_httpd.sh(开启服务)、stop_httpd.sh(关闭服务)两个.sh文件
#将公共库(Common)放置到xquant目录下与Apache2以及axis2c-1.6.0两个文件夹同级
(注意:若执意将Common的放置到别处,请修改start_httpd.sh、stop_httpd.sh中环境变量)
#,进行计算核算服务安装,首先在axis2c-1.6.0下创建pptp服务文件夹
mkdir -p /home/xquant/axis2c-1.6.0/services
(注意:前面安装路径选择不同axis2c-1.6.0所在路径也会不同,但是services一定得在axis2c-1.6.0文件夹之下)
# 将计算、核算、数据抽取(即xQuantPP、xQuantTp、xQuantETL)上传文件到axis2c-1.6.0/services下
[xquant@centos ~]$ ll
total 74440
drwxrwxr-x. 15 xquant xquant 175 Oct 21 17:34 Apache2
drwxrwxr-x. 9 xquant xquant 216 Dec 20 10:05 axis2c-1.6.0
drwxr-xr-x. 4 xquant xquant 4096 Dec 20 10:04 Common
-rwxr-xr-x. 1 xquant xquant 6228 Dec 20 09:57 installapache2.4.41.sh
-rw-r--r--. 1 xquant xquant 76206080 Dec 20 09:57 installapache2.4.41.tar
-rwxrwxr-x. 1 xquant xquant 706 Dec 20 10:02 start_httpd.sh
-rwxrwxr-x. 1 xquant xquant 705 Dec 20 10:02 stop_httpd.sh
[xquant@centos services]$ pwd
/home/xquant/axis2c-1.6.0/services
[xquant@centos services]$ ll
total 20
drwxr-xr-x. 3 xquant xquant 4096 Dec 20 10:05 xQuantETL
drwxr-xr-x. 2 xquant xquant 8192 Dec 20 10:05 xQuantPP
drwxr-xr-x. 2 xquant xquant 4096 Dec 20 10:06 xQuantTp
# 授权
cd /home/xquant/Common/
chmod +x CreateXQCommLink.sh
./CreateXQCommLink.sh
cd /home/xquant/axis2c-1.6.0/services/xQuantPP/
chmod +x CreateXPPLink.sh
./CreateXPPLink.sh
[xquant@centos services]$ cd /home/xquant/Common/
[xquant@centos Common]$ chmod +x CreateXQCommLink.sh
[xquant@centos Common]$ ./CreateXQCommLink.sh
[xquant@centos Common]$ cd /home/xquant/axis2c-1.6.0/services/xQuantPP/
[xquant@centos xQuantPP]$ chmod +x CreateXPPLink.sh
[xquant@centos xQuantPP]$ ./CreateXPPLink.sh
# 修改服务器配置文件
vim /home/xquant/axis2c-1.6.0/services/xQuantPP/xQuant.PP.Service.config
# 配置xquant用户下的Oracle数据库访问环境变量
切换到xquant用户下
su - xquant
# 返回到根目录
[xquant@centos ~]$ cd /home/xquant/
[xquant@centos ~]$ vi .bashrc
vi ~/.bashrc
加入以下内容
export ORACLE_BASE=/data/u01/app/oracle
export ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=$ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH
保存退出后输入source ~/.bashrc使环境变量生效
[xquant@centos ~]$ source .bashrc
# 启动apche服务器
/home/xquant/start_httpd.sh
#查看服务启动是否成功
ps -ef|grep httpd
若出现运行的进程且Common的Log文件夹下有日志文件正常则启动成功
打开Common文件夹下的Log中的xpplog.txt文件,拖到最后提示服务启动成功则成功启动。
[xquant@centos ~]$ /home/xquant/start_httpd.sh
[xquant@centos ~]$ ps -ef | grep http
xquant 5855 1 0 10:17 ? 00:00:00 /home/xquant/Apache2/bin/httpd -f /home/xquant/Apache2/conf/httpd.conf -k start
xquant 5856 5855 26 10:17 ? 00:00:03 /home/xquant/Apache2/bin/httpd -f /home/xquant/Apache2/conf/httpd.conf -k start
xquant 5940 4402 0 10:17 pts/1 00:00:00 grep --color=auto http
[xquant@centos ~]$ cd /home/xquant/Common/Log/
[xquant@centos Log]$ ll
total 32
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 com_data.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 dc_data.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 ec_data.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 server.log
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 SrvLog_Debug.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 SrvLog_Error.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 SrvLog_Info.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 SrvLog_Warn.txt
-rw-rw-r--. 1 xquant xquant 1142 Dec 20 10:17 xetlLog.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 xppComputeLog.txt
-rw-rw-r--. 1 xquant xquant 21966 Dec 20 10:17 xppLog.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 xtpEngineLog.txt
-rw-rw-r--. 1 xquant xquant 590 Dec 20 10:17 xtpLog.txt
-rw-rw-r--. 1 xquant xquant 0 Dec 20 10:17 xtpSqlLog.txt
# 查看xppLog.txt日志发现有如下错误:
2019-12-20 10:20:09,798 XPP_DEBUG T0x7f5c6a60f740 [DataSourceService] - 开始 执行SQL:SELECT CAL_CODE, CAL_DAY FROM VCALENDAR T ORDER BY CAL_CODE
2019-12-20 10:20:09,799 XPP_ERROR T0x7f5c6a60f740 [CalendarService] - 加载日历出错!Error: 加载数据库驱动 Data: 加载数据库驱动(libxQDev_Oracle.so)失败,错误代码GetLastError: libclntsh.so.11.1: cannot open shared object file: No such file or directory Source File: /home/admin/Product/xQComm/code/xQComm/xQDBConnOTL/DriverLoader.cpp(302)
[xquant@centos ~]$ ./stop_httpd.sh
[xquant@centos ~]$ vi .bashrc
# 添加如下配置
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/u01/app/oracle/product/11.2.0/dbhome_1/lib/
[xquant@centos ~]$ source .bashrc
[xquant@centos ~]$ echo $LD_LIBRARY_PATH
:/data/u01/app/oracle/product/11.2.0/dbhome_1/lib/
[xquant@centos ~]$ ./start_httpd.sh
[xquant@centos ~]$ ps -ef|grep http
安装mysql相关驱动(按照以上的方式再配置一个apache服务器 用户为apache 端口为9091)
# 上传jar包到/usr/local/src目录下
[root@centos src]# ll
total 229004
-rw-r--r--. 1 root root 1100895 Dec 20 15:45 mariadb-connector-odbc-3.1.4-ga-rhel6-x86_64.tar.gz
-rw-r--r--. 1 root root 1669501 Dec 20 15:45 unixODBC-2.3.7.tar.gz
[root@centos src]# mkdir -p /home/admin/odbc
[root@centos src]# tar xzvf /usr/local/src/unixODBC-2.3.7.tar.gz -C /home/admin/odbc
# 切换目录
[root@centos odbc]# cd /home/admin/odbc/unixODBC-2.3.7/
[root@centos unixODBC-2.3.7]# ./configure --prefix=/home/admin/odbc/
[root@centos unixODBC-2.3.7]# make && make install
# 切换到apache用户下
[root@centos unixODBC-2.3.7]# su - apache
Last login: Fri Dec 20 14:59:55 CST 2019 on pts/1
# 修改环境变量
[apache@centos ~]$ cat .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
export ORACLE_BASE=/data/u01/app/oracle
export ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=$ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/u01/app/oracle/product/11.2.0/dbhome_1/lib/
export LD_LIBRARY_PATH=/home/admin/odbc/lib:$LD_LIBRARY_PATH
export PATH=/home/admin/odbc/bin:$PATH
# 使配置立即生效
[apache@centos ~]$ source .bashrc
# 切换root用户
[root@centos ~]# mkdir -p /home/admin/mariadb
[root@centos ~]# tar xzvf /usr/local/src/mariadb-connector-odbc-3.1.4-ga-rhel6-x86_64.tar.gz -C /home/admin/mariadb/
[root@centos mariadb]# chown root.root -R /home/admin/
# 修改配置文件
[root@centos admin]# vim /home/admin/odbc/etc/odbcinst.ini
[root@centos admin]# cat /home/admin/odbc/etc/odbcinst.ini
[MariaDB ODBC 3.1 Driver]
Description = MariaDB Connector/ODBC v.3.1.4
Driver = /home/admin/mariadb/lib64/libmaodbc.so
# 转换所有权
[root@centos admin]# chown apache.apache -R /home/admin/
# 修改apache配置 /home/apache/axis2c-1.6.0/services/xQuantPP/xQuant.PP.Service.config
<connectionStrings>
<connectionString>
<name>MD</name>
<instance>ConnectionString_Md</instance>
<value>Provider=ODBC;DRIVER=MariaDB ODBC 3.1 Driver;UID=xir_trdj;PORT=3306;DATABASE=trdj;SERVER=172.17.0.2;PWD=xpar;charset=GBK;OPTION=3;ClobMaxSize=5242880;MaxPoolSize=10;ConnectionTimeout=1200;CommandTimeout=7200;CheckConnection=0</value>
</connectionString>
<connectionString>
<name>APP</name>
<instance>ConnectionString_App</instance>
<value>Provider=ODBC;DRIVER=MariaDB ODBC 3.1 Driver;UID=xir_trdj;PORT=3306;DATABASE=trdj;SERVER=172.17.0.2;PWD=xpar;charset=GBK;OPTION=3;ClobMaxSize=5242880;MaxPoolSize=10;ConnectionTimeout=1200;CommandTimeout=7200;CheckConnection=0</value>
</connectionString>
<connectionString>
<name>TRD</name>
<instance>ConnectionString_Trd</instance>
<value>Provider=ODBC;DRIVER=MariaDB ODBC 3.1 Driver;UID=xir_trdj;PORT=3306;DATABASE=trdj;SERVER=172.17.0.2;PWD=xpar;charset=GBK;OPTION=3;ClobMaxSize=5242880;MaxPoolSize=10;ConnectionTimeout=1200;CommandTimeout=7200;CheckConnection=0</value>
</connectionString>
</connectionStrings>