Resource icon

[HOWTO] FreeNAS 11, RancherOS (Docker), and Portainer

miich94

Dabbler
Joined
Mar 26, 2016
Messages
41
hmm seems that its stuck on connected now, will see tomorrow how to fix it.
 

ThomasDK81

Dabbler
Joined
Mar 19, 2012
Messages
49
Whats the current state of running RancherOS on FreeNAS 11 ? Is it functional?
I followed this guide and it Works very well.
Some of the instructions are with wrong case, indention etc. All of those are corrected in replies in this thread.

I had zero experience with Rancher OS, Docker, Portainer.

Would love Docker integrated, but it seems like it postponed for "later".


Sent from my iPhone using Tapatalk
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Could @SaskiFX update the first post to reflect all the later corrections so there's no need to go through all the posts to get it done right? This way this thread can be a a real how-to guide. :)
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Firstly, thanks to the OP the guide and everyone who has contributed to the thread.

I managed to get portainer up and running jumping back and forth through the pages. It would be a really great resource if the OP could be updated with the later improvements so everything was together?

Now just to work out what docker is all about and how I might use it :D
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
Firstly, thanks to the OP the guide and everyone who has contributed to the thread.

I managed to get portainer up and running jumping back and forth through the pages. It would be a really great resource if the OP could be updated with the later improvements so everything was together?

Now just to work out what docker is all about and how I might use it :D

The latest freenas has docker "built in" via rancheros. It replaces the jails and VM's in most cases and the apps will get updated more often in docker than the jails do.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,175
No, Docker is not a replacement for jails. The mere fact that it runs in a VM automatically makes jails much more attractive, as performance will be significantly better.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,455

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
No, Docker is not a replacement for jails. The mere fact that it runs in a VM automatically makes jails much more attractive, as performance will be significantly better.

I believe I specifically said in MOST cases to avoid this exact lecture.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,455
I believe I specifically said in MOST cases to avoid this exact lecture.
...and even with that qualifier, many (perhaps most) of us would disagree.
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
...and even with that qualifier, many (perhaps most) of us would disagree.

It's a free country. Bottom line is this guide is very dated since recent release(s) have incorporated docker via rancheros into the os and gui.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I've been playing around with it and can see some advantages of running services through a Docker VM. Still haven't really got my head around the storage and the correct process for creating and editing containers, but it was pretty simple to spin up a Nextcloud, MariaDB and Onlyoffice container for internal testing. I guess where things aren't available in FreeBSD (like Onlyoffice) it's a cleaner solution than multiple VMs.

This gives me something to play around with and try to understand how I might use it when I update to a newer version of FreeNAS. I was still hanging onto 9.10.1-U1 for VirtualBox, but I think I've got things running using iohyve/bhyve now. The worry I've got now is how all these iohyve create VMs will work when I do build up the courage to upgrade to 11.x. And what about my 9.3/9.10 jails with iocage?

Updating FreeNAS just seems fraught with danger these days. If you jump too soon you might end up down a dead end with Corral, but if you leave it too long so many things have changed who knows what might still work? If only I'd just stuck to using FreeNAS for file sharing :D
 

tezzlicious

Cadet
Joined
Aug 7, 2018
Messages
1
I should also mention I am using FreeNAS with a ssd cache drive on ZFS, I have read that the write sync can cause issues with NFS. I can also note that NZBGet downloads are incredibly slow when they used to be lightning fast in a FreeNAS Jail.

Did you find a solution or did we hit the bottom here? My file transfer rates using Rancher & Docker with NFS are painful slow.
 
Last edited:

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Last time i played with docker on freenas, which is quite some time ago so i cannot comment on speed. however, i don't remember any issues in terms of nfs speed.
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
It's a free country. Bottom line is this guide is very dated since recent release(s) have incorporated docker via rancheros into the os and gui.

I actually went away from most of the virtualization on freenas and went bare metal with rancherOS. There is a reason paypal, visa, GE, Business Insider, Spotify, Yelp, ADP, eBay, Expedia, Groupon, ING, New Relic, The New York Times, Oxford University Press, PayPal. Sage, Shopify, The Washington Post and Uber and hundreds of universities use docker.
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
The new howto would be quite straight forward:

VM -> hit + -> fill out -> hit start

hit connect

presented with rancher@rancher:> console

username rancher password docker

add storage:

sudo su
vi /var/lib/rancher/conf/cloud-config.d/nfs.yml

