APIGEE - Maintenance Overview
APIGEE - Maintenance Overview
Maintenance Overview
Topics to cover:
The order of stopping and starting the subsystems is important. Start and stop scripts
are provided that take care of that for you for Edge components running on the same
node.
Stop order: If you install Edge on multiple nodes, then you should stop Edge
components on those nodes in the following order:
Management Server (edge-management-server)
Message Processor (edge-message-processor)
Postgres Server (edge-postgres-server)
Qpid Server (edge-qpid-server)
Router (edge-router)
Edge UI (edge-ui)
Cassandra (apigee-cassandra)
OpenLDAP (apigee-openldap)
PostgreSQL database (apigee-postgresql)
Qpidd (apigee-qpidd)
3 ZooKeeper (apigee-zookeeper)
© 2016 WIPRO LTD | WWW.WIPRO.COM | CONFIDENTIAL
Starting and Stopping the Apigee System
Start order: If you install Edge on multiple nodes, then you should start Edge
components on those nodes in the following order:
Cassandra (apigee-cassandra)
OpenLDAP (apigee-openldap)
PostgreSQL database (apigee-postgresql)
Qpidd (apigee-qpidd)
ZooKeeper (apigee-zookeeper)
Management Server (edge-management-server)
Message Processor (edge-message-processor)
Postgres Server (edge-postgres-server)
Qpid Server (edge-qpid-server)
Router (edge-router)
Edge UI (edge-ui)
The following scripts detect the Apigee components configured to run on the system
on which the script is executed, and will start or stop only those components in the
correct order for that node.
You can use the following tool to start/stop/restart or check the status of an individual
Apigee service on any specific server.
For example, to start, stop, or restart the Management Server, run the following
commands:
apigee-service edge-management-server start
apigee-service edge-management-server stop
apigee-service edge-management-server restart
6 © 2016 WIPRO LTD | WWW.WIPRO.COM | CONFIDENTIAL
Router/Message Processor Maintenance
For example, to upgrade a Message Processor, you can use the following procedure:
Disable reachability on the Message Processor.
Upgrade the Message Processor.
Enable reachability on the Message Processor.
To disable reachability on Message Processor, you can just stop the Message
Processor:
> /opt/apigee/apigee-service/bin/apigee-service edge-message-processor stop
The Message Processor first processes any pending messages before it shuts down.
Any new requests are routed to other available Message Processors.
In a production environment, you typically have a load balancer in front of the Edge
Routers. Load balancers monitor port 15999 on the Routers to ensure that the Route
is available.
Configure the load balancer to perform an HTTP or TCP health check on the Router
using the following URL:
curl –v http://router_IP:15999/v1/servers/self/reachable
This URL returns an HTTP 200 response code if the Router is reachable.
Make the router un reachable from Load balancer level and then try the same
command to check unreachability
To get the status of a Router, make a request to port 8081 on the Router:
> curl -v http://<routerIP>:8081/v1/servers/self/up or self/reachable
If the Router is up, the request returns "true" in the response and HTTP 200. Note
that this call only checks if the Router is up and running. Control of the Router's
reachability from a load balancer is determined by port 15999
If you should find that Cassandra log files are taking up excessive space, you can
modify the amount of space allocated for log files by editing the log4j settings.
Edit /opt/apigee/customer/application/cassandra.properties to set the following
properties. If that file does not exist, create it:
#!/bin/bash
# main
if [ $# -lt 3 ]; then
echo "Usage: $0 <Organization> <Env> <NoOfDaysToPurgeBackFromCurrentDay>";
exit 1;
fi
org=$1;
env=$2;
NoOfDaysToPurgeBackFromCurrentDay=$3;
for i in `psql -U postgres -d apigee -c "select tablename from analytics.childfactables where customer='$org~$env' and
to_timestamp(starttime/1000) < (SELECT CURRENT_TIMESTAMP -INTERVAL '$NoOfDaysToPurgeBackFromCurrentDay
DAYS')" |grep fact`
do
psql -U postgres -d apigee -c "drop table if exists analytics.\"$i\" cascade ";
echo "$i partition is dropped"
done ;
psql -U postgres -d apigee -c "delete from analytics.childfactables where customer='$org~$env' and to_timestamp(starttime/1000) <
(SELECT CURRENT_TIMESTAMP -INTERVAL '$NoOfDaysToPurgeBackFromCurrentDay DAYS')";