fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 8:00 am

Hello folks!

At home I’m running an old (Debian) server with internal hard drives which needs very much energy, is very loud, etc. pp. …

The server is responsible for a few things:

– providing media files via NFS
– backing up these files
– backing up my MacBook via TimeMachine
– running pyLoad
– running kodi (formerly knows as XBMC)

I thought about replacing it with a Mac Mini 2012 or 2014 plus three USB 3 hard drives, one for media files, one for backups, one for TimeMachine backups of my MacBook.

I don’t really think so, especially concerning the USB 3 hard drives part, but could I also do this with a Raspberry Pi 2? Or are the system requirements too high for it?

Thanks very much!

User avatar
DougieLawson
Posts: 40827
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 9:03 am

I replaced a Viglen MPC-L x86 running Ubuntu with a RPi2B running stock standard Raspbian Wheezy. The services I'm running are Apache2, MariaDB (MySQL replacement), Mosquitto, CUPS, cloudprint, ntp, bind9 & samba.

I've got a 150GB hard drive in a USB carrier (and max_usb_current=1 in /boot/config.txt to support that). The SDCard is only used to boot the system.

It's been running for more than a week and it's working well, it's faster than the old Viglen, cheaper to run and has twice the RAM.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 11:01 am

I had built myself a Windows Server 2003 system at home using an old AMD Sempron-based x86 motherboard, some spare RAM, and a couple of hard drives. The system was noisy and slow, and couldn't be left on 24x7 because of the power drain. A bit of a pain considering it was acting as an Active Directory domain controller for the Windows Vista and Windows 7 PCs in the house.

I got my first Pi (a Raspberry Pi Model B 512MB) for Christmas a couple of years ago, and built it up as a replacement for the server. Set it up as a DHCP server, and installed Samba4 on it - Samba4 can be joined to an Active Directory as a domain controller, and has a DNS service built-in to it - joined it to my existing AD, and moved the FSMO roles over to it. I was then free of the old server from a "core functionality" point of view.

My old server was also running Cacti, a web-based graphing tool, which I use to poll my Cisco router and wireless access point using SNMP and graph the throughput of the interfaces, the number of connected WiFi clients, etc. So I had to install the LAMP stack - Linux, Apache, MySQL, PHP - on my Pi.

During that time, my trusty network-connected laser printer (an HP LaserJet I got off eBay for £50) died, and I got my parent's old USB-connected HP DeskJet 5550. Since the DeskJet had no network connection of its own, I had to learn about CUPS (Common UNIX Printing System), and found that Samba4 has support for CUPS built-in. I got it installed, got the printer connected to the Pi, and got the printer shared on the domain.

I also decided I wanted a home e-mail server, and discovered the Horde project. Horde is a collaboration platform, capable of acting as a webmail server with shared calendar, contacts and global address lists, task lists, file sharing, wiki, etc. It's also compatible with ActiveSync, so I can have my e-mail notifications pushed out to clients, including Android / iOS / Windows Mobile devices.

Fast forward to Christmas last year - I found the old Pi B was a bit slow for all the tasks I was throwing at it, and since there was no sign of a Pi 2 at that point, I asked for and received a CubieTruck (CubieBoard 3) - nifty thing, ARMv7 dual-core, 2 GB RAM, gigabit network adapter, and a SATA2 controller. Got it all set up and joined it to the AD as a secondary DC, and set up DHCP redundancy between the two. Set up Cacti on the CubieTruck. And all was good.

Started experimenting with DLNA media streaming - I got an application installed called Serviio, which is a DLNA streaming tool. I don't have a USB DVD/Blu Ray drive, so I had to use my PC to rip the discs and copy them up to the CubieTruck. Again, all going well, until I found the CubieTruck can't transcode video fast enough to work. It'll stream video fast enough, as long as the playback device is capable of playing the video in the original file format, but if it isn't, then the media server has to transcode the file on the fly (i.e. at 24+ frames per second).

However, my experiments were cut short just a month later (January) when the CubieTruck died. Flat-out died. SDRAM fails to initialize on power-on. CubieTech were completely unresponsive when I contacted them. I guess they had my money and didn't particularly care that their device had died in under 30 days. By that point, Raspberry Pi 2 had been unveiled, and I bought one. Incidentally - together with a case, HDMI cable, SD card, and delivery, the Pi 2 cost £30 less than the failed CubieTruck did.

