Help Center/ MapReduce Service/ FAQs/ Web Page Access/ How Do I Change the Session Timeout Duration for an Open Source Component Web UI?
Updated on 2024-08-16 GMT+08:00

How Do I Change the Session Timeout Duration for an Open Source Component Web UI?

Question:

How Do I Change the Session Timeout Interval on the Web Page of an Open-Source Component?

Answer:

A proper web page timeout interval prevents information leakage caused by long-time web page exposure.

  1. Check whether the session timeout duration can be adjusted for the cluster.

    • For MRS cluster versions earlier than 3.x:
      1. On the cluster details page, choose Components > meta > Service Configuration.
      2. Switch Basic to All, and search for the http.server.session.timeout.secs.

        If http.server.session.timeout.secs does not exist, the cluster does not support change of the session timeout duration. If the parameter exists, perform the following steps to modify it.

    • MRS 3.x and later: Log in to FusionInsight Manager and choose Cluster > Services > meta. On the displayed page, click Configurations and select All Configurations. Search for the http.server.session.timeout.secs configuration item. If this configuration item exists, perform the following steps to modify it. If the configuration item does not exist, the version does not support dynamic adjustment of the session duration.

    You are advised to set all session timeout durations to the same value. Otherwise, the settings of some parameters may not take effect due to value conflict.

  2. Modify the timeout duration on Manager and the authentication center page.

    • For clusters of versions earlier than MRS 3.x:
      1. Log in to each master node in the cluster and perform 2.b to 2.d.
      2. Change the value of <session-timeout>20</session-timeout> in the /opt/Bigdata/apache-tomcat-7.0.78/webapps/cas/WEB-INF/web.xml file. <session-timeout>20</session-timeout> indicates the session timeout duration, in minutes. Change it based on service requirements. The maximum value is 480 minutes.
      3. Change the value of <session-timeout>20</session-timeout> in the /opt/Bigdata/apache-tomcat-7.0.78/webapps/web/WEB-INF/web.xml file. <session-timeout>20</session-timeout> indicates the session timeout duration, in minutes. Change it based on service requirements. The maximum value is 480 minutes.
      4. Change the values of p:maxTimeToLiveInSeconds="${tgt.maxTimeToLiveInSeconds:1200}" and p:timeToKillInSeconds="${tgt.timeToKillInSeconds:1200}" in the /opt/Bigdata/apache-tomcat-7.0.78/webapps/cas/WEB-INF/spring-configuration/ticketExpirationPolicies.xml file. The maximum value is 28,800 seconds.
      5. Restart the Tomcat node on the active master node.
        1. On the active master node, run the netstat -anp |grep 28443 |grep LISTEN | awk '{print $7}' command as user omm to query the Tomcat process ID.
        2. Run the kill -9 {pid} command, in which {pid} indicates the Tomcat process ID obtained in 2.e.i.
        3. Wait until the process automatically restarts. You can run the netstat -anp |grep 28443 |grep LISTEN command to check whether the process is successfully restarted. If the process can be queried, the process is successfully restarted. If the process cannot be queried, query the process again later.
    • For clusters of MRS 3.x or later
      1. Log in to each master node in the cluster and perform 2.b to 2.c on each master node.
      2. Change the value of <session-timeout>20</session-timeout> in the /opt/Bigdata/om-server_xxx/apache-tomcat-xxx/webapps/web/WEB-INF/web.xml file. <session-timeout>20</session-timeout> indicates the session timeout duration, in minutes. Change it based on service requirements. The maximum value is 480 minutes.
      3. Add ticket.tgt.timeToKillInSeconds=28800 to the /opt/Bigdata/om-server_xxx/apache-tomcat-8.5.63/webapps/cas/WEB-INF/classes/config/application.properties file. ticket.tgt.timeToKillInSeconds indicates the validity period of the authentication center, in seconds. Change it based on service requirements. The maximum value is 28,800 seconds.
      4. Restart the Tomcat node on the active master node.
        1. On the active master node, run the netstat -anp |grep 28443 |grep LISTEN | awk '{print $7}' command as user omm to query the Tomcat process ID.
        2. Run the kill -9 {pid} command, in which {pid} indicates the Tomcat process ID obtained in 2.d.i.
        3. Wait until the process automatically restarts.

          You can run the netstat -anp |grep 28443 |grep LISTEN command to check whether the process is successfully restarted. If the process is displayed, the process is successfully restarted. If the process is not displayed, query the process again later.

  3. Modify the timeout duration for an open-source component web UI.

    1. Access the All Configurations page.
      • For MRS cluster versions earlier than MRS 3.x:

        On the cluster details page, choose Components > Meta > Service Configuration.

      • For MRS cluster version 3.x or later:

        Log in to FusionInsight Manager and choose Cluster > Services > meta. On the displayed page, click Configurations and select All Configurations.

    2. Change the value of http.server.session.timeout.secs under meta as required. The unit is second.
    3. Save the settings, deselect Restart the affected services or instances, and click OK.

      You are advised to perform the restart during off-peak hours.

    4. (Optional) If you need to use the Spark web UI, search for spark.session.maxAge on the All Configurations page of Spark and change the value (unit: second).

      Save the settings, deselect Restart the affected services or instances, and click OK.

    5. Restart the meta service and components on web UI, or restart the cluster during off-peak hours.

      To prevent service interruption, restart the service during off-peak hours or perform a rolling restart. For details, see Performing Rolling Restart.

The timeout duration of the Flink component web UI cannot be changed.