You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
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.
Rolling restart of Routers without traffic impact
This section describes the steps used to restart Routers without impacting the incoming API traffic.
- Login to the Router that needs to be restarted.
-
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
-
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
-
Stop the Apigee Monit service as follows:
apigee-service apigee-monit stop
-
Stop the Apigee Router service as follows:
apigee-service edge-router stop
-
Start the Apigee Router service as follows:
apigee-service edge-router start
-
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
-
Start the Apigee Monit service as follows:
apigee-service apigee-monit start
-
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
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.
- Login to the Message Processor that needs to be restarted.
-
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")'
-
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 port # is the port number returned from the command performed in step 2.
-
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
-
Stop the Apigee Monit service as follows:
apigee-service apigee-monit stop
-
Stop the Apigee Message Processor service as follows:
apigee-service edge-message-processor stop
- Sart the Apigee Message Processor service as follows:
apigee-service edge-message-processor start
-
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
-
Start the Apigee Monit service as follows:
apigee-service apigee-monit start
- 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
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 port # is the port number returned from the command performed in step 2.