Pi 2 - quad-core ARMv7 (twice as many as CubieTruck), 1 GB RAM (half as much as CubieTruck), 100 Mbit/sec network card, no SATA2 controller. The SATA2 controller and the gigabit network card are sadly missed (especially when copying 20GB BluRay rips to it...), but the extra two cores are definitely welcome. While the Pi 2 is noticeably *much* faster than the Pi 1, it's still not quite fast enough to do on-the-fly transcoding of video, which is a shame. I wonder if this could simply be attributed to it having to do so many other things as well. It's no matter though; I'm continuing to rip and encode my content into a format pretty much all of my devices will play without requiring transcoding. Transcoding of audio, incidentally, is much less CPU intensive and works fine on the Pi 2.

To summarize - yes, you can have a Pi as a server replacement. If, like me, you started off completely unfamiliar with Linux, then, like me, you might find it a bit of a struggle at times! But I like a challenge, and have got pretty much everything I wanted to work pretty much the way I want it. And best of all, I now have *two* servers, each making no noise, and combined they consume considerably less power than my one Windows box did.

I'll be replacing the original Pi with a Pi 2 at some point this year, just so I have a matched pair, and will be splitting functionality between them more evenly so as to load balance. I may even get a 3rd Pi 2 to use just as a media server. The original Pi B will be given a camera and put into a NatureBytes nest box and set up at a bird feeder in my parents garden to live out its retirement in tranquility. Or not, as the case may be - have you seen how aggressive common garden birds can be to one another?

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 11:37 am

Oh - totally forgot to mention - my Pi 2 also runs CrashPlan, acting as an automated backup agent for my PCs at home, and my parents' PCs over the Internet.

I don't know about Pi/TimeMachine compatibility, but CrashPlan has a Mac version. CrashPlan is *easy* to use. You don't need to back up to the cloud (CrashPlan Central), especially if you can back up to someone else's CrashPlan instance over the Internet (like my parents do to my Pi), so you can use the free edition.

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 12:19 pm

Thanks for all this information! Good news, everyone.

So, that sounds like CPU and RAM are enough for my purposes. I just (still) wonder if it’s such a good idea to run three 2.5" USB-3 hard drives from the Raspberry Pi 2 … AND for sure USB-3 is not supported, or am I completely misinformed about that? : x

User avatar
DougieLawson
Posts: 40827
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 12:40 pm

USB3 may be available on a future RPi3 or RPi4 but it ain't on the RPi1 or RPi2.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 1:40 pm

But will they most likely get enough power? And is downsampled USB-3 fast enough for streaming movies, music and doing backups? I’m not sure about that …

User avatar
DougieLawson
Posts: 40827
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 1:45 pm

With the B+ and 2B you can set

Code: Select all

max_usb_current=1
in /boot/config.txt to give 1200mA (rather than 600mA) to the USB ports. My one lone USB 2.0 HDD needs that.

You may need a powered USB HUB to run more than one HDD.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 1:56 pm

Thanks so far!

So, another possibility – I forgot to mention that in my start post – the following setup:

Raspberry Pi 2 which acts as server and uses an Apple TimeCapsule as external network storage. I you can uses that how you want and not just for TimeMachine backups. : /

I think the Mac Mini is the most expensive but also most powerful/extendable option. But ~1000 EUR for Mac Mini plus USB-3 hard drives is A LOT of money.

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 2:05 pm

USB2 is fast enough for media streaming purposes. Don't worry about USB3, but remember that USB3 drives are backwardly-compatible with USB2 controllers - i.e. don't go out of your way to get a USB2 drive if all you can get are USB3 drives - the USB3 drives will work with the Pi, but they will work at USB2 speeds.

USB2 can manage 35MB/sec, or 280Mbit/sec. If you're streaming data to the Pi over the network, you're looking at a theoretical maximum of 12.5MB/sec, or 100Mbit/sec.

My Pi2 has a USB drive for the OS and applications to run on (the SD card is just for the boot loader), another USB drive for CrashPlan backups, and another USB drive for Serviio's media library. I didn't see any reduction in performance between having one connected USB drive and having three connected USB drives.

The Pi *will not* be able to power three USB hard drives. I would strongly recommend either using self-powered USB drives, or using a self-powered USB hub and connecting your drives to that hub. Fit the Pi with a good quality power supply unit (the official Raspberry Pi PSU is good), and you should be fine.

Oh, and be sure to format the drives as EXT4 for best performance in Linux.

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 4:03 pm

Thanks! I’m using Apples iPad 2 12W power supply (charger?) …

