On to next challenge : MySQL and XBMC! =)

Status
Not open for further replies.

Halfe

Explorer
Joined
Apr 24, 2013
Messages
94
i get this when i try to enter Jail after upgrading from 8.3.0 to 8.3.1 p2
i cant enter jail.

~# jexec 1 csh
jexec: jail_attach(1): Invalid argument

help :)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
i get this when i try to enter Jail after upgrading from 8.3.0 to 8.3.1 p2
i cant enter jail.

~# jexec 1 csh
jexec: jail_attach(1): Invalid argument

help :)

You shouldn't be posting a general jail problem here, this thread is focused on mysql.

I bet your jail is now a different jail id (jid)
Code:
jls
jexec 2 csh
 

Halfe

Explorer
Joined
Apr 24, 2013
Messages
94
well I got everything working perfectly. 2 xbmc installs, syncing their media sources, thumbnails, and video databases.
NOTE - jail ip=192.168.1.30, freenas(nfs) ip=192.168.1.4

_______________________________________________________________________________
#in freenas shell
jexec 1 csh

#in jail
pkg_add -r mysql55-server
pkg_add -r mysql55-client
mysql_secure_installation

vi /etc/rc.conf
#add in
mysql_enable="YES"
#
service mysql-server start

mysql -u root -p
#in mysql
CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
GRANT ALL ON *.* TO 'xbmc';
quit;

OKAY. typed in this with no errors bt dunno if its working Where can i check this



_______________________________________________________________________________
### on my xbmc boxes ( .xbmc/userdata/advancedsettings.xml )
<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>192.168.1.30</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>
<pathsubstitution>
<substitute>
<from>special://masterprofile/Thumbnails/</from>
<to>nfs://192.168.1.4/mnt/RAID/Media/xbmc/Thumbnails/</to>
</substitute>
<substitute>
<from>special://masterprofile/sources.xml</from>
<to>nfs://192.168.1.4/mnt/RAID/Media/xbmc/sources.xml</to>
</substitute>
<substitute>
<from>special://masterprofile/mediasources.xml</from>
<to>nfs://192.168.1.4/mnt/RAID/Media/xbmc/mediasources.xml</to>
</substitute>
</pathsubstitution>
</advancedsettings>
_______________________________________________________________________________

to>nfs://192.168.1.4/mnt/RAID/Media/xbmc/sources.xml</to>


The nfs adress? where is that linked to. is that the Jail? or is it the location on the server like the CFIS share??
 

fernicus

Cadet
Joined
Mar 19, 2013
Messages
7
I'm hoping someone can help me as even the simplest of anything on this FreeNAS doesn't work. My original server broke and I had to start from scratch. Now when trying to install mysql again it will not pull in from the ftp site. What am I doing wrong? I've spent hours trying to find a solution and can't see anything. I can actually go to FreeBSD and see the file, but can't pull it in.

[root@freenas ~]# jexec 1 csh
Jail# pkg_add -r mysql55-server
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3- release/Latest/mysql55-server.tbz: No address record pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages -8.3-release/Latest/mysql55-server.tbz' by URL
Jail#
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm hoping someone can help me as even the simplest of anything on this FreeNAS doesn't work. My original server broke and I had to start from scratch. Now when trying to install mysql again it will not pull in from the ftp site. What am I doing wrong? I've spent hours trying to find a solution and can't see anything. I can actually go to FreeBSD and see the file, but can't pull it in.

[root@freenas ~]# jexec 1 csh
Jail# pkg_add -r mysql55-server
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3- release/Latest/mysql55-server.tbz: No address record pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages -8.3-release/Latest/mysql55-server.tbz' by URL
Jail#

Can you resolve DNS records from within your jail?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm able to ping both the freenas IP and my jail IP address with no problems.

This doesn't answer the question about DNS.
 

bcrowder

Dabbler
Joined
Jan 6, 2012
Messages
36
Joshua Parker Ruehlig, I'm running FreeNAS-8.3.1-RELEASE-p2-x64 (r12686+b770da6_dirty) with MySQL in a jail. Would like to upgrade Freenas to 9.1. I have 12TB of storage on the server, would really like to not have to rebuild the XMBC DB. What are my options, if I have to rebuild the db and reinstall the jail and MySQL I can do that. Just want to be cover the bases before I do any major surgery on the server. I have not upgraded the jail the last few upgrades. Server feeds 4 XMBC Frodo systems and also contains backups and N: drive for the house and families PC's.

Thanks,
Bill
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Joshua Parker Ruehlig, I'm running FreeNAS-8.3.1-RELEASE-p2-x64 (r12686+b770da6_dirty) with MySQL in a jail. Would like to upgrade Freenas to 9.1. I have 12TB of storage on the server, would really like to not have to rebuild the XMBC DB. What are my options, if I have to rebuild the db and reinstall the jail and MySQL I can do that. Just want to be cover the bases before I do any major surgery on the server. I have not upgraded the jail the last few upgrades. Server feeds 4 XMBC Frodo systems and also contains backups and N: drive for the house and families PC's.

Thanks,
Bill

you can mysqldump the database as a backup and use that to restore on a new jail install
 

King_Silas

Cadet
Joined
Jun 29, 2013
Messages
3
Hi guys,
Followed the guide on the 2nd page (thanks alot bcrowder).
Can't entirely tell if its working or not though, i started XBMC library was completely blank, so i added a source to see if it would create /xmbc/settings etc but i can't see anything in freenas.
Any ideas?
 

