使用 systemd 将 Informatica 作为服务启动

使用 systemd 将 Informatica 作为服务启动

我正在尝试将 Informatica 作为服务启动,以便它在重新启动时自动启动。我使用的是 RHEL 7.5 和 Informatica 9.5.1。重新启动后,服务启动,域和管理控制台也启动,但存储库无法连接到集成服务(当 Informatica 未作为服务启动而是手动启动时可以连接)。

我的 systemd 环境文件(/etc/systemd/system/informatica.service.d/env.conf)如下:-

Environment=INFA_USER="infa"

#######DB2 Environment
. /home/db2inst1/sqllib/db2profile
Environment=DB2HOME=/home/db2inst1
Environment=DB2INSTANCE=db2inst1
Environment=DB2DIR=/opt/ibm/db2/V11.5
Environment=PATH=/app/infa/server/bin:/home/db2inst1/sqllib/bin
Environment=LANG=C

#######Informatica Specific Environment
Environment=INFA_HOME=/app/infa
Environment=INFA_DOMAINS_FILE=/app/infa/domains.infa
Environment=ODBCHOME=/app/infa/ODBC7.0
Environment=ODBCINI=/app/infa/ODBC7.0/odbc.ini
Environment=JAVA_HOME=/app/infa/java
Environment=PC_SERVICE=/app/infa/tomcat/bin
Environment=INFA_SHARED=/app/infa/services/shared
Environment=ODBCINST=/app/infa/ODBC7.0/odbcinst.ini
Environment=LD_LIBRARY_PATH=/app/infa/tomcat/bin:/app/infa/server/bin:/home/db2inst1/sqllib/lib64:/opt/ibm/db2/V11.5/lib64
Environment=HOME=/home/infa
Environment=LANG=en_US.utf8
Environment=NLS_LANG=american_america.UTF8
Environment=INFA_CODEPAGENAME=UTF-8

我的systemd(/etc/systemd/system/informatica.service)文件如下:-

####### Informatica System Service

####### /etc/systemd/system/informatica.system
[Unit]
Description=Informatica Startup Service
After=syslog.target network.target

[Service]
#######systemd ignores PAM limits, so set any necessary limits in the service
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=forking
#######RemainAfterExit=yes
Restart=on-failure
User=infa
Group=infa
StandardOutput=console
EnvironmentFile=/etc/systemd/system/informatica.service.d/env.conf
WorkingDirectory=/app/infa/tomcat/bin/
ExecStart=/app/infa/tomcat/bin/infaservice.sh startup
ExecStop=/app/infa/tomcat/bin/infaservice.sh shutdown
ExecReload=/app/infa/tomcat/bin/infaservice.sh shutdown;/app/infa/tomcat/bin/infaservice.sh startup
SyslogIdentifier=Informatica.service

[Install]
WantedBy=default.target

我得到的错误是:-

"Database Driver event...Error occurred loading library [libdb2.so.1:cannot
open shared object file: No such file or directory] Database driver
event...Error occurred loading library [libpmdb2.so]

有人可以帮助我了解我可能需要更改什么,因为我不太熟悉 systemd 脚本吗?

注意:- 我还尝试在 env.conf 文件中使用“PassEnvironment”而不是“Environment”。另外,虽然我已经提到用户和组为 infa,但该服务仍然以 root 身份启动。

**ps -ef | grep pm**

根 3771 3159 0 15:20 点/2 00:00:00 grep --color=auto pm

** Informatica 服务的状态如下:-**

# systemctl status informatica
● informatica.service - Informatica Startup Service
   Loaded: loaded (/etc/systemd/system/informatica.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/informatica.service.d
           └─env.conf
   Active: active (running) since Tue 2019-09-10 15:50:59 HKT; 16min ago
  Process: 1795 ExecStop=/app/infa/tomcat/bin/infaservice.sh shutdown (code=exited, status=0/SUCCESS)
  Process: 1884 ExecStart=/app/infa/tomcat/bin/infaservice.sh startup (code=exited, status=0/SUCCESS)
 Main PID: 1927 (java)
   CGroup: /system.slice/informatica.service
           ├─1927 /app/infa/java/bin/java -ea -Djava.awt.headless=true -Duser.dir=/app/infa/tomcat/bin -DINFA_PLUGINS_HOME=/app/infa/plugins -DI...
           └─2100 /app/infa/java/bin/java -XX:GCTimeRatio=9 -XX:MaxPermSize=128m -Xmx512M -Dsun.reflect.noInflation=true -d64 -DFrameworksLogFil...

Sep 10 15:50:53 infatest systemd[1]: informatica.service holdoff time over, scheduling restart.
Sep 10 15:50:53 infatest systemd[1]: Starting Informatica Startup Service...
Sep 10 15:50:59 infatest Informatica.service[1884]: Starting Informatica services on node 'node01_infatest'
Sep 10 15:50:59 infatest Informatica.service[1884]: Using CURRENT_DIR:     /app/infa/tomcat/bin
Sep 10 15:50:59 infatest Informatica.service[1884]: Using INFA_HOME:       /app/infa
Sep 10 15:50:59 infatest systemd[1]: Started Informatica Startup Service.

多谢。

相关内容