Home server, or 6-year adventure. Part one

Hello, Habr, we haven't seen each other for a long time.



Today I would like to tell you about my home server: what mistakes I made, what configuration I stopped on, and in general - why did I do it.











Disclaimer: some part of the software discussed in the article can be used free of charge for informational purposes only or with limited functionality, please, before using, check the developer's website for licensing and the possibility of using the software for your home.



The story began back in 2014, there are myths that once the dollar was 32 rubles for one green, the grass was greener, the sky was cleaner, and there was so much enthusiasm that I started doing things that I will discuss below in the article, now I would I didn't dare to do this anymore.



One fine day, disassembling my wires and boxes on the closet, and laying out the remaining hardware from repairing old PCs of friends, relatives and acquaintances, I suddenly decided to create a central backup storage for family photos, a home CCTV, make a media server for easy watching movies and serials, and a lab for all sorts of experiments would also not hurt, such a home NAS with extended functionality. A similar idea has flashed in my head for some time, but everything was not up to her - either something of iron was not enough, or time, and then everything just came together.



Actually, it all started with several hard drives of different sizes, as a processor I took an old Intel i3-2120 3.3Ghz and 4GB RAM DDR3 (2 slots of 2GB each), some old very Chinese case, which, as you can see in the photo, has been modified literally with a file, although in fact there were also nippers and a hammer, and I was sawing something with a hacksaw. As a motherboard, an MSI B75MA-E31 decommissioned from the office was taken (it was written off because after each reboot the BIOS settings flew in it and she constantly asked to adjust the time and other parameters), as it turned out later, when I did take it, in she mowed the connector for the CR2032 battery, armed with a multimeter, a soldering iron and a couple of other dead motherboards,I managed to re-solder the entire socket with the battery contacts and restore the normal operation of the motherboard.



The result is something like this:









In fact, in the photo there is an option already with integrated baskets for HDD, a little earlier the “server” was assembled without them just within the frames of the housing for the HDD, but I did not find a photo of that option, although, as I remember, the first option was quickly modernized baskets to the state as in the photo, so it conveys the essence very accurately, so and so and the production.



What about the software you ask, and so initially Windows 10 was chosen as the operating system ...









Actually, this choice later brought a huge amount of inconvenience. some software stopped working during automatic installation of updates and other situations typical for user versions of Windows running without lengthy reboots.

But the initial experience was gained and for some time I used shared folders from this machine, made that very cherished copy of family photos, and began to collect my home media library.



For home CCTV (video surveillance), I bought several D-Link dcs-2130 cameras on Avito, for a start, the cameras were very good, but the big disadvantage of these cameras was the need to use a power supply with a rather short wire, I ended up extending the wire using a twisted couples - it turned out quite well.









Later I got a couple of cameras with night mode recording (shooting with infrared light), which have also been used for a while.









In terms of software, I tried many options: first, the native software from D-link, which at that time was just awful, then I tried “Line IP”, “Trassir” and “iSpy”, as far as a knowledgeable reader will understand, “Line IP” and "Trassir" imposed multiple restrictions in trial modes, and again I could not estimate any of the solutions as ideal for myself, as a result, for a long time I settled on an open source free software for organizing video surveillance - "iSpy".



iSpy already at that time allowed using motion recording scripts, video export, convenient search by zones, etc. Within the framework of this article, I would not like to dwell on this software in detail, but the main thing that is worth saying is that it suited me then and allowed me to solve the problem before me, although the interface could hardly be called convenient and understandable for the user.



After six months or a little more, having worn out with Windows, I decided that I should try something stable as the main operating system, which does not require constant reboots and updates, based on Unix / Linux.



As a result, the choice fell on FreeNas. I lived with him for a long time and did not grieve, using plugins to expand the basic functionality and balls with Windows ACL support, Emby in jail for DLNA coped with their tasks, disks of different sizes were easily glued into fault-tolerant RAID arrays.



I tried all the available RAID configurations, ran a huge variety of read and write speed tests, IOPS tests, studied the theory on arrays and file system types, and generally had a good time.



I don’t remember exactly, but freenas pleased me for about a year, if not more, but there were 2 main reasons why I decided to change the operating system of my server again.

The first was that I could not find a solution for home CCTV that would satisfy me that would work on FreeNas, I apologize to the readers, I do not reliably remember which options I tried to use and what I experimented with on FreeNas in terms of CCTV, but I do remember exactly, that I did not find a good solution then.



And the second reason was the lack of flexibility for experimentation. In particular, with Windows and Linux virtual machines, and now at work, we decided to try Windows Hyper-V and in order to broaden my horizons and forcibly get some skills, I returned to Windows again, only now Windows Server 2012.









By the way, by this time I had freed up RAM from the main PC - 2 strips of 4GB DDR3 each, so I already had 8GB for my daring ventures.



And I also bought a LSI 8888ELP RAID controller for 4500 rubles from my hands (all in the same place on Avito), completely new, in a box and film.



Of course, I immediately received several unpleasant reminders that the Windows system administrator must suffer by definition - creating virtual machines with Linux turns out to require disabling the secure boot in the hypervisor and some more dancing with a tambourine, and if no machine is running now, then Windows Server again it tries to update and reboot, or in the morning I found a blue screen, tk. Windows once again didn't like something there and other joys of life with Microsoft products.



But the goal of learning Microsoft Hyper-V, Microsoft's core virtualization functionality, was achieved.



As for the software for solving the initial tasks, everything remained approximately the same:



  • CCTV-iSpy, at that time I was already used to this software and it seemed great to me. To sync photos, like the first time on Windows 10, I used the Goodsync software - quite good software, it has many settings and modes, but, as usual, a lot of things are not available in trial mode.
  • Windows balls for sharing files - only now I have already set up authorization via AD, yes, yes, I raised the domain, again for the interest and complication of life for my beloved, I have worked with AD for many years within the organization, but I tried something like that on a real domain is scary, but I don't want to break it.
  • transmission, webui .
  • DLNA — Plex. -, . , “”, , , Plex.
  • HFS — http file server ( rejetto) , ddns+nat.


Only now the software was split into different virtual machines in an attempt to save resources. Also, periodically appeared and left virtual machines on linux, debian, ubuntu, centos. As time went on, ideas were ripening in my head that it was necessary to wrap up with the protracted trial of Windows Server 2012, and Hyper-V was no longer so interesting. I have already considered what to put next as an OS and where to put the accumulated data on the server now. Of course, I have 2 more personal computers, one is mine, the second is for my wife, there are also some volumes on the hdd, but the server data did not fit.



But at the end of 2016, about 15-17 tortured, but quite working 1 TB disks, without BAD blocks, fell on me for nothing. Actually, it was a sin not to adapt them to a home server, but there was a problem - the motherboard had only 3 SATA II and one SATA III slots, there was also an LSI 8888ELP RAID controller - this is another 8 SATA ports, and even bought by me at some point the Espada PCIe-4 x SATA III expansion cards did not allow to assemble something sane in this case.



I began to study the market for used supermicro servers for the purchase of a 3U-4U server with hotswap baskets, CPU, RAM, etc. I also really wanted to get IPMI (iLO in HP terms), that is, KVM over IP, so that it was possible to connect to the server via IP in a web or java application. Although the server until that time lived in a bedside table under the TV (where normal people usually have Playstation and Xbox) and was connected via HDMI to the same TV, but each time to control I had to switch the keyboard from my PC (while Windows Server was working properly, Without updating anything and without hanging in the blue screen, of course I connected via RDP) - accordingly, IPMI would be very useful, and it seems that I never bought myself a birthday present.









I cut the picture from the video, so I apologize for the quality, but as you can see, the “server” lives on the bottom shelf, and doesn't bother anyone.



But after studying the prices, I very quickly diminished my wishes, both in terms of the processor, the amount of RAM, and the presence of IPMI, nevertheless, everything that I found was still dear to me. A week later, tired of fighting a toad and rummaging through flea markets, I decided to buy a Dell PowerVault MD1000 (DAS) disk shelf with a cable for the Raid controller (SFF8088-SFF8470), which I actually planned to connect the shelf to my server via an external port on RAID -card. The shelf cost me 23 800 rubles, and the cable another 3000.



My gift arrived from the glorious city of St. Petersburg, delivered by a logistics company, carefully packed in a wooden pallet, wrapped in film and protective packaging:







The photo of the pallet after I removed the disk shelf from it, I disassembled it with a knife and a screwdriver, everything about everything took about 40 minutes.



I knew that the shelf would be heavy, but the fact that I would curse everyone and everything including myself for this idea - I could not even imagine! Before I even got the disk shelf out of the pallet (and it was nailed there), I already knew that this would be another adventure. 



Surprisingly, I could not find any photos of the disk shelf separately, so I will attach a photo from the Internet:









And in the photo below you can already see the server with the shelf assembly, in the nightstand on the balcony.









The bedside table was, of course, made by myself, everything was as it should be - first I designed it in some online program and printed out the cutting of the material on a piece of paper, then to OBI, where I went to get the material, as usual, there was no such board from the site for which I printed out the cut, so I took the option available for 2mm thicker, warned it on the cut, but naturally one takes orders for cutting, the other wears, the third cuts, somewhere in the communication these 2 mm are lost. Of course, I assembled the bedside table, but 2 mm of "error" is a huge difference when assembling furniture.



The article came out much longer than I originally expected, but we only got to the middle of the story, and the wife already requires attention.



And yes, the server actually ended up on the balcony, both in summer and in winter. Why did this happen? Those who have turned on an enterprise-level disk shelf at least once have already guessed, but for the rest I will describe the sensations (including not only my own) in the second part!



All Articles