So I’ll watch for USB hard drives which can directly be powered, as well as a hub. Though I’ve not heard good things about USB hubs.
USB2 can manage 35MB/sec, or 280Mbit/sec. If you're streaming data to the Pi over the network, you're looking at a theoretical maximum of 12.5MB/sec, or 100Mbit/sec.
What about 1000Mbit LAN? I don’t know if that works in my network, my router has ports, I’m using good cables, but I can’t tell how much Mbit there really are.

fruitoftheloom
Posts: 25801
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 4:07 pm

fooness wrote:Thanks! I’m using Apples iPad 2 12W power supply (charger?) …

So I’ll watch for USB hard drives which can directly be powered, as well as a hub. Though I’ve not heard good things about USB hubs.
USB2 can manage 35MB/sec, or 280Mbit/sec. If you're streaming data to the Pi over the network, you're looking at a theoretical maximum of 12.5MB/sec, or 100Mbit/sec.
What about 1000Mbit LAN? I don’t know if that works in my network, my router has ports, I’m using good cables, but I can’t tell how much Mbit there really are.
The RPi is 10/100 Ethernet ;)
The information is out there....you just have to let it in.

My other Linux machines are a ChromeBox & Intel CoreDuo Desktop

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 4:36 pm

Ah. Did not think about that! Though the Mac Mini probably is not. Maybe I should try it with the RPi2 first. And if it really should not work, then I can still buy that expensive Mac Mini.

User avatar
mikronauts
Posts: 2822
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Raspberry Pi 2 as replacement for server

Tue Mar 10, 2015 4:47 pm

You can get a 50% boost (clients downloading) and 20% boost (clients uploading) by adding a USB3 Gigabit Ethernet adapter over the on-board 10/100 Ethernet, which is a decent boost for a ~$15 USB Gigabit adapter.

See benchmarks at http://www.mikronauts.com/raspberry-pi/ ... ent-howto/
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Wed Mar 11, 2015 10:45 am

So, this could be a possible setup. I’m using two Raspberry Pis Model 2 because I think that the latter will cause performance problems on the first when backing up or extracting large video-files?

The first Raspberry Pi 2:

– MPD (or later Mopidy if Spotify is needed)
– Shairport
– Beets
– Kodi
– audio & video data (first external 3.5" USB-3 hard drive)
– audio & video backups (second external 3.5" USB-3 hard drive)

The second Raspberry Pi 2:

– MacBook Pro TimeMachine backups (first external 3.5" USB-3 hard drive (or dividing one in two partitions))
– pyLoad (second external 3.5" USB-3 hard drive (or dividing one in two partitions))

What do you think about that? Is it unneccessary to get a second Pi?

I know I probably won’t listen to music and watching videos at the same time … but it could be that when listening to music or watching a video my MacBook is transferring it’s WiFi backup to the Raspberry Pi 2 or that pyLoad extracts some (or a lot of) archives …

PS: The Raspberry Pi 2 is connected via Ethernet to the network. Only my MacBook is using WiFi. I don’t think that will change anytime soon.

Thanks for your advice!

cpc464
Posts: 238
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Raspberry Pi 2 as replacement for server

Wed Mar 11, 2015 2:08 pm

Given that the Pi 2 has 4 CPU cores, a single Pi might be enough to handle all tasks. For example two cores could be occupied with the backups (one reading, one writing, depending on your backup software), while a third does your media streaming. The only thing I would not be sure about is Time Machine, I don't know what resources that consumes.

There may be situations where there is contention for a single resource. Eg if you are streaming and running a remote backup at the same time, they would have to share network bandwidth - it would still work, just your remote backup would slow down a bit.

I would try putting it all on one, then buy a second if needed. But one will likely do.
Unix engineer since 1989

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspberry Pi 2 as replacement for server

Wed Mar 11, 2015 2:52 pm

Streaming from the Pi and backing up to the Pi simultaneously should be fine (each traffic stream goes in a different direction, and should flow simultaneously, assuming your Pi's network card is running at full duplex).

However, if you're restoring data and watching streaming media at the same time, then without using QoS, you won't be able to guarantee bandwidth for the streaming media - so that would stutter.

Typically this wouldn't be a common issue - you'll likely be fine on one Pi. I have two because my original Pi wasn't beefy enough to do everything, and I've kept the original Pi in service because I like having a live backup in case of system failure (hot standby beats cold standby any day). Also, my two-Pi setup allows me to upgrade one and reboot it without negatively affecting anyone in my house.

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Wed Mar 11, 2015 3:00 pm

Thanks very much to both of you! : )

technix
Posts: 126
Joined: Sat Jul 13, 2013 4:55 pm

Re: Raspberry Pi 2 as replacement for server

Wed Mar 11, 2015 7:08 pm

I have an Raspberry Pi 2 at my dorm as the main router, switching packets between a 150Mbps Wi-Fi adapter, 100Mbps Ethernet and my 10Mbps Internet connection. The old Raspberry Pi model B+ did a great job servicing all the Internet traffic but when when heavy traffic across Wi-Fi and Ethernet comes the packets start to queue up. With the Pi 2 replacing the old Pi the extra cores pretty much eliminated all packet pile ups and drops, when heavy Wi-Fi to Ethernet traffic comes.

Another Pi 2 server is running in my office as the team management server, running Apache 2.4, MariaDB 10 and PHP 5.6 stack and have a Bugzilla, a MediaWiki and a cgit instance running on it.

cpc464
Posts: 238
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Raspberry Pi 2 as replacement for server

Thu Mar 12, 2015 10:52 am

amigaholic wrote:Streaming from the Pi and backing up to the Pi simultaneously should be fine (each traffic stream goes in a different direction, and should flow simultaneously, assuming your Pi's network card is running at full duplex).
That isn't quite true. The link speed may be full duplex (level 2), but TCP transfers aren't (level 3). For example, every TCP data packet sent requires an ACK packet to be sent in the reverse direction. This will apply to both the backups and the streaming. The backups will slow down during streaming, but not much, unless you backup several clients at the same time. The video viewing shouldn't be affected.
Unix engineer since 1989

fooness
Posts: 44
Joined: Fri Aug 09, 2013 1:22 pm

Re: Raspberry Pi 2 as replacement for server

Thu Mar 12, 2015 11:05 am

Great to hear that!

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspberry Pi 2 as replacement for server

Thu Mar 12, 2015 11:25 am

cpc464 wrote:
amigaholic wrote:Streaming from the Pi and backing up to the Pi simultaneously should be fine (each traffic stream goes in a different direction, and should flow simultaneously, assuming your Pi's network card is running at full duplex).
That isn't quite true. The link speed may be full duplex (level 2), but TCP transfers aren't (level 3). For example, every TCP data packet sent requires an ACK packet to be sent in the reverse direction. This will apply to both the backups and the streaming. The backups will slow down during streaming, but not much, unless you backup several clients at the same time. The video viewing shouldn't be affected.
Well, this is embarrassing. I'm a network engineer by trade, and yet I always seem to forget about the ACK process :oops:

kteach
Posts: 2
Joined: Sun Aug 16, 2015 10:08 pm

Re: Raspberry Pi 2 as replacement for server

Sun Aug 16, 2015 10:12 pm

amigaholic wrote:Oh - totally forgot to mention - my Pi 2 also runs CrashPlan, acting as an automated backup agent for my PCs at home, and my parents' PCs over the Internet.

I don't know about Pi/TimeMachine compatibility, but CrashPlan has a Mac version. CrashPlan is *easy* to use. You don't need to back up to the cloud (CrashPlan Central), especially if you can back up to someone else's CrashPlan instance over the Internet (like my parents do to my Pi), so you can use the free edition.
I have recently started using a Raspberry Pi 2 and love it. One use I imagined was to setup a Pi 2 as a Crashplan server at my parents. I have the Pi 2 running and can SSH in to it. However, the install of Crashplan did not work for me. I see the icon on the desktop, but when I try to run it, it fails to load. Any tips? I have setup Crash plan on other Linux boxes and not had a problem. Thanks for any tips.

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Raspberry Pi 2 as replacement for server

Mon Aug 17, 2015 12:59 pm

CrashPlan's Linux installer is actually quite stupid. It makes no attempt to acknowledge which architecture your Linux system is running, and just blindly assumes you're using an x86/x64 setup. Which of course will mean ARM devices like the Pi can't run it.

But don't quit quite yet. You just need to replace a couple of the .so library archive files that come with it. The following guide is clear and well-written, and despite looking quite long and daunting, is actually fine. It tells you the complete steps involved in getting CrashPlan to work on the Raspberry Pi.

https://melgrubb.wordpress.com/2014/08/ ... crashplan/

Hope this helps!

kteach
Posts: 2
Joined: Sun Aug 16, 2015 10:08 pm

Re: Raspberry Pi 2 as replacement for server

Mon Aug 17, 2015 2:30 pm

This look fantastic. Thank you for directing me to this!

Return to “Networking and servers”