NetWorker:在 Red Hat Pacemaker 群集上部署的 NetWorker 服务器上未生成restapi.log文件

Summary: 在 Red Hat Pacemaker 群集上部署的 NetWorker 服务器上不会生成restapi.log文件。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

  • NetWorker 服务器部署在 Red Hat HA (pacemaker) 群集上。
  • 不会生成 /nsr/logs/restapi 日志下的表述性状态转移 (REST) 应用程序编程接口 (API) 日志。

Cause

共享驱动器未映射到 REST API 日志记录。

Resolution

  1.  以 root 身份登录活动节点。
活动节点可以显示为:
pcs resource show
示例:
root@NWrhelNodeC:~# pcs resource show
 Resource Group: NW_group
     fs (ocf::heartbeat:Filesystem):    Started NWrhelNodeC.emclab.local
     ip (ocf::heartbeat:IPaddr):        Started NWrhelNodeC.emclab.local
     nws        (ocf::EMC_NetWorker:Server):    Started NWrhelNodeC.emclab.local
  1. 确认 pacemaker 使用的映射:
lcmap
示例:
root@NWrhelNodeC:~# lcmap
type: NSR_CLU_TYPE;
clu_type: NSR_LC_TYPE;
interface version: 1.0;

type: NSR_CLU_VIRTHOST;
hostname: 192.168.25.40;
local: TRUE;
owned paths: /nsr_share;
  1. logback.xml创建 REST API 的副本:
cp /nsr/authc/webapps/nwrestapi/WEB-INF/classes/logback.xml /nsr/authc/webapps/nwrestapi/WEB-INF/classes/logback.xml.bak
  1. 修改logback.xml以使用 REST API 日志目录的绝对路径: 
vi /nsr_share/nsr/authc/webapps/nwrestapi/WEB-INF/classes/logback.xml
改变:
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
  <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
    <resetJUL>true</resetJUL>
  </contextListener>

  <define name="logdir" class="com.emc.nw.webapi.LogDir"/>


  <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${logdir}/restapi.log</file>
    <encoder>
      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{15} - %msg%n</pattern>
    </encoder>
    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <fileNamePattern>${logdir}/restapi_%i.log.zip</fileNamePattern>
      <minIndex>1</minIndex>
      <maxIndex>10</maxIndex>
      <totalSizeCap>500MB</totalSizeCap>
...
收件人:
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
  <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
    <resetJUL>true</resetJUL>
  </contextListener>

  <define name="logdir" class="com.emc.nw.webapi.LogDir"/>


  <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/nsr_share/nsr/logs/restapi/restapi.log</file>
    <encoder>
      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{15} - %msg%n</pattern>
    </encoder>
    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <fileNamePattern>/nsr_share/nsr/logs/restapi/restapi_%i.log.zip</fileNamePattern>
      <minIndex>1</minIndex>
      <maxIndex>10</maxIndex>
      <totalSizeCap>500MB</totalSizeCap>
...
提醒:确保共享路径名称与 lcmap 命令输出的共享文件夹的名称匹配。
  1. 手动创建日志文件夹
mkdir /nsr_share/nsr/logs/restapi
  1. 将目录的所有权更改为 nsrtomcat
chown nsrtomcat:nsrtomcat /nsr_share/nsr/logs/restapi
  1. 在 REST API 目录上设置权限:
chmod 755 /nsr_share/nsr/logs/restapi
  1. 重新启动群集 NetWorker 服务:
pcs resource restart nws
  1. 确认 在 nws 资源启动后生成 restapi.log 文件:
root@NWrhelNodeC:~# ls -l /nsr_share/nsr/logs/restapi/
total 7428
-rw-------. 1 nsrtomcat nsrtomcat 7603829 Dec 14 11:01 restapi.log
-rw-------. 1 nsrtomcat nsrtomcat       0 Dec 14 10:46 rest_index.raw

Additional Information

Affected Products

NetWorker

Products

NetWorker Family, NetWorker Series
Article Properties
Article Number: 000206436
Article Type: Solution
Last Modified: 24 Mar 2025
Version:  3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.