Wednesday, September 23, 2015

Bringing Data Agility to Docker Containers

First, I think Docker is fantastic. But, it seemed like at every DevOps conference I attended, I heard the same gist: "Docker is great, but I need an easier way to get production data (App and DB) to my containers, and keep it fresh. I don't find bugs until way too late in my cycle." Every time I heard that, I was reminded of the great blog my colleague Neil Batlivala titled, "Why Docker Is Not Enough." And, if you don't understand why that is hard or important, then I really encourage you to read his blog. It is most excellent.

What I finally determined to do is to demonstrate, in a simple and straightforward manner, how simple it is to leverage Delphix to do this. And so I recorded a video that demonstrates how easy it is to configure Delphix to deliver fresh data to Docker containers using out-of-the-box features. That is done in about 5 minutes, and then I demonstrate how to leverage all of the self-service tools of Delphix against Docker.

Delphix Setup/Config

  1. Add the source SugarCRM Server and target Docker Server as environments in Delphix
  2. Add the SugarCRM application owner (i.e. www-data ) as an Environment User to both environments.
  3. Link Delphix to the SugarCRM source database. In this case it was a MySQL database
  4. Create Unstructured Files dataset to the webroot of the SugarCRM application and then link Delphix to it as the application. In my case, this directory was /var/sugarcrm/apps/sugarcrm/htdocs and the owner was www-data. Notice it is just the SugarCRM webcontent, not Apache, PHP, etc. The files in the htdocs folder are the same one gathered when using the SugarCRM backup utility. 
  5. After the initial link was completed, here is what my source environment looked like in Delphix:
It is after this setup that the video commences. More information on how I configured Landshark to run SugarCRM and docker at the bottom of the page.


Link to video: https://vimeo.com/140216365
Or watch here:

Landshark Modifications to Run SugarCRM

Below are the steps I personally took to get SugarCRM and running on my Landshark 2.2 installation. I made choices that simplified my path to demonstrating the use case, and may not have always been "the most administratively correct." To learn more about DelphixExpress and Landshark 2.2, please see my colleague Kyle Hailey's blog post here : http://datavirtualizer.com/delphix-express-free-version-of-delphix-available/

Landshark Linuxtarget Setup/Config:

  1. ssh into linuxtarget as root
  2. useradd -u 33 -g 33 www-data
  3. sed -i -e 's|tape|www-data|' /etc/group
  4. passwd www-data
    1. set to delphix
  5. visudo
    1. change the "delphix ALL" line to "delphix ALL=NOPASSWD:ALL"
    2. Add the following entries to the end of the file (after the delphix entries):
      Defaults:www-data !requiretty
      www-data ALL=NOPASSWD:/bin/mount, /bin/umount, /bin/mkdir, /bin/rmdir, /bin/ps, /usr/bin/docker
  6. chkconfig docker on
  7. service docker start
  8. exit

Landshark Linuxsource Setup/Config:

  1. ssh into linuxsource as root
  2. repeat steps 2-8 above
  3. ssh into the linuxsource as delphix
  4. curl -L -O https://s3-us-west-2.amazonaws.com/landshark/linuxsource_public_setup.sh
  5. chmod +x linuxsource_public_setup.sh
  6. ./linuxsource_public_setup.sh
  7. This will take several minutes to complete where you will be prompted for a password. The password is delphix
  8. If the environments are already in Delphix, then refresh them.
  9. After it is finished, launch a web browser to http://<IP of linuxsource>:8080. ie http://192.168.2.111:8080
  10. username/pass = admin/delphixdb
  11. Complete the wizard. The only information required from you is an email address. Sugar is running and you are ready to complete the Delphix Config/Setup above.