目录
现代企业依靠多层架构的应用系统--在关键的业务运行系统中,业务的交易路径横跨客户端,网络,Web,中间件,数据库和存储。应用程序的速度缓慢是一个痛苦的长期性问题,会影响企业收入,占用人力和运作成本。
PRECISE从用户交易的角度看应用监控管理,提供一种统一全面的方法来管理现今复杂的、分布式的、松耦合的应用系统,可以管理和报告影响交易性能的每一个组件,可以直接报告最终用户的响应时间,可以快速发现最影响性能、最耗用系统资源的方法或SQL语句,识别紧急性能瓶颈,并且当应用系统性能指标不正常时,提供实际可行的建议。
1. 系统环境
序号 |
操作系统 |
主机名 |
IP地址 |
内存 |
硬盘 |
1 |
RHEL 6.6 |
precise |
192.168.230.128/24 |
2G |
40G |
注:由于测试环境资源有限,故内存和硬盘分配较小,如果资源充足,建议内存至少4G以上,硬盘越大越好。具体参考下表:
序号 |
软件名称 |
软件版本 |
1 |
Precise |
960 |
2 |
Oracle |
11.2.0.4 |
(1)、禁用防火墙
[root@precise ~]# /etc/init.d/iptables status
iptables: Firewall is not running.
[root@precise ~]# chkconfig --list iptables
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
(2)、禁用SELinux
[root@precise ~]# getenforce
Disabled
Precise收集的监控信息存放在性能仓库数据库里面,如果要监控oracle或者DB2数据库,则必须安装oracle作为性能仓库,可以安装一个单实例数据库,也可以安装一个RAC数据库。为部署简单,安装一个单实例即可。
挂载操作系统安装光盘,运行下面的脚本,创建本地YUM。
[root@precise ~]# cat createlocalyum.sh
#!/bin/bash
cd /etc/yum.repos.d/
mkdir bak
mv *.repo bak/
cat << EOF > local.repo
[Local]
baseurl=file:///media/Server
gpgcheck=1
enabled=1
EOF
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*
yum clean all
yum makecache
[root@precise ~]# sh createlocalyum.sh
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'Local' is missing name in configuration, using id
Cleaning repos: Local
Cleaning up Everything
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'Local' is missing name in configuration, using id
Local | 4.1 kB 00:00 ...
Local/group_gz | 211 kB 00:00 ...
Local/filelists_db | 3.3 MB 00:00 ...
Local/primary_db | 3.1 MB 00:00 ...
Local/other_db | 1.4 MB 00:00 ...
Metadata Cache Created
[root@precise ~]# yum install gcc compat-libstdc++-33 elfutils-libelf-devel gcc-c++ libaio-devel libstdc++-devel pdksh libcap.so.1 –y
运行下面的脚本,创建安装oracle所需的用户和目录。
[root@precise ~]# cat createuseranddir.sh
#!/bin/bash
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo "123456" | passwd --stdin oracle
mkdir -p /u01/oraInventory
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/
[root@precise ~]# sh createuseranddir.sh
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
运行下面的脚本,将环境变量写入oracle用户的profile文件中。
[root@precise ~]# cat addenv.sh
#!/bin/bash
cat <<EOF>> /home/oracle/.bash_profile
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
LD_LIBRARY_PATH=\$ORACLE_HOME/lib; export LD_LIBRARY_PATH
ORACLE_SID=pmdb; export ORACLE_SID
ORA_NLS33=\$ORACLE_HOME/nls/admin/data; export ORA_NLS33
NLS_LANG=american_america.zhs16gbk; export NLS_LANG
PATH=\$ORACLE_HOME/bin:\$PATH; export PATH
EOF
[root@precise ~]# sh addenv.sh
[root@precise ~]# su - oracle
[oracle@precise ~]$ env | grep -i oracle
USER=oracle
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib
ORACLE_SID=pmdb
ORACLE_BASE=/u01/app/oracle
MAIL=/var/spool/mail/oracle
PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
PWD=/home/oracle
HOME=/home/oracle
LOGNAME=oracle
ORA_NLS33=/u01/app/oracle/product/11.2.0/dbhome_1/nls/admin/data
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
在oracle主目录下加压安装包。
[oracle@precise ~]$ unzip /mnt/hgfs/data/oracle/software/11204/p13390677_112040_Linux-x86-64_1of7.zip
[oracle@precise ~]$ unzip /mnt/hgfs/data/oracle/software/11204/p13390677_112040_Linux-x86-64_2of7.zip
在终端Windows电脑上启动Xmanager Passive后,再设置DISPLAY环境变量为Windows电脑的地址,就可以将Linux上的图像映射到Windows上了。
[oracle@precise ~]$ export DISPLAY=192.168.230.1:0.0
[oracle@precise ~]$ cd database/
[oracle@precise database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 28445 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3999 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-07-24_04-10-31PM. Please wait ...
选择不接受安全更新。
选择跳过软件更新。
仅安装数据库软件。
选择单实例安装。
选择企业版。
选择默认的安装路径。
选择默认的清单目录。
选择管理组和操作组。
安装检查提示一些参数不满足要求,点解“Fix&Check Again”进行修复。
以root身份运行系统创建的修复脚本。
[root@precise ~]# /tmp/CVU_11.2.0.4.0_oracle/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.4.0_oracle/fixup.response
Enable file being used is :/tmp/CVU_11.2.0.4.0_oracle/fixup.enable
Log file location: /tmp/CVU_11.2.0.4.0_oracle/orarun.log
Setting Kernel Parameters...
The value for shmmni in response file is not greater than value of shmmni for current session. Hence not changing it.
The value for semmsl in response file is not greater than value of semmsl for current session. Hence not changing it.
The value for semmns in response file is not greater than value of semmns for current session. Hence not changing it.
The value for semmni in response file is not greater than value of semmni for current session. Hence not changing it.
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
忽略pdksh的安装。
开始安装。
以root身份运行配置脚本。
[root@precise ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@precise ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[oracle@precise ~]$ netmgr
[oracle@precise ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-JUL-2015 16:54:41
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/precise/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.230.128)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.128)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 24-JUL-2015 16:54:42
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/precise/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.230.128)(PORT=1521)))
Services Summary...
Service "pmdb" has 1 instance(s).
Instance "pmdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@precise ~]$ dbca
在服务器端创建Precise用户。
[root@precise ~]# useradd precise
[root@precise ~]# echo '123456' | passwd --stdin precise
Changing password for user precise.
passwd: all authentication tokens updated successfully.
需要安装ksh。
[root@precise ~]# yum install ksh
然后在终端电脑上启动安装程序。
接受许可协议。
指定服务器地址和服务器类型。
此处选择自动安装一般会失败,直接选择手动安装。
输入数据库相关信息。
为数据库用户指定密码,为数据文件指定目录。如果该目录不存在,需要使用oracle用户进行创建。
[oracle@precise ~]$ mkdir /u01/app/oracle/oradata/pmdb
具体安装信息如下:
Server Name or IP Address: 192.168.230.128
|
根据步骤先生成安装文件和配置文件到本地,然后在上传到服务器的Precise用户主目录下,再运行安装文件。
[precise@precise ~]$ cp /mnt/hgfs/data/precise/psin_ba_Linux .
[precise@precise ~]$ cp /mnt/hgfs/data/precise/setup.xml .
[precise@precise ~]$ ls
psin_ba_Linux setup.xml
[precise@precise ~]$ ./psin_ba_Linux
Listener installation completed
3515695 1
提示是否要使用开机自动启动和关机自动停止,暂不设置。
Server: 192.168.230.128 Status: WAIT Can be run: No Automatically Start Precise Agents on the 192.168.230.128 Server Precise agents can be automatically started by the UNIX server startup script. This action item is optional and you can click Mark as Done in AdminPoint also if you don't want to automatically handle the Precise agents upon server startup/shutdown. To automatically start the Precise agents upon server startup, add the following command to the server startup process: /home/precise/infra/bin/psin_infra -handle-agents start To automatically stop the Precise agents upon server shutdown, add the following command to the server shutdown process: /home/precise/infra/bin/psin_infra -handle-agents stop |
打开IE浏览器,输入http://192.168.230.128:20790/admin,进入到登录页面。输入用户名和口令:admin/admin(缺省用户名/口令)