PDA

View Full Version : how to create/share NFS shares?


jonesy
01-04-2008, 03:10 AM
Ok, *now* the docs are starting to really annoy me. They are proving themselves worthless as a reference, though I suppose if I had time to read a novel, maybe they'd be better.

I need to do something that is so drop-dead simple in a non-3tera environment that I cannot believe the trouble I'm having doing it here.

I need to share files between two database servers. Actually - just one file. My options, as I see them, are this:

1. scp the file from one to the other. However, the file is like 8GB in size, and it's a dump file that just needs to be redirected to mysql. NFS is a bit more efficient for this. Also, I'd have to create explicit connections between the two database servers for the sole purpose of moving one file, because otherwise they don't resolve each others' names, so this means creating terminals... :-/

2. create an nfs share on a nas device, share it between probably all of the appliances so that I never need to mess with this again and files can be shared between any two appliances.

What I did was this:

I created an app-level volume called 'share'.
I mapped my nas appliance's 'data' volume to 'share'.
I made connections from my db servers to the nas.

Now, from there, it seems like I should be able to go to 'User Volumes' on my db servers, and tell them to mount something via nfs to some local placeholder directory. This is not possible. All of the random clicking and restarting has not worked, searching the docs has turned up nothing, and while the documentation on the NAS appliance tells you *what* it's used for, there are no clues *how* to use it. If such documentation *does* exist, your help is hereby solicited.

So.... how can I create a 150GB NFS share that can be mounted by all of my appliances via my NAS appliance?

jonesy
01-04-2008, 04:02 AM
A quick update: I can't even mount *manually*. I can ping the nas from the db servers, but putting an entry in fstab, and manually running 'mount -t nfs nas:/mnt/data /mnt/foo' get me nowhere, the latter giving the classic "wrong fstype, or bad superblock..." error, which is a red herring. The logs on nas seem to indicate that no requests are coming in. tcpdump on the nas confirms this.

Back on the client end, there is no 'locate' command, and no 'man' command installed on the machines, but I did not see a mount_nfs command installed. Using /etc/init.d/netfs fails silently. There is also no tcpdump command on the MYSQL5 appliance (but there's one on nas, which is inconsistent and truly annoying). So I don't even really know if packets are leaving the client - all I do know is that I can ping the nas either using hostname or IP address, but running mount with either the hostname or IP address fails.

brian.
PS:
Why the heck is *man* of all things not installed?! I've written a book on system administration, but do you really believe admins don't use 'man' on a regular basis? Do you really think I remember every tcpdump flag in existence? I don't. Nobody does. IIRC, default installs of every version of Red Hat and its variants have man installed as a part of the base, or at least as part of a non-'minimal' install.

PPS: please lengthen the login timeout on this forum, it's just ridiculously short. In the time it took me to give the proper thought to this post, it timed out and I nearly lost my entire post.

PeterNic
01-04-2008, 04:07 AM
Brian,

The User Volumes controls what block devices you will have attached to your appliance -- like you did with the "share" app-level volume. NFS is a file-level protocol, so you can't mount it as a block device, right?

If you already have your MySQL server appliance connected to the NAS's nfs terminal, all you need to do is mount the nfs share as you would on a physical server. The only difference is the host name -- use the name of the output on the MySQL appliance (assuming you called it fs, then use 'fs' as a host name). See the WEB appliance on how this is done -- either in the /etc/fstab or in one of the startup scripts in the /appliance directory.

Without asking you to read the docs as a textbook, please read at least the http://doc.3tera.net/AppLogic2/AdvApplicationModel.html document from the concepts section of the docs -- it will save you a lot of frustration.

!!! Just a caution to others who read this post -- this describes how to access dump and other files on a shared file system between two database appliances. Do NOT put your database on the NAS box -- even though it may appear to work, you will be getting in a whole lot of trouble unless you know exactly what you are doing. The database store should reside on the block volume (e.g., /dev/hda3 as /mnt/data) -- most database servers will not gracefully allow shared access to the main database store. !!!

Regards,
-- Peter

PeterNic
01-04-2008, 04:20 AM
PS:
Why the heck is *man* of all things not installed?! I've written a book on system administration, but do you really believe admins don't use 'man' on a regular basis? Do you really think I remember every tcpdump flag in existence? I don't. Nobody does. IIRC, default installs of every version of Red Hat and its variants have man installed as a part of the base, or at least as part of a non-'minimal' install.


Brian, the base images for all appliances have been heavily compacted. Normally, users have nothing to do inside the appliance. There is only a marginal value in having 300 copies of the full man pages, gcc and a whole lot of things that you would normally install on a physical server... appliances are compact and small; you may run 20-40 of them per physical server. Think of them as embedded boxes.

If you need the man pages: (a) use your own desktop Linux, (b) instantiate a GSC app and/or have a LINUX appliance temporarily -- those are regular installs of Linux, minimal+gcc, with all man and info stuff that comes with the corresponding Linux distro, or (c) branch the appliance, resize the boot volume and install away.


PPS: please lengthen the login timeout on this forum, it's just ridiculously short. In the time it took me to give the proper thought to this post, it timed out and I nearly lost my entire post.

I am not sure there is a timeout at all -- I believe it creates a post number upon submit. Maybe you hit a bug in the forum system; we'll look into this.


Regards,
-- Peter

PeterNic
01-04-2008, 04:34 AM
A quick update: I can't even mount *manually*. I can ping the nas from the db servers, but putting an entry in fstab, and manually running 'mount -t nfs nas:/mnt/data /mnt/foo' get me nowhere, the latter giving the classic "wrong fstype, or bad superblock..." error, which is a red herring. The logs on nas seem to indicate that no requests are coming in. tcpdump on the nas confirms this.

Back on the client end, there is no 'locate' command, and no 'man' command installed on the machines, but I did not see a mount_nfs command installed. Using /etc/init.d/netfs fails silently.


It is possible that the MySQL appliance does not have the user mode nfs client utilities... I doubt it but check. Most catalog appliances are based on LUX/LUX5; those are shrunk installations of Linux. If you want to use all the goodies, consider using LINUX5 as a base instead of LUX5 -- the main difference is that LINUX5 is a normal Linux server install (minimal install + gcc tools) and also it doesn't have a separate r/o volume, so it is easier to branch and modify. (The drawback is that it is 3-5 times larger in terms of disk size per instance and takes longer to provision during app provision.)

What is the name of the terminal you added to the MySQL appliance for connecting to the NAS appliance? I assume, from your example above, you have called it 'nas'.


There is also no tcpdump command on the MYSQL5 appliance (but there's one on nas, which is inconsistent and truly annoying). So I don't even really know if packets are leaving the client - all I do know is that I can ping the nas either using hostname or IP address, but running mount with either the hostname or IP address fails.


This is an omission; I'll submit this to engineering. tcpdump is small enough and, together with netstat, a lifesaver during troubleshooting -- both should be part of the appliance base images.


Regards,
-- Peter

avantassel
02-04-2008, 06:47 PM
I am having a similar problem mounting an NFS type with a LUX5 appliance. Is there a way to get the LUX5 to accept this FS type?

avantassel
02-04-2008, 06:57 PM
Unless there is another issue here

mount -t nfs fs:/mnt/data /mnt/fs
mount: wrong fs type, bad option, bad superblock on fs:/mnt/data,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

jonesy
02-14-2008, 03:54 PM
You probably don't have the nfs client installed. Make sure nfs-utils is installed:

rpm -q nfs-utils

If it's not installed, do:

yum install nfs-utils

Good luck!