Edge for Private Cloud v4.18.05
Apigee Edge Installer for Pivotal Cloud Foundry v18.05.01 corresponds to Apigee Edge for Private Cloud v4.18.05.01
Prerequisites
Before you can install Edge, you must first meet the following prerequisites.
Ops Manager 2.1 or 2.2
Ensure that you are using Pivotal Cloud Foundry Operations Manager version 2.1 or 2.2.
If you are currently running Edge for Pivotal Cloud Foundry version 4.17.09 and Pivotal Ops Manager version 1.0 or 1.1, you must first upgrade Pivotal Ops Manager to version 2.1 or 2.2 before performing the update described in this topic.
Updating Apigee Installer for PCF v4.17.09 to v18.05.01
The following instructions include changes between v18.05.01 and v4.17.09, such as a Postgres version update from 9.4 to 9.6.
Before performaing an upgrade, always back up your database so that you can restore it if needed. Backups are outside the scope of BOSH release and should be done separately.
Following are the steps for the upgrade process:
- Upgrade to the v18.05.01 tile using the Ops Manager.
- The upgrade will likely fail at the ‘upgrade Postgres step.’
SSH to both Postgres master and standby and stop the monit services.
sudo su - monit stop apigee-postgresql monit stop edge-postgres-server
Stop Edge qpid servers. Qpid should not be pushing any data to Postgres during the update.
/opt/apigee/bin/apigee-service/apigee-all stop
Promote standby to master.
SSH to the Postgres standby machine. To check if it's standby, run the following command.
sudo /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-standby
Promote the current standby to master.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql promote-standby-to-master <ip address of old master> /opt/apigee/apigee-service/bin/apigee-all restart
Check whether it is promoted to master by running the following command.
sudo /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-master
Set replication on the new master.
Edit /var/vcap/jobs/edge-postgres-server/config/silent.conf and change the following.
PG_MASTER=IPorDNSofNewMaster PG_STANDBY=IPorDNSofOldMaster
Run the following command to set replication.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-master -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
Verify the host replication is added by checking /opt/apigee/apigee-postgresql/conf/pg_hba.conf.
Update apigee-postgresql on the new master.
On the new master node, make a note of the values from /etc/yum/vars/apigeerepohost, /etc/yum/vars/apigeeuser, and /etc/yum/vars/apigeepassword.
You will need them in the next step.
Run the following command to bootstrap v18.05.
curl http://user:password@repohost:3939/bootstrap_4.18.05.sh -o /tmp/bootstrap_4.18.05.sh bash /tmp/bootstrap_4.18.05.sh apigeerepohost=repohost:3939 apigeeuser=user apigeepassword=password apigeeprotocol=http:// /opt/apigee/apigee-service/bin/apigee-service apigee-setup update
Stop edge-postgres in the new master.
/opt/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
Check that edge-postgres and apigee-postgresql are already stopped in the old master.
Run upgrade on the new master.
/opt/apigee/apigee-setup/bin/update.sh -c ps -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
The upgrade should be successful.
Upgrade the database in the new master node.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql db_upgrade
Upgrade apigee-postgresql on the old master.
Stop apigee-postgresql on the old master by running the following command.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
Edit /var/vcap/jobs/edge-postgres-server/config/silent.conf and change the following.
PG_MASTER=IPorDNSofNewMaster PG_STANDBY=IPorDNSofOldMaster
Run the following commands.
mv /opt/apigee/data/apigee-postgresql/pgdata /opt/apigee/data/apigee-postgresql/pgdata_old /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
Update apigee-postgresql.
/opt/apigee/apigee-setup/bin/update.sh -c ps -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
Update Edge Components on the new master.
Start Postgres on the new master.
/opt/apigee/apigee-service/bin/apigee-service edge-postgres-server restart
Update Edge Components on the new master.
/opt/apigee/apigee-setup/bin/update.sh -c edge -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
Update/Install Edge Components on the old master.
Install the Edge Component on the old master.
/opt/apigee/apigee-service/bin/apigee-service edge-postgres-server install
Update the Edge Component on the old master.
/opt/apigee/apigee-setup/bin/update.sh -c edge -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
Check that all the services are running in both master and node. At this point, you can log into Apigee’s analytics dashboard and see all the data.
Reswap master and standby as described in the official documentation ( https://docs.apigee.com/private-cloud/v4.18.05/handling-postgressql-database-failover).
On the current master node (N1), run the following command to stop apigee-postgresql.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
On the current standby node (N2), invoke the following command to promote it to master.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql promote-standby-to-master IPorDNSofOldMaster(N1)
On the new master (N2) node, edit /var/vcap/jobs/edge-postgres-server/config/silent.conf and change the following.
PG_MASTER=IPorDNSofNewMaster(N2) PG_STANDBY=IPorDNSofOldMaster(N1)
Then, run the following command.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-master -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
Verify the host replication is added by checking /opt/apigee/apigee-postgresql/conf/pg_hba.conf.
On the old master node (N1), edit /var/vcap/jobs/edge-postgres-server/config/silent.conf and change the following.
PG_MASTER=IPorDNSofNewMaster(N2) PG_STANDBY=IPorDNSofOldMaster(N1)
On the old master node (N1), stop apigee-postgresql.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
On the old master (N1), clean up the data.
rm -rf /opt/apigee/data/apigee-postgresql/
Make the old master (N1) as standby.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f /var/vcap/jobs/edge-postgres-server/config/silent.conf
Check for master and standby in both machines on the new master (N2).
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-master
On the old master (N1), proceed with the following.
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-standby
Start qpid servers on the qpid nodes.
/opt/apigee/apigee-service/bin/apigee-all restart
Start the monit services on both master and standby.
monit start apigee-postgresql monit start edge-postgres-server
Rerun ‘Apply changes’ using the Ops Manager to finish validation and complete the setup.
If the devportal setup still fails, SSH to the devportal box.
Go to the /opt/apigee/data/apigee-lb/conf.d directory and unlink the wrong link. It may still be linked to v4.17.09 file, which no longer exists.
unlink apigee-drupal-devportal-nginx.conf
Link it to the correct location with the following command.
ln -s /opt/apigee/apigee-drupal-devportal-4.18.05-0.0.274/conf/apigee-drupal-devportal-nginx.conf apigee-drupal-devportal-nginx.conf
Restart Apigee services.
/opt/apigee/apigee-service/bin/apigee-all restart
Finish the upgrade by running the following command.
/opt/apigee/apigee-setup/bin/update.sh -c dp -f/var/vcap/jobs/apigee-drupal-devportal/config/silent.conf