FlangeMonkey

Contributor
Joined
Dec 6, 2012
Messages
111
Joshua Parker Ruehlig, I'm running FreeNAS-8.3.1-RELEASE-p2-x64 (r12686+b770da6_dirty) with MySQL in a jail. Would like to upgrade Freenas to 9.1. I have 12TB of storage on the server, would really like to not have to rebuild the XMBC DB. What are my options, if I have to rebuild the db and reinstall the jail and MySQL I can do that. Just want to be cover the bases before I do any major surgery on the server. I have not upgraded the jail the last few upgrades. Server feeds 4 XMBC Frodo systems and also contains backups and N: drive for the house and families PC's.

Thanks,
Bill

I've probably missed the boat on this one, but I went through this and had major problems with the jail from 8.3. My jail worked and I got it migrated using the migration script. It was all good to start off with, but when I started messing around with the new jail system, my jail from 8.3 got deleted for no apparent reason. I have no idea why and have no information on how, because I was doing so much stuff, but I can tell you I didn't click delete.

So my advice is create a snapshot of your jail system before the upgrade and after running the migration script, together with any other backups of the DB data. I didn't create a snapshot post upgrade (I should know better), so I couldn't restore it as the new system is very different, but I had backups. My DB on 8.3's jail had symbolic links to a dataset outside the jail, so smeg-ups on the jail wouldn't affect the data. After installing mysql on a new jail, the process was mostly painless getting it restored and up. Another peace of advice is to create a dataset for the XBMC DB and Periodic snapshots.

For me one of the best thing about the new version is the jail system. It plays into the hands of doing stuff like this. Now I have a separate jail for my XBMC db.

In hindsight, I'd wait until 9.1.1. Its around the corner!
 

FlangeMonkey

Contributor
Joined
Dec 6, 2012
Messages
111
Hi guys,
Followed the guide on the 2nd page (thanks alot bcrowder).
Can't entirely tell if its working or not though, i started XBMC library was completely blank, so i added a source to see if it would create /xmbc/settings etc but i can't see anything in freenas.
Any ideas?

Hi King,

I didn't follow this guide when I did my install and it was a while ago, so its a little hazy.

I don't completely understand what peace your referring to. You can see if the DB is created, by logging into the jail and doing the following and if you see the additional DB's then you know its created them:

mysql -u root -p
show databases;

Now, the additional thing I do is add a name into the xbmc config file to name the database like this:

<videodatabase>
<type>mysql</type>
<host>X.X.X.X</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
<name>MasterVideo</name>
</videodatabase>

It just makes it easier to control the databases and manage them. If you later want more than one profile, with a different DB or to test something, you can control it by changing the name.

If your talking about the xbmc xml files, make sure you have the correct permissions on the folder so the xbmc user can read and write to them. The files my need to be available before running xbmc, so if you have them from your local profile, just copy them into the new location and restart xbmc.

If you can provide a little more info on what your problem is, we might be able to help.
 

Steven Sedory

Explorer
Joined
Apr 7, 2014
Messages
96
When I run "mysql_secure_installation" after installing the packages ("pkg install mysql55-server"), I get the following error right after if asks me for the current password for root: "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" Any ideas?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
When I run "mysql_secure_installation" after installing the packages ("pkg install mysql55-server"), I get the following error right after if asks me for the current password for root: "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" Any ideas?
sounds like you didn't start mysql
Code:
sysrc 'mysql_enable=YES'
service mysql-server start
 

Steven Sedory

Explorer
Joined
Apr 7, 2014
Messages
96
sounds like you didn't start mysql
Code:
sysrc 'mysql_enable=YES'
service mysql-server start

Joshua, thanks for your quick reply. When I start the service, it says starting service, then goes back to #. If I type service mysql-server status, it shows as if it isn't running, so I don't think it's actually starting.

I'm assuming it's a permission error maybe? But what would I change and where?

Just so you know, I even created a new jail, and tried the same steps, and received the same error.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

Steven Sedory

Explorer
Joined
Apr 7, 2014
Messages
96
Dude, that is exactly what I'm looking for...using MySQL instead of sqlite (or whatever it's called). Thank you very much. I will follow it step by step.

For the record, I simply did the following:

entered OC jail that was created by FreeNAS plugin by running jexec -u root 2 csh

then, because the FreeBSD 9 port for mysql was missing on ftp.freebsd.org (I got an error when running pkg_add ... about it missing), I instead ran pkg install mysql55-server

the above apparently installed the client as well

the next step was running mysql_secure_install, which is where I got the error mentioned
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Dude, that is exactly what I'm looking for...using MySQL instead of sqlite (or whatever it's called). Thank you very much. I will follow it step by step.

For the record, I simply did the following:

entered OC jail that was created by FreeNAS plugin by running jexec -u root 2 csh

then, because the FreeBSD 9 port for mysql was missing on ftp.freebsd.org (I got an error when running pkg_add ... about it missing), I instead ran pkg install mysql55-server

the above apparently installed the client as well

the next step was running mysql_secure_install, which is where I got the error mentioned
I see glad it's helpful.
 

Steven Sedory

Explorer
Joined
Apr 7, 2014
Messages
96
Joshua, thank you so very much. Everything is working great. You take paypal donations or something?
 
Status
Not open for further replies.
Top