Skip to content

Instantly share code, notes, and snippets.

@mfojtik
Created March 11, 2014 18:26
Show Gist options
  • Save mfojtik/9491948 to your computer and use it in GitHub Desktop.
Save mfojtik/9491948 to your computer and use it in GitHub Desktop.
snapshot-restore on started application
# rhc app create ruby12 -s mysql-5.5 postgresql-9.2
Application Options
-------------------
Domain: mfojtik
Cartridges: ruby-1.9, mysql-5.5, postgresql-9.2
Gear Size: default
Scaling: yes
Creating application 'ruby12' ... done
MySQL 5.5 database added. Please make note of these credentials:
Root User: adminC6Hqijk
Root Password: Ee38F6IQT662
Database Name: ruby12
Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
You can manage your new MySQL database by also embedding phpmyadmin.
The phpmyadmin username and password will be the same as the MySQL credentials above.
PostgreSQL 9.2 database added. Please make note of these credentials:
Root User: admincgkey4c
Root Password: WMQvvbz6uNJh
Database Name: ruby12
Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT
Waiting for your DNS name to be available ... done
Your application 'ruby12' is now available.
URL: http://ruby12-mfojtik.dev.rhcloud.com/
SSH to: 531f53d3efce2de2d0000001@ruby12-mfojtik.dev.rhcloud.com
Git remote: ssh://531f53d3efce2de2d0000001@ruby12-mfojtik.dev.rhcloud.com/~/git/ruby12.git/
Run 'rhc show-app ruby12' for more details about your app.
# rhc show-app ruby12 --gears
ID State Cartridges Size SSH URL
-------------------------------- ------- -------------------- ----- -----------------------------------------------------------------------------------------
920886564561832315453440 started mysql-5.5 small 920886564561832315453440@920886564561832315453440-mfojtik.dev.rhcloud.com
c40505a4a94911e3810822000a2f93f6 started postgresql-9.2 small c40505a4a94911e3810822000a2f93f6@c40505a4a94911e3810822000a2f93f6-mfojtik.dev.rhcloud.com
531f53d3efce2de2d0000001 started haproxy-1.4 ruby-1.9 small 531f53d3efce2de2d0000001@ruby12-mfojtik.dev.rhcloud.com
# rhc snapshot save -a ruby12 -f ruby12.tar.gz
Pulling down a snapshot to ruby12.tar.gz...
Saving snapshot for secondary mysql-5.5 gear
Creating and sending tar.gz
Saving snapshot for secondary postgresql-9.2 gear
Creating and sending tar.gz
Creating and sending tar.gz
RESULT:
Success
# rhc show-app ruby12 --gears
ID State Cartridges Size SSH URL
-------------------------------- ------- -------------------- ----- -----------------------------------------------------------------------------------------
920886564561832315453440 started mysql-5.5 small 920886564561832315453440@920886564561832315453440-mfojtik.dev.rhcloud.com
c40505a4a94911e3810822000a2f93f6 started postgresql-9.2 small c40505a4a94911e3810822000a2f93f6@c40505a4a94911e3810822000a2f93f6-mfojtik.dev.rhcloud.com
531f53d3efce2de2d0000001 started haproxy-1.4 ruby-1.9 small 531f53d3efce2de2d0000001@ruby12-mfojtik.dev.rhcloud.com
# rhc snapshot restore -a ruby12 -f ruby12.tar.gz
Restoring from snapshot ruby12.tar.gz...
Removing old git repo: ~/git/ruby12.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/ruby12.git and ~/app-root/data
Restoring snapshot for mysql-5.5 gear
Removing old data dir: ~/app-root/data/*
Restoring ~/app-root/data
Old and new names are the same, no need to rename
Restoring snapshot for postgresql-9.2 gear
Removing old data dir: ~/app-root/data/*
Restoring ~/app-root/data
Activation status: success
RESULT:
Success
# rhc show-app ruby12 --gears
ID State Cartridges Size SSH URL
-------------------------------- ------- -------------------- ----- -----------------------------------------------------------------------------------------
920886564561832315453440 started mysql-5.5 small 920886564561832315453440@920886564561832315453440-mfojtik.dev.rhcloud.com
c40505a4a94911e3810822000a2f93f6 started postgresql-9.2 small c40505a4a94911e3810822000a2f93f6@c40505a4a94911e3810822000a2f93f6-mfojtik.dev.rhcloud.com
531f53d3efce2de2d0000001 started haproxy-1.4 ruby-1.9 small 531f53d3efce2de2d0000001@ruby12-mfojtik.dev.rhcloud.com
~/code/rh/origin-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment