You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs/hybrid/v1.8/ts-message-processor). info

> [!NOTE]
> **Note:** The instructions in this document are applicable for Edge Private Cloud users only.


This document explains how to restart Routers and Message Processors (MPs) without impacting
incoming API traffic. You may have to restart the Routers and MPs under certain circumstances.
Some examples are as follows:

- When a keystore that is directly referred to in the virtual host, target server or target endpoint is updated without using references.
- When API proxies are partially deployed on a few MPs.

## Before you begin


If you aren't familiar with Routers and Message Processors, read
[Edge for Private Cloud overview](https://docs.apigee.com/private-cloud/v4.50.00/overview).

## Rolling restart of Routers without traffic impact


This section describes the steps used to restart Routers without impacting the incoming API traffic.

> [!TIP]
> **Required permissions:** To perform this task, you must have permission to access the specific Router machines where you would like to restart the Router process.

1. Login to the Router that needs to be restarted.
2. Block the health check port on the Router using the following command. This ensures that the Router is considered unhealthy and no traffic will be routed to this Router.

   ```
   sudo iptables -A INPUT -i eth0 -p tcp --dport 15999 -j REJECT
       
   ```

   > [!NOTE]
   > **Note:** 15999 is the default health check port on Apigee Routers. However, if you configured a different port for health check on Routers, then block that port.

3. Wait for two minutes to ensure that any inflight traffic is handled smoothly before you restart the Router. You can do this by running the `sleep` command as follows:

   ```
   for i in {001..120}; do sleep 1; printf "\r ${i}"; done
       
   ```

   > [!NOTE]
   > **Note:** You can modify the wait time based on your requirements.

4. Stop the Apigee Monit service as follows:

   ```
   apigee-service apigee-monit stop
       
   ```
5. Stop the Apigee Router service as follows:

   ```
   apigee-service edge-router stop
       
   ```
6. Start the Apigee Router service as follows:

   ```
   apigee-service edge-router start
       
   ```
7. Wait until the Apigee Router service is started and ready to handle the incoming traffic using the following command:

   ```
   apigee-service edge-router wait_for_ready
       
   ```
8. Start the Apigee Monit service as follows:

   ```
   apigee-service apigee-monit start
       
   ```
9. Flush the IP tables to unblock the health check port 15999 and allow the Router to handle the traffic again by running the following commands:

   ```
   sudo iptables -F
   sudo iptables -L
       
   ```

> [!NOTE]
> **Note:** You may have more than one Router that needs to be restarted and they may be located in one or more data centers. If you want to restart all the Routers without impacting traffic, then login to one Router at a time and run all the commands (explained in the section above). For ease of use, all the commands are listed below, which can be copied and pasted.

```
sudo iptables -A INPUT -i eth0 -p tcp --dport 15999 -j REJECT
for i in {001..120}; do sleep 1; printf "\r ${i}"; done
apigee-service apigee-monit stop
apigee-service edge-router stop
apigee-service edge-router start
apigee-service edge-router wait_for_ready
apigee-service apigee-monit start
sudo iptables -F
sudo iptables -L
```

## Rolling restart of Message Processors without traffic impact


This section describes the steps used to restart Message Processors (MPs) without
impacting the incoming API traffic.

> [!TIP]
> **Required permissions:** To perform this task, you must have permission to access the specific Message Processor machines where you would like to restart the Message Processor process.

1. Login to the Message Processor that needs to be restarted.
2. Identify the health check port of the Message Processor using the following command:

   ```
   curl 0:8082/v1/servers/self -s | jq '.tags.property' | jq '.[] | select(.name=="http.port")'
       
   ```
3. Block the health check port (identified in step 2) on the Message Processor. This ensures that the Message Processor is considered unhealthy and no traffic will be routed to this Message Processor.

   ```
   sudo iptables -A INPUT -i eth0 -p tcp --dport port # -j REJECT
       
   ```


   Where <var translate="no">port #</var> is the port number returned from the command performed in step 2.
4. Wait for two minutes to ensure that any inflight traffic is handled smoothly before you restart the Message Processor. You can do this by running the `sleep` command as follows:

   ```
   for i in {001..120}; do sleep 1; printf "\r ${i}"; done
       
   ```

   > [!NOTE]
   > **Note:** You can modify the wait time based on your requirements.

5. Stop the Apigee Monit service as follows:

   ```
   apigee-service apigee-monit stop
       
   ```
6. Stop the Apigee Message Processor service as follows:

   ```
   apigee-service edge-message-processor stop
       
   ```
7. Sart the Apigee Message Processor service as follows:

   ```
   apigee-service edge-message-processor start
       
   ```
8. Wait until the Apigee Message Processor service is started and ready to handle the incoming traffic using the following command:

   ```
   apigee-service edge-message-processor wait_for_ready
       
   ```
9. Start the Apigee Monit service as follows:

   ```
   apigee-service apigee-monit start
       
   ```
10. Flush the IP tables to unblock the health check port and allow the Message Processor to handle the traffic again by running the below commands:

    ```
    sudo iptables -F
    sudo iptables -L
        
    ```

> [!NOTE]
> **Note:** You may have more than one Message Processor that needs to be restarted and they may be located in one or more data centers. If you want to restart all the Message Processors without impacting traffic, then login to one Message Processor at a time and run all the commands (explained in the section above). For ease of use, all the commands are listed below, which can be copied and pasted.

```
curl 0:8082/v1/servers/self -s | jq '.tags.property' | jq '.[] | select(.name=="http.port")'

sudo iptables -A INPUT -i eth0 -p tcp --dport port # -j REJECT
for i in {001..120}; do sleep 1; printf "\r ${i}"; done
apigee-service apigee-monit stop
apigee-service edge-message-processor stop
apigee-service edge-message-processor start
apigee-service edge-message-processor wait_for_ready
apigee-service apigee-monit start
sudo iptables -F
sudo iptables -L
```


Where <var translate="no">port #</var> is the port number returned from the command performed in step 2.