SOLVED MariaDB in FreeNAS jail - recordsize question

Status
Not open for further replies.

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
Hi Guys,

I would like to set a MariaDB server inside a FreeNAS jail and I have a question regarding the zfs part..

On my database production server runing zfs, we had to run the following command to make sure the database work well on zfs system
Code:
zfs create -o recordsize=16k -o primarycache=metadata zroot/usr/jails/mariadb/var/db/mysql-innodb
zfs create -o recordsize=128k -o primarycache=metadata zroot/usr/jails/mariadb/var/db/mysql-innodb-logs
zfs create -o recordsize=8k -o primarycache=metadata zroot/usr/jails/mariadb/var/db/mysql
zfs set compression=off zroot/usr/jails/mariadb/var/db/mysql-innodb
zfs set compression=off zroot/usr/jails/mariadb/var/db/mysql-innodb-logs
zfs set compression=off zroot/usr/jails/mariadb/var/db/mysql

/usr/jails/jails-data/mariadb-data/var/db /var/db nullfs rw 0 0
/usr/jails/jails-data/mariadb-data/var/db/mysql /var/db/mysql nullfs rw 0 0
/usr/jails/jails-data/mariadb-data/var/db/mysql-innodb /var/db/mysql-innodb nullfs rw 0 0
/usr/jails/jails-data/mariadb-data/var/db/mysql-innodb-logs /var/db/mysql-innodb-logs nullfs rw 0 0


When I install MariaDB inside FreeNAS jail, how do I deal with recordsize?
Should I run the command above in the FreeNAS host box? will the command survive a reboot?

Thank you all in advance
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
You create the datasets on the host system. It's all right there under advanced.

upload_2017-6-29_16-0-49.png
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
@m0nkey_ thank you for the reply..
I can see that i can create the dataset from the screnshot you provided but how do I set the recordsize?
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
umm..sory once more question..
How do I create the dataset to be zroot/jails/MariaDB/var/db/mysql-innodb?
I cannot see an option to specify the path.
When I type the following in the Dataset Name:var/db/mysql-innodb I get this message:
Code:
Dataset names must begin with an alphanumeric character and may only contain "-", "_", ":", " " and ".".
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
For the host system, it shouldn't matter where the dataset is. It's when you add storage to the jail you specify the mount point.
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
@m0nkey_ thank you for your patience..
I tried to add the storage to the jail but I got confuse with it..
Do i need to add /mnt/zroot/jails/MariaDB/var/db/mysql-innodb in both source and destination?
Here is my screenshot
open
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Do i need to add /mnt/zroot/jails/MariaDB/var/db/mysql-innodb in both source and destination?
Source is where the directory you want to use appears in your FreeNAS filesystem. Destination is where you want it to appear in your jail. Your destination would be /var/db/mysql-innodb. Your Source would be wherever this dataset is in your FreeNAS system.
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
Source would be wherever this dataset is in your FreeNAS system.
Sorry sorry guys but how do i create the source dataset jails /mnt/zroot/jails/MariaDB/var/db/mysql-innodb where do i go?
is it at cmd line?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
is it at cmd line?
No, nothing is at the command line. You don't create a dataset in /mnt/zroot/jails/MariaDB. You create it elsewhere on your pool (i.e., not within the jails dataset). You might, for example, create it as zroot/dbstore. You'd then enter /mnt/zroot/dbstore as the source, and /var/db/mysql-innodb as the destination.
 
Status
Not open for further replies.
Top