<commit_before>============
Data Volumes
============

The Problem
===========

By default moving an application from one node to another does not move its data along with it.
Before proceeding let's see in more detail what the problem is by continuing the :doc:`Exposing Ports example <exposing-ports>`.

Recall that we inserted some data into the database.
Next we'll use a new configuration file that moves the application to a different node.

:download:`port-deployment-moved.yml`

.. literalinclude:: port-deployment-moved.yml
   :language: yaml

.. code-block:: console

   alice@mercury:~/flocker-tutorial$ flocker-deploy port-deployment-moved.yml port-application.yml
   alice@mercury:~/flocker-tutorial$ ssh root@172.16.255.251 docker ps
   CONTAINER ID    IMAGE                       COMMAND    CREATED         STATUS         PORTS                  NAMES
   4d117c7e653e    clusterhq/mongodb:latest   mongod     2 seconds ago   Up 1 seconds   27017/tcp, 28017/tcp   mongodb-port-example
   alice@mercury:~/flocker-tutorial$

If we query the database the records we've previously inserted have disappeared!
The application has moved but the data has been left behind.

.. code-block:: console

    alice@mercury:~/flocker-tutorial$ mongo 172.16.255.251
    MongoDB shell version: 2.4.9<commit_msg>Slight clearer...I think<commit_after>============
Data Volumes
============

The Problem
===========

By default moving an application from one node to another does not move its data along with it.
Before proceeding let's see in more detail what the problem is by continuing the :doc:`Exposing Ports <exposing-ports>` example.

Recall that we inserted some data into the database.
Next we'll use a new configuration file that moves the application to a different node.

:download:`port-deployment-moved.yml`

.. literalinclude:: port-deployment-moved.yml
   :language: yaml

.. code-block:: console

   alice@mercury:~/flocker-tutorial$ flocker-deploy port-deployment-moved.yml port-application.yml
   alice@mercury:~/flocker-tutorial$ ssh root@172.16.255.251 docker ps
   CONTAINER ID    IMAGE                       COMMAND    CREATED         STATUS         PORTS                  NAMES
   4d117c7e653e    clusterhq/mongodb:latest   mongod     2 seconds ago   Up 1 seconds   27017/tcp, 28017/tcp   mongodb-port-example
   alice@mercury:~/flocker-tutorial$

If we query the database the records we've previously inserted have disappeared!
The application has moved but the data has been left behind.

.. code-block:: console

    alice@mercury:~/flocker-tutorial$ mongo 172.16.255.251
    MongoDB shell version: 2.4.9
{'fraction_non_alphanumeric': 0.09790476190476191, 'fraction_numerical': 0.03428571428571429, 'mean_word_length': 3.3766666666666665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6706409', 'n_tokens_mistral': 862, 'n_tokens_neox': 743, 'n_words': 269}