Skip to content

Instantly share code, notes, and snippets.

@bmpvieira
Last active June 5, 2016 15:42
Show Gist options
  • Save bmpvieira/ea2650a858223facfe25 to your computer and use it in GitHub Desktop.
Save bmpvieira/ea2650a858223facfe25 to your computer and use it in GitHub Desktop.

Setting up Crashplan on FreeNAS Goals

Be able to backup from the FreeNAS box to offsite Crashplan Central. Allow incoming Crashplan backups from other devices. Install the CrashPlan plugin

Install the plugin into a jail: Click on Plugins, then the Available tab, the "crashplan" line and finally the Install button. Once the installation completes, on the left tree, expand Plugins and click on CrashPlan. Accept the Java EULA. Start the Crashplan plugin: Plugins->Installed and make sure the Crashplan plugin is in the "ON" position. Cause Crashplan to listen on all interfaces

Normally, the Crashplan GUI runs on the same computer as the engine process. In this "headless" situation, the engine runs on the FreeNAS box and the GUI runs on a different computer.

NOTE! Crashplan recommends an approach where the GUI-to-engine communication is done over a ssh tunnel with port forwarding. This is pretty cumbersome as there are extra steps to enable the ssh server on the FreeNAS box and you must remember to establish the ssh tunnel before running the GUI. I think there is a simple way! We can modify the Crashplan installation on the FreeNAS box to allow connections from other computers. This avoids messy sshd setup and the need to ssh before running the GUI. (Note: The ssh method is probably more secure. But this traffic is contained within your own LAN, so it should be fine.)

To allow GUI connections from other computers on your LAN, first ssh to your FreeNAS box. Once logged in, run the following command to get a shell within the Crashplan jail:

jexec crashplan_1 csh Using your favorite text editor, edit the following file:

/usr/pbi/crashplan-amd64/share/crashplan/conf/my.service.xml Within this file, change the from "127.0.0.1" to "0.0.0.0". Save, and then restart the Crashplan service:

service crashplan stop && service crashplan start To verify that this worked and Crashplan is now listening on all interfaces, run "sockstat -l". Make sure that the java process is listening on "*:4243" and not "127.0.0.1:4243"

Add Storage to the jail

From the left hand tree pane, select Jails->crashplan_1->Storage->Add Storage For each source path you want to back up, add the Source path and a Destination path, usually "/mnt/". Select "read-only" and "Create directory" Add Storage for incoming backups

At this point Crashplan will accept incoming backups, but it will store those backups within the jail filesystem. This is probably not desirable, so instead, configure the destination to be a path within your main ZFS pool.

From the left hand tree pane, select Jails->crashplan_1->Storage->Add Storage Add the Source path within your FreeNAS pool and a Destination path, usually "/mnt/incoming". Do not tick "read-only" but do tick "Create directory" Next, ssh to your FreeNAS box and execute the following commands to set link where Crashplan deposits incoming backups to your incoming folder:

jexec crashplan_1 csh service crashplan stop rmdir /usr/pbi/crashplan-amd64/share/crashplan/backupArchives ln -s /mnt/incoming /usr/pbi/crashplan-amd64/share/crashplan/backupArchives service crashplan start Login with the Desktop Crashplan Client

First, install Crashplan on another computer (one with a GUI). Then open the ui.properties configuration file in your favorite editor:

Linux (if installed as root): /usr/local/crashplan/conf/ui.properties Mac: /Applications/CrashPlan.app/Contents/Resources/Java/conf/ui.properties Solaris (if installed as root): /opt/sfw/crashplan/conf/ui.properties Windows: C:\Program Files\CrashPlan\conf\ui.properties Within the ui.properties file, change the line:

#serviceHost=127.0.0.1 to this:

serviceHost=192.168.1.26 (where "192.168.1.26" should be the IP address of your FreeNAS jail.)

Finally, run Crashplan on this GUI-based computer. It should connect to your FreeNAS box so that you can setup backups to destinations like Crashplan Central and start accepting incoming backups from your other computers.

References:

http://forums.freenas.org/threads/crashplan-plugin.15366 http://support.code42.com/CrashPlan/Latest/Configuring/Configuring_A_Headless_Client#UI.PROPERTIExS_File_Location http://www.liquidstate.net/blog/technology/how-to-manage-your-crashplan-server-remotely http://forums.freenas.org/threads/how-to-crashplan-in-freenas-9-1-jail-tested-on-32bit.14099 http://doc.freenas.org/index.php/Adding_Jails#Accessing_a_Jail_Using_SSH_Instead_of_its_Shell_Icon

THEN

I think I have a solution, can someone else confirm?

edit /usr/pbi/crashplan-amd64/share/crashplan/bin/run.conf

after the auto update to 3.6.3 it looked like this: SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx512m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Dc42.native.md5.enabled=false" GUI_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanDesktop -DappBaseName=CrashPlan -Xms20m -Xmx512m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Dc42.native.md5.enabled=false" Add the bolded text to make it read like this (which matches the run.conf included in the plugin originally): SRV_JAVA_OPTS="-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider -Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx512m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Dc42.native.md5.enabled=false" GUI_JAVA_OPTS="-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider -Dfile.encoding=UTF-8 -Dapp=CrashPlanDesktop -DappBaseName=CrashPlan -Xms20m -Xmx512m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Dc42.native.md5.enabled=false" After I did this I was able to restart the engine and connect with a remote head. Backup is running again for me.

THEN

Just to keep the documentation inside this forum: to fix the update problem, SSH into your FreeNAS install and enter your jail (via jexec). Then type Code (text): cat /var/lib/crashplan/.ui_info ; echo Copy that code to your client, in Windows its located in C:\ProgramData\CrashPlan.ui_info which can be edited in Notepad

In Mac, open terminal and type Code (text): sudo nano "/Library/Application Support/CrashPlan/.ui_info" After typing your admin password, delete the current line and paste the one from your server.

robles, Jul 8, 2015 #20

THEN

SOLVED: See my post below.

On my Freenas system the service port was changed to 4357 and so was the start of the value in .ui_info.

I copied the .ui_info from freenas to the windows machine running the client.

In ui.properties and ui_.properties I changed the servicePort to 4357. Now the client seems to connect (this did not happen before I changed the servicePort in those two files), but then immediately disconnects. I have included the log below. Notice that it is still getting a 4243 value from somewhere even though it successfully connects on 4357.

As an alternate approach I tried changing the .ui_info and listening port on the Freenas system to match those on the client, as this worked for two other linux machines where I run headless crashplan installations. However, as soon as I restarted Crashplan on Freenas, these values reverted to their originals.

Anyone (especially those that have gotten this to work) have any insights?

Code (text): [07.10.15 10:29:52.224 INFO connect com.backup42.desktop.CPDesktop ] Connecting to service at 192.168.5.9:4357 [07.10.15 10:29:53.255 INFO MQ-UI-0 com.backup42.desktop.CPDesktop ] Connected to service [07.10.15 10:29:53.255 INFO MQ-UI-0 com.backup42.service.ui.UIInfoUtility ] Loaded port=4243 and token from location=C:/ProgramData/CrashPlan/.ui_info [07.10.15 10:29:53.255 INFO MQ-UI-0 backup42.service.ui.client.ServiceClient] Getting initial application state for CPD, username=liriel, userHome=C:\Users\liriel, desktopFolder=C:\Users\liriel\Desktop [07.10.15 10:29:53.255 INFO connect com.backup42.desktop.CPDesktop ] SUCCESS on attempt #1 [07.10.15 10:29:53.380 INFO Factory$Notifier-UI0 com.backup42.desktop.Services ] DISCONNECTED!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment