Shutting down and restarting services

In some situations, when you are not using a service but you plan to use it in the future, you can manually shut the service down to prevent it from using resources. You can restart the service when you need to use it again.

Permissions that you need for this task
You must be either:
  • A cluster administrator
  • An administrator of the project where the software is installed, for example cpd-instance
When you need to complete this task
When you want to temporarily shutdown a service that you are not using.

You can shut down a service temporarily when you are not using it. For example, over holidays or during maintenance, you might shut down a service to conserve CPU and memory resources, and then restart the service when you want to use it again.

Shutdown
You shut down a service by using the cpd-cli manage shutdown command.
The command accepts the following arguments:
--cpd_instance_ns
The project (namespace) where the component that you want to shut down is installed.
--components
The main component to shut down, and any dependent components, which are separated by commas. If you attempt to shut down a component that has dependencies that you don't specify, the process shuts down as many components as possible. You receive an error message. To determine the dependencies of the component that you want to shut down, include the --preview argument when you run the command. You can also run the list-dependents command to see the dependencies, and run the get-cr-status command to see which components are running the namespace.
--force
true|false
The service immediately shuts down without waiting for jobs to exit. Any service instances that are running are shut down. Wait for the status to progress from shutdownInProgress to shutdown. When you restart a service, any instances that were forcibly shut down restart automatically.
--include_dependency
true|false
Include all dependent components when you shut down the main component. If you specify true, all components (for example, hidden components of dependencies of the main component you are shutting down) are shut down.
--preview
true|false
Preview the commands that run when you issue this CLI command.
--tethered_instance_ns
4.6.3 or later In Cloud Pak for Data version 4.6.3 or later, if a service supports tethered namespaces, you can specify an instance namespace to use the cpd-cli manage shutdown command to shut down service instances that are installed in tethered projects.
Important: You cannot shut down a service when autoscaling is enabled for the service. For more information, see Automatically scaling resources for services.
For more information about the cpd-cli manage shutdown command, see manage shutdown in the cpd-cli command reference.
Restart

You restart a service by using the cpd-cli manage restart command. Restart the specified components and any dependencies. The component will be restarted after the dependencies are restarted. When you restart a service, any instances that were forcibly shut down restart automatically.

--cpd_instance_ns
The project (namespace) where the component that you want to restart is installed.
--components
The components to restart. If the component has any dependencies, they will also be restarted.
--preview
true|false
Preview the commands that run when you issue this CLI command.
--tethered_instance_ns
4.6.3 or later In Cloud Pak for Data version 4.6.3 or later, if a service supports tethered namespaces, you can specify a namespace to use the cpd-cli manage restart command to restart service instances that are installed in tethered projects.
For more information about the cpd-cli manage restart command, see manage restart in the cpd-cli command reference.
Note: Some services support shutdown and restart but do not support the use of the cpd-cli manage shutdown command. To shut down and restart these services, you run the oc patch command to update the shutdown setting in the service custom resource (CR) to manually shut down the service. Only the specified service is shut down or restarted. No dependent services are shut down.

The shutdown setting accepts the following arguments:

true
The operator shuts down its deployments and any dynamic workloads such as jobs and environments. The operator might wait for running jobs to end before it shuts down fully. During that time, the service must not start any new dynamic workloads.

If you shut down a service that has running instances, the CR has a status of shutdownError. Otherwise, the status initially is shutdownInProgress and then eventually shutdown.

force
The service immediately shuts down without waiting for jobs to exit. Any service instances that are running are shut down. Wait for the status to progress from shutdownInProgress to shutdown.
false
The service is restarted. If you previously forced a shutdown that shut down service instances, this setting also restarts those service instances. You can also remove the shutdown setting from the CR to restart the service. Wait for the status to progress from shutdown to InProgress to Completed.

The following table shows the services that you can manually shut down and restart. You can see detailed instructions for each service in the procedure for shutting down and restarting services.

Important: Shut down the Cloud Pak for Data control plane and the Scheduling service only if you already shut down the services that are running on top of the Cloud Pak for Data control plane.
Service name Supports the use of the shutdown setting to manually shut down and restart the service
Cloud Pak for Data control plane
Scheduling service
Common core services  
IBM Cloud Pak foundational services  
AI Factsheets  
Anaconda Repository for IBM Cloud Pak for Data  
Analytics Engine Powered by Apache Spark  
Cognos® Analytics
Cognos Dashboards
Data Privacy  
Data Refinery  
Data Replication  
DataStage®
Db2®
Db2 Big SQL
Db2 Data Gate
Db2 Data Management Console
Db2 Warehouse
Decision Optimization  
EDB Postgres
Execution Engine for Apache Hadoop  
IBM® Match 360 with Watson™

4.6.1 or later You can shut down and restart IBM Match 360 with Watson only if you are running Cloud Pak for Data 4.6.1 or later.

Informix®
MongoDB
OpenPages®
Planning Analytics
Product Master
SPSS® Modeler  
Voice Gateway  
Watson Assistant
Watson Discovery
Watson Knowledge Catalog  
Watson Knowledge Studio  
Watson Machine Learning  
Watson Machine Learning Accelerator
Watson OpenScale
Watson Pipelines  
Watson Query
Watson Speech services
Watson Studio  
Watson Studio Runtimes  

Before you begin

Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

Procedure

  1. Run the cpd-cli manage login-to-ocp command to log in to the cluster as a user with sufficient permissions to complete this task. For example:
    cpd-cli manage login-to-ocp \
    --username=${OCP_USERNAME} \
    --password=${OCP_PASSWORD} \
    --server=${OCP_URL}
    Tip: The login-to-ocp command takes the same input as the oc login command. Run oc login --help for details.
  2. Shut down or restart any of the following services as needed.

    Cognos Analytics
    Shut down

    Shut down any Cognos Analytics service instances before you shut down the service.

    1. Run the following command to list all of the Cognos Analytics service instances on the cluster:
      oc get caserviceinstance --all-namespaces

      Identify the service instances that are associated with the instance of Cognos Analytics that you want to shut down.

    2. For each service instance that is associated with the instance of Cognos Analytics that you want to shut down, run the following command to shut down the service instance.
      Each time that you run the command, replace the following values:
      • Replace <instance-id> with the appropriate ID from the list of service instances.
      • Replace <instance-namespace> with the namespace where the service instance is deployed.
      oc patch caserviceinstance <instance-id> \
      --namespace <instance-namespace> \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
    3. Run the following command to shut down the Cognos Analytics service:
      cpd-cli manage shutdown \
      --components=cognos_analytics \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Note: You can also run the cpd-cli manage shutdown command with the --force option set to true to shut down all instances and the service.
    Restart

    Restart the Cognos Analytics service and then restart the service instances that are associated with the service.

    1. Run the following command to restart the Cognos Analytics service:
      cpd-cli manage restart \
      --components=cognos_analytics \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
      Note: Any instances that were shut down forcibly are automatically restarted.
    2. Run the following command to list all of the Cognos Analytics service instances on the cluster:
      oc get caserviceinstance --all-namespaces

      Identify the service instances that are associated with the instance of Cognos Analytics that you want to restart.

    3. For each instance, run the following command to restart the Cognos Analytics service instance.
      Each time that you run the command, replace the following values:
      • Replace <instance-id> with the appropriate ID from the list of service instances.
      • Replace <instance-namespace> with the namespace where the service instance is deployed.
      oc patch caserviceinstance <instance-id> \
      --namespace <instance-namespace> \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge

    Cognos Dashboards
    Shut down

    Run the following command to shut down the Cognos Dashboards service:

    oc patch CdeProxyService cdeproxyservice-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "force"}}'
    Restart

    Run the following command to restart the Cognos Dashboards service:

    oc patch CdeProxyService cdeproxyservice-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "false"}}'

    DataStage
    Shut down

    Run the following command to shut down the DataStage service:

    cpd-cli manage shutdown \
    --components=datastage_ent \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Restart

    Run the following command to restart the DataStage service:

    cpd-cli manage restart \
    --components=datastage_ent \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}

    Db2
    Shut down

    Before you can shut down the Db2 service, you must shut down all instances. For instructions, see Shutting down and restarting a Db2 instance.

    When all instances are shut down, run the following command to shut down the Db2 service:

    cpd-cli manage shutdown \
    --components=db2oltp \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Note: You can forcibly shut down the service and all running instances by including --force=true when you run the cpd-cli manage shutdown command.
    Restart

    Run the following command to restart the Db2 service:

    cpd-cli manage restart \
    --components=db2oltp \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Note: Any instances that were shut down forcibly are automatically restarted.

    Db2 Big SQL
    Shut down

    Shut down the Db2 Big SQL service instances before you shut down the service.

    1. Run the following command to get the list of Db2 Big SQL service instance IDs:
      oc get cm \
      --namespace ${PROJECT_CPD_INSTANCE} \
      -l component=db2bigsql \
      -o custom-columns="Instance Id:{.data.instance_id}, \
      InstanceName:{.data.instance_name}, \
      Created:{.metadata.creationTimestamp}"
    2. For each service instance, run the following command to shut down the Db2 Big SQL service instance.

      Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

      oc patch bigsql bigsql-<instance-id> \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
      Note: If you run this command with the true option, you might still interrupt workloads. Running queries might fail before the graceful shutdown deadline. Ensure that workloads are complete before you shut down the service instance.
    3. Run the following command to shut down the Db2 Big SQL service:
      cpd-cli manage shutdown \
      --components=bigsql \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Restart

    Restart the Db2 Big SQL service and then restart the service instances.

    1. Run the following command to restart the Db2 Big SQL service:
      cpd-cli manage restart \
      --components=bigsql \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    2. Run the following command to get the list of Db2 Big SQL service instance IDs:
      oc get cm \
      --namespace ${PROJECT_CPD_INSTANCE} \
      -l component=db2bigsql \
      -o custom-columns="Instance Id:{.data.instance_id}, \
      InstanceName:{.data.instance_name}, \
      Created:{.metadata.creationTimestamp}"
    3. For each service instance, run the following command to restart the Db2 Big SQL service instance.

      Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

      oc patch bigsql bigsql-<instance-id> \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge

    Db2 Data Gate
    Shut down

    Shut down the Db2 Data Gate service instances before you shut down the service.

    1. Run the following command to list all of the service instances in the project where Db2 Data Gate is installed:
      oc get datagateinstanceservices --namespace ${PROJECT_CPD_INSTANCE}
    2. For each service instance, run the following command to shut down the Db2 Data Gate service instance.

      Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

      oc patch datagateinstanceservices <instance-id> \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
    3. Run the following command to shut down the Db2 Data Gate service:
      oc patch datagateservices datagateservice-cr \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
    Restart

    Restart the Db2 Data Gate service and then restart the service instances.

    1. Run the following command to restart the Db2 Data Gate service:
      oc patch datagateservices datagateservice-cr \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge
    2. Run the following command to list all of the service instances in the project where Db2 Data Gate is installed:
      oc get datagateinstanceservices --namespace ${PROJECT_CPD_INSTANCE}
    3. For each service instance, run the following command to restart the Db2 Data Gate service instance.

      Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

      oc patch datagateinstanceservices <instance-name> \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge

    Db2 Data Management Console
    Shut down

    Shut down the Db2 Data Management Console service instance before you shut down the service.

    1. Run the following command to shut down the Db2 Data Management Console service instance:

      oc patch dmc data-management-console \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
    2. Run the following command to shut down the Db2 Data Management Console service:
      cpd-cli manage shutdown \
      --components=dmc \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Restart

    Restart the Db2 Data Management Console service and then restart the service instances.

    1. Run the following command to restart the Db2 Data Management Console service:
      cpd-cli manage restart \
      --components=dmc \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    2. Run the following command to restart the Db2 Data Management Console service instance:

      oc patch dmc data-management-console \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge

    Db2 Warehouse
    Shut down

    Before you can shut down the Db2 Warehouse service, you must shut down all instances. For instructions, see Shutting down and restarting a Db2 Warehouse.

    When all instances are shut down, run the following command to shut down the Db2 Warehouse service:

    cpd-cli manage shutdown \
    --components=db2wh \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Note: You can forcibly shut down the service and all running instances by including --force=true when you run the cpd-cli manage shutdown command.
    Restart

    Run the following command to restart the Db2 Warehouse service:

    cpd-cli manage restart \
    --components=db2wh \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Note: Any instances that were shut down forcibly are automatically restarted.

    EDB Postgres
    Shut down

    Run the following command to shut down the EDB Postgres service:

    oc patch CPDEdbInstance <yourEDBInstanceName> \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "true"}}'
    Restart
    Run the following command to restart the EDB Postgres service:
    oc patch CPDEdbInstance <yourEDBInstanceName> \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "false"}}'

    IBM Match 360 with Watson

    4.6.1 or later You can shut down and restart IBM Match 360 with Watson only if you are running Cloud Pak for Data 4.6.1 or later.

    Shut down

    Run the following command to shut down the IBM Match 360 with Watson service:

    oc patch mdm mdm-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "true"}}'
    Restart

    Run the following command to restart the IBM Match 360 with Watson service:

    oc patch mdm mdm-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "false"}}'

    Informix
    Shut down

    To shut down the Informix service, scale down the CR by running the following command:

    oc patch informixservice informixservice-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"replicas": 0}}'
    Restart

    To restart the Informix service, determine the number of replicas of the CR and run the following command:

    oc patch informixservice informixservice-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"replicas": <number of replicas>}}'

    For more information, see Restarting the Informix cluster.


    MongoDB
    Shut down

    Run the following command to shut down the MongoDB service:

    oc patch CPDMongoDB <yourMongoDBInstanceName> \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "true"}}'
    Restart
    Run the following command to restart the MongoDB service:
    oc patch CPDMongoDB <yourMongoDBInstanceName> \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "false"}}'

    OpenPages
    Shut down

    Ensure that you shut down any OpenPages service instances before you shut down the service.

    Run the following command to shut down an OpenPages instance or service. Replace <service_or_instance> with openpages to shut down the service or openpages_instance to shut down an instance. Use --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME} in the command only when you need to specify the instance name because the instance does not use the default name.

    cpd-cli manage shutdown --components=<service_or_instance> --cpd_instance_ns=${PROJECT_CPD_INSTANCE} --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME}
    4.6.3 or later In Cloud Pak for Data version 4.6.3 or later, you can include the --tethered_instance_ns argument to specify an instance namespace when you use the cpd-cli manage shutdown command to shut down OpenPages instances that are installed in tethered projects.
    Restart

    Restart the OpenPages service and then restart the service instances that are associated with the service.

    Run the following command to restart an OpenPages instance or service. Replace <service_or_instance> with openpages to restart the service or openpages_instance to restart an instance. Use --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME} in the command only when you need to specify the instance name because the instance doesn't use the default name.

    cpd-cli manage restart --components=<service_or_instance> --cpd_instance_ns=${PROJECT_CPD_INSTANCE} --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME}
    4.6.3 or later In Cloud Pak for Data version 4.6.3 or later, you can include the --tethered_instance_ns argument to specify an instance namespace when you use the cpd-cli manage restart command to restart OpenPages instances that are installed in tethered projects.

    Planning Analytics
    Shut down

    Shut down any Planning Analytics service instances before you shut down the service.

    1. Run the following command to list all of the Planning Analytics service instances on the cluster:
      oc get paserviceinstance --all-namespaces

      Identify the service instances that are associated with the instance of Planning Analytics that you want to shut down.

    2. For each service instance that is associated with the instance of Planning Analytics that you want to shut down, run the following command to shut down the service instance.
      Each time that you run the command, replace the following values:
      • Replace <instance-id> with the appropriate ID from the list of service instances.
      • Replace <instance-namespace> with the namespace where the service instance is deployed.
      oc patch paserviceinstance <instance-id> \
      --namespace <instance-namespace> \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
    3. Run the following command to shut down the Planning Analytics service:
      cpd-cli manage shutdown \
      --components=planning_analytics \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Restart

    Restart the Planning Analytics service and then restart the service instances that are associated with the service.

    1. Run the following command to restart the Planning Analytics service:
      cpd-cli manage restart \
      --component=planning_analytics \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    2. Run the following command to list all of the Planning Analytics service instances on the cluster:
      oc get paserviceinstance --all-namespaces

      Identify the service instances that are associated with the instance of Planning Analytics that you want to restart.

    3. For each instance, run the following command to restart the Planning Analytics service instance.
      Each time that you run the command, replace the following values:
      • Replace <instance-id> with the appropriate ID from the list of service instances.
      • Replace <instance-namespace> with the namespace where the service instance is deployed.
      oc patch paserviceinstance <instance-id> \
      --namespace <instance-namespace> \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge

    Product Master
    Shut down
    4.6.0 If you are running Cloud Pak for Data version 4.6.0, run the following command to shut down the Product Master service:
    oc patch ProductMaster productmaster-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --patch '{"spec":{"shutdown":"true"}}' \
    --type=merge

    4.6.1 or later If you are running Cloud Pak for Data version 4.6.1 or later, run the following command to shut down the Product Master service:

    cpd-cli manage shutdown \
    --components=productmaster_instance \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Restart
    4.6.0 If you are running Cloud Pak for Data version 4.6.0, run the following command to restart the Product Master service:
    oc patch ProductMaster productmaster-cr \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --patch '{"spec":{"shutdown":"false"}}' \
    --type=merge

    4.6.1 or later If you are running Cloud Pak for Data version 4.6.1 or later, run the following command to restart the Product Master service:

    cpd-cli manage restart \
    --components=productmaster_instance \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}

    Watson Assistant
    Shut down
    1. Go to the project where Watson Assistant is installed:
      oc project ${PROJECT_CPD_INSTANCE}
    2. Export the name of your Watson Assistant instance as an environment variable:
      export INSTANCE=`oc get wa -n ${PROJECT_CPD_INSTANCE} |grep -v NAME| awk '{print $1}'`
    3. Run the following command to shut down the Watson Assistant service instance:

      oc patch wa ${INSTANCE} \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec": {"shutdown": true}}' \
      --type=merge
    Restart

    Run the following command to restart the Watson Assistant service instance:

    oc patch wa ${INSTANCE} \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --patch '{"spec": {"shutdown": false}}' \
    --type=merge

    Watson Discovery
    Shut down

    Run the following command to shut down the Watson Discovery service:

    oc patch WatsonDiscovery wd --type=merge \
    --patch='{"spec":{"shutdown": "true"}}'
    Restart

    Run the following command to restart the Watson Discovery service:

    oc patch WatsonDiscovery wd --type=merge \
    --patch='{"spec":{"shutdown": "false"}}'

    Watson Machine Learning Accelerator
    Shut down

    Run one of the following commands to shut down the Watson Machine Learning Accelerator service:

    • If Watson Machine Learning Accelerator is installed in the same project as the control plane, run:
      cpd-cli manage shutdown \
      --components=wml_accelerator_instance \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    • 4.6.3 or later If Watson Machine Learning Accelerator installed in a tethered project, run:
      cpd-cli manage shutdown \
      --components=wml_accelerator_instance \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
      --tethered_instance_ns=wmla
    Restart

    Run one of the following commands to restart the Watson Machine Learning Accelerator service:

    • If Watson Machine Learning Accelerator is installed in the same project as the control plane, run:
      cpd-cli manage restart \
      --components=wml_accelerator_instance \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    • 4.6.3 or later If Watson Machine Learning Accelerator is installed in a tethered project, run:
      cpd-cli manage restart \
      --components=wml_accelerator_instance \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
      --tethered_instance_ns=wmla

    Watson OpenScale
    Shut down
    cpd-cli manage shutdown \
    --components=openscale \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Restart

    Run the following command to restart the Watson OpenScale service.

    cpd-cli manage restart \
    --components=openscale \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}

    Watson Query
    Shut down

    Shut down the Watson Query service instance before you shut down the service.

    1. Run the following command to shut down the Watson Query service instance:
      oc patch bigsql db2u-dv \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec": {"shutdown": "true"}}' \
      --type=merge
      Note: If you run this command with the true option, you might still interrupt workloads. Running queries might fail before the graceful shutdown deadline. Ensure that workloads are complete before you shut down the service instance.
    2. Run the following command to shut down the Watson Query service:
      cpd-cli manage shutdown \
      --components=dv \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Restart

    Restart the Watson Query service and then restart the service instance:

    1. Run the following command to restart the Watson Query service:
      cpd-cli manage restart \
      --components=dv \
      --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    2. Run the following command to restart the Watson Query service instance:
      oc patch bigsql db2u-dv \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --type=merge \
      --patch '{"spec": {"shutdown": "false"}}'

    Watson Speech services
    Shut down
    1. Go to the project where Watson Speech services is installed:
      oc project ${PROJECT_CPD_INSTANCE}
    2. Export the name of your Watson Speech services instance as an environment variable:
      export INSTANCE=`oc get watsonspeech -n ${PROJECT_CPD_INSTANCE} |grep -v NAME| awk '{print $1}'
    3. Run the following command to shut down the Watson Speech services service instance:

      oc patch watsonspeech ${INSTANCE} \
      --namespace ${PROJECT_CPD_INSTANCE} \
      --patch '{"spec": {"shutdown": true}}' \
      --type=merge
    Restart

    Run the following command to restart the Watson Speech services service instance:

    oc patch watsonspeech ${INSTANCE} \
    --namespace ${PROJECT_CPD_INSTANCE} \
    --patch '{"spec": {"shutdown": false}}' \
    --type=merge

  3. If you shut down all services that are running on top of the Cloud Pak for Data control plane, except for the Scheduling service, if it is installed, you can shut down the Cloud Pak for Data control plane as needed.
    Shut down

    Run the following command to shut down the control plane:

    cpd-cli manage shutdown \
    --components=cpd_platform \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
    Important: The control plane must restart to the same status it was in before it was shut down. Do not change the spec of the control plane custom resource, perform upgrades, or perform rollbacks while the control plane is shut down.
    Restart
    Note: If you installed the Scheduling service, you must restart it before you restart the control plane. See Step 4.

    Run the following command to restart the control plane:

    cpd-cli manage restart \
    --components=cpd_platform \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
  4. If you installed the Scheduling service, you must shut it down after you shut down all other services and the control plane, and you must restart it before you restart the control plane and any other services.
    Shut down
    1. Run the following command to shut down the scheduling service:
      oc patch Scheduling ibm-cpd-scheduler \
      --namespace ${PROJECT_CPFS_OPS} \
      --type=merge \
      --patch '{"spec": {"shutdown": "true"}}'
    2. After you shut down the scheduling service, delete any pending pods that are waiting to be scheduled by the scheduling service. When the pods restart, they are scheduled by the default OpenShift scheduler.
      1. Run the following command to see which projects have pods that are under the control of the scheduling service:
        oc get po -A --no-headers | while read namespace name ready status misc; do
          schedulerName=`oc get po -n$namespace $name -o=jsonpath="{.spec.schedulerName}"`
          if [ "$schedulerName" == "ibm-cpd-scheduler" -a "$status" == "Pending" ]; then
            echo "$namespace"
          fi
        done | sort -u

        The command returns a list of projects.

      2. For each project returned by the preceding command, complete the following steps:
        1. Change to the project:
          oc project project-name
        2. Run the command to list the pending pods in the project that are still under the control of the scheduling service:
          oc get po --no-headers | while read name ready status misc; do
           schedulerName=`oc get po $name -o=jsonpath='{.spec.schedulerName}'`
           if [ "$schedulerName" == "ibm-cpd-scheduler" -a $status == "Pending" ]; then
            echo "Pod $name is pending, and schedulerName is set to ibm-cpd-scheduler"
           fi
          done

          The command returns a list of pods. If the command does not return any pods, there are no pending pods that need to be restarted in this project.

        3. Run the following command to delete the pods:
          oc get po --no-headers | while read name ready status misc; do
           schedulerName=`oc get po $name -o=jsonpath='{.spec.schedulerName}'`
           if [ "$schedulerName" == "ibm-cpd-scheduler" -a $status == "Pending" ]; then
            oc delete po $name
           fi
          done
        4. Repeat the preceding steps for each project that was returned in the output for step 1.
    Restart

    Run the following command to restart the scheduling service

    oc patch Scheduling ibm-cpd-scheduler \
    --namespace ${PROJECT_CPFS_OPS} \
    --type=merge \
    --patch '{"spec": {"shutdown": "false"}}'