hit i (for insert)
ctr+shift+v
Code:
#/var/lib/rancher/conf/cloud-config.d/nfs.yml
write_files:
  - path: /etc/rc.local
   permissions: "0755"
   content: |
	 #!/bin/bash
	 [ ! -e /usr/bin/docker ] && ln -s /usr/bin/docker.dist /usr/bin/docker

rancher:
  services:
   nfs:
	 image: d3fk/nfs-client
	 labels:
	   io.rancher.os.after: console, preload-user-images
	   io.rancher.os.scope: system
	 net: host
	 privileged: true
	 restart: always
	 volumes:
	   - /usr/bin/iptables:/sbin/iptables:ro
	   - /mnt/docker:/mnt/docker:shared
	   - /mnt/dbs:/mnt/dbs:shared
	 environment:
	   SERVER: 192.168.0.2
	   SHARE: /mnt/zpool/docker
	   MOUNTPOINT: /mnt/docker

#cloud-config
mounts:
  - ["192.168.0.2:/mnt/zpool/dbs", "/mnt/dbs", "nfs", ""]


hit ESC
type :x!

sudo reboot
check if /mnt/dbs and docker is properly mounted
 

l0calh05t

Cadet
Joined
May 11, 2019
Messages
1
I set up rancher quite a while ago using this guide and recently updated to rancher 1.5.x from 1.0.x... without creating a snapshot first. Big mistake. Because it now appears to hang on boot. If I iohyve console into the VM it is completely unresponsive. The only way to exit is an iohyve conreset in another SSH terminal and the only stop command to which the VM reacts is iohyve forcekill. I have tried removing my grub.cfg (which uses wildcards), which causes the grub> prompt to show up as expected, but as soon as I issue the boot command the behavior is the same as before, no matter if I use the new vmlinuz and initrd or the old ones.

Any suggestions?

Further info:
  • The available vmlinuz files are vmlinuz-4.9.24-rancher vmlinuz-4.9.40-rancher vmlinuz-4.14.85-rancher
  • The available initrd files are initrd-v1.0.1 initrd-v1.0.4 initrd-v1.5.1
  • At some point after the boot rdmsr to register 0x34 on vcpu 0 appears on the SSH console from which I issued iohyve boot RancherOS, but nothing changes wrt console behavior
 
Last edited:

SaskiFX

Dabbler
Joined
Mar 18, 2015
Messages
27
I set up rancher quite a while ago using this guide and recently updated to rancher 1.5.x from 1.0.x... without creating a snapshot first. Big mistake. Because it now appears to hang on boot. If I iohyve console into the VM it is completely unresponsive. The only way to exit is an iohyve conreset in another SSH terminal and the only stop command to which the VM reacts is iohyve forcekill. I have tried removing my grub.cfg (which uses wildcards), which causes the grub> prompt to show up as expected, but as soon as I issue the boot command the behavior is the same as before, no matter if I use the new vmlinuz and initrd or the old ones.

Any suggestions?

Further info:
  • The available vmlinuz files are vmlinuz-4.9.24-rancher vmlinuz-4.9.40-rancher vmlinuz-4.14.85-rancher
  • The available initrd files are initrd-v1.0.1 initrd-v1.0.4 initrd-v1.5.1
  • At some point after the boot rdmsr to register 0x34 on vcpu 0 appears on the SSH console from which I issued iohyve boot RancherOS, but nothing changes wrt console behavior

Amusingly, I just did an upgrade like this on my RancherOS bare metal install. It ate everything and blew up my settings. I am re-creating from scratch.
 

Savell Martin

Contributor
Joined
Jun 10, 2013
Messages
164
So I've followed this for the most part.
But creating a user in Portainer isnt persistent:
[root@rancher mnt]# adduser -u 1020 share
Changing password for share
New password:
Retype password:
passwd: password for share changed by root
[root@rancher mnt]# ls -lrth
total 20
drwxrwxr-x 2 share share 2 Jul 11 16:53 downloads
drwxrwxr-x 6 share share 6 Jul 11 16:55 docker
drwxrwxr-x 8 share share 8 Jul 11 16:55 media
[root@rancher mnt]# reboot
[root@rancher mnt]# ls -lrth
total 20
drwxrwxr-x 2 1020 1020 2 Jul 11 16:53 downloads
drwxrwxr-x 6 1020 1020 6 Jul 11 16:55 docker
drwxrwxr-x 8 1020 1020 8 Jul 11 16:55 media

Any ideas how I can get this to stay?
 
Top