SAS IT 配置指南(图文版)
初始化工作环境
首先建立如下目录结构

然后在计算机管理中增加2用户 itadmin ,ituser,分别用于管理和访问,密码一致

为了使之正常工作,需要为上面2用户制定相应的特权
作为批作业登录
以操作系统方式操作
替换进程级别标识
调整内存配额

指定特权后重启计算机,用itadmin用户登陆(注意:此处不能使用administrator用户登陆,否则在初始元数据库时会报错)
建立metadataserver
在metadataserver目录下建立一bat文件,用于启动metadataserver,文件名为:
内容如下:
@echo off
cd /d "C:/SASIT/MetaDataServer"
start/min "metaserver" "c:/Program Files/SAS/SAS 9.1/" -nosplash -noterminal -objectserver -objectserverparms "trustsaspeer= CLIENTENCRYPTIONLEVEL=NONE applevel=1 protocol=bridge port=9001 instantiate classfactory=2887E7D7-4780-11D4-879F-00C04F38F0DB" -sasuser . -log log/m#d#b# -logparm "rollover=auto open=replaceold write=immediate"
其中metadataserver监听的端口号为9001
运行,metadataserver目录下回多出2个文件,且rposmgr下也会多出一些文件,如下:

确认9001端口是否已经启动,如下:

从上图看9001已经启动
初始化元数据库
把SAS公司提供的SASManagementConsole 软件直接复制到c:/sasit,如下

运行其中文件,此文件为 JAVA应用,显示界面如下:

如果该界面不能被显示,请查看文件中的配置信息,确保JRE路径&工作目录是否已正确设置
在出现的上述界面上提示用户进行元数据配置,建立初始元数据库信息,按照提示进入下一步

输入服务配置信息

输入元数据服务器的端口号和要使用的用户名,密码

点击添加新的元数据库


输入元数据库名称为testfoundation

输入元数据存储库引擎路径为:C:/SASIT/MetaDataServer/rpos

点击完成,开始初始化


选择YES,开始重新分配,然后点下一步完成

配置服务器
建立用户、用户组
为了使itadmin成为管理员,需在metadataserver目录下建立文件,内容如下:
*sionserver/itadmin
下一步登陆元数据服务器配置服务器,在登陆界面输入itadmin,进入控制台

把itadmin,ituser映射到SAS元数据服务器中,建立itadmin用户,ituser组,并把itadmin加入到ituser组中


此处域名如果不存在,单击新建按钮建立新的域即可

加入ITUSER组


配置spawner服务器
新建spawner服务器,在左边导航上右键单击服务器管理器,选择新建服务器,如图

选择object spawner

输入spawner服务器名字为testSpawner



新建存储过程服务器






更改应用服务器属性
配置成负载平衡服务器


配置多桥连接



配置登陆信息
把登陆改为itadmin

配置其他信息
为应用服务器指定日志文件和一些出世的SAS选项信息,如下
sas -rsasuser -logparm "rollover=session write=immediate" -log "c:/sasit/spawner/log/%y_%m_%d_%"

建立spawner服务器
在C:/SASIT/Spawner目录下建立2文件
用于启动spawner服务器
,配置spawner服务器如何和元数据库服务器通讯,北调用
内容如下:
@echo off
cd /d "c:/sasit/spawner"
echo STARTING OBJECT SPAWNER ...
SET I=0
:LOOP
SET /A I=I+1
IF EXIST spawner_%I%.log GOTO LOOP
start/min "SAS Object Spawner" "c:/Program Files/SAS/SAS 9.1/objspawn" -sasSpawnercn "testSpawner" -xmlConfigFile -slf log/spawner_%I%.log
其中testSpawner为在元数据服务器建立的名字
内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<Redirect>
<LogicalServer Name="SAS Object Spawner" ClassIdentifier="2887E7D7-4780-11D4-879F-00C04F38F0DB">
<UsingComponents>
<ServerComponent Name="Primary" ClassIdentifier="2887E7D7-4780-11D4-879F-00C04F38F0DB">
<SourceConnections>
<TCPIPConnection Name="Primary Server Connection" ApplicationProtocol="Bridge" CommunicationProtocol="TCP" HostName="localhost" Port="9001">
<Domain>
<AuthenticationDomain Name="Login Info">
<Logins>
<Login Name="ituser" UserID="ituser" Password="{sas001}aXR1c2Vy"/>
</Logins>
</AuthenticationDomain>
</Domain>
<Properties>
<Property Name="Repository" PropertyName="Repository" DefaultValue="testFoundation"/>
</Properties>
</TCPIPConnection>
</SourceConnections>
</ServerComponent>
</UsingComponents>
</LogicalServer>
</Redirect>
其中主机名对应元数据服务器所在机器名字
端口号为元数据服务器所监听的端口
登陆名、用户名为可以登陆元数据服务器的用户
口令为登陆用户名的口令,不能用明码提供,需用下面SAS过程把明码转为密码,如下
proc
pwencode
in=
"ituser"
;
run
;
元数据库名称为上文配置的元数据库名称
单击启动spawner 服务器,如正常启动,会在日志文件中产生如下日志信息
20060504:08.59.14.86: 00000000: Objspawn is running under the id Administrator@SINOSERVER.
20060504:08.59.14.86: 00000000: Objspawn has completed initialization.
测试spawner服务器
为了确认可以通spawner服务器进行通讯,进行如下操作
在控制台中选择【连接: testAppserver - 存储过程服务器】,如图

单击右键,选择测试连接,如果正常连接,会产生如下画面

如果报错,情查看spawner/log下面的日志文件,以具体确认原因,可把出错信息在SAS技术支持网站进行检索得知解决办法
建立hello world存储过程
建立了存储过程后,就可以通过WEB服务器来调用存储过程,下面建立一个输出hello world的存储过程
首先在spawner目录下建立文件,内容如下:
Data _null_;
File _webout;
Put “hello ,world”;
Run;
在控制台的存储过程管理器下建立一个TEST文件夹


在TEST文件夹下建立存储过程hello



分配管理库到c:/sasit/spawner

指定文件名为,输出选择流输出

配置WEB服务器(WEBLOGIC)
初始化目录结构
获得SAS公司提供的SAS存储过程客户包,复制在SASIT的WEB目录下,结构如图:

设置类路径
Set classpath=%classpath%;C:/SASIT/web/SASStoredProcess/WEB-INF/lib/;C:/SASIT/web/SASStoredProcess/WEB-INF/lib/;c:/SASIT/SASManagementConsole/9.1/
可以把上面语句加入启动 weblogic的BAT文件中,也可以直接更改环境变量classpath
更改配置文件
用于配置web信息,需要更改下面选项:
为BootstrapServlet设置初始参数,以便完成初始工作,分别更改loggingURL,SystemPropsFile初始参数到指定的文件中
其中loggingURL用于指定日志记录信息,指向logging_config_stp.xml文件,用于配置日志记录的详细情况
SystemPropsFile用于指定系统属性配置信息,指向system_properties.config文件,其包含登陆信息定义文件
文件中记录了元数据服务器的位置信息,如下:
PFS {
optional "debug"="DEBUG"
"host"="localhost"
"port"="9001"
"repository"="testFoundation"
"domain"="mydom";
};
具体的登陆信息被描述在sas_metadata_source_client.properties文件中,这个文件包含了具体描述元数据登陆的信息文件sas_services_idp_local_omr.xml,如登陆的用户名,口令,域等
更改的用户名,密码,域,元数据库名称
在WEBLOGIC中加载WEB模块
为把sasstoredprocess组件挂在weblogic上去,进入weblogic控制台,定位sasstoredprocess目录,把其加载到weblogic中,如图

重启动weblogic,你会看到如下图

如果没有报错则说明SAS IT已经成功架构
测试成果
访问下面URL地址,将呈现hello.,world
http://localhost:7001/SASStoredProcess/do?_program=/test/hello&_debug=trace
输出下面界面:

出错信息处理
错误1:
:
登录失败:忽略所有模块
[ javax.
:
登录失败:忽略所有模块
]
: Access denied.
说明文件sas_services_idp_local_omr.xm有误,可能是用户名,口令,域,元数据库信息没有配置正确
错误2:
Stored Process Error
Error authenticating user ituser
Check username/password and verify authentication server is running.
说明文件配置有问题,更改其中的相关用户信息,如下:
# Authenticated user name
_username=ituser
_password={sas001}aXR1c2Vy
# SAS Metadata Server authentication domain
_domain=mydom
# SAS Metadata Server repository
_repository=testFoundation
错误3
Parameter Error
Unable to create path from program
。。。
如果出现上面错误,则表明相应的存储过程路径在元数据服务器中没有定义
注意,路径必须要反斜扛开头
(转载请注明来处)