Friday, November 20, 2009

Using napp-it webadmin with your EON ZFS storage

Many have asked for a web interface to administer their EON ZFS storage. I started a FreeNAS interface port a while back but time and keeping pace with their development proved unsustainable. I shared it in the download section as Freon for someone with better PHP resources to complete. I also posted a webmin howto a while back. The webmin web user admin, lacks only a ZFS and a CIFS module. It contains a Samba module which may be easy for one of you Perl guru's out there to extend as a CIFS module.

Prerequisites: This exercise assumes the binary kit is installed, for unzip. Or unzip with winzip and drag the folder into a CIFS share onto the storage, then run the following within the napp-it directory to correct the proper unix carriage return:
find . -type f -print | xargs -I {} dos2unix -ascii {} {}
Another option, written by Alka Guenther for nexenta, called napp-it was extended to work with EON. He has a running thread on opensolaris.org. Here are the steps I took to get it running on my ZFS storage after downloading napp-it v 0.210. I transferred it to /tmp/napp-it-0.210.zip. Then
cd /var/apache2/2.2/cgi-bin
unzip -aa /tmp/napp-it-0.210.zip
chown webservd:webservd napp-it
cd napp-it
chmod -R 755 ./*
Next we vi/edit admin.pl and comment (line 42 in v 0.210) the following
use CGI::Carp qw (fatalsToBrowser);
to
#use CGI::Carp qw (fatalsToBrowser);
And that's pretty much it. We point the browser to http://EON_ZFS_IP/cgi-bin/napp-it/admin.pl and you should be greeted by a login with no password, which you can immediately change. It is very configurable and I really liked the console command feature. So give it a try and help improve it.





28 comments:

gea said...

hello andre
thank for giving napp-it a try.

i will keep the nexenta-version in sync with the eon version as much as possible to build a easy to use browser managed INS Server (Internet, NAS, SAN) based on nexenta or eon, ready to use for people with less opensolaris knowledge (like me a year ago) and usable as:

-nas server for win/mac workgroups and domains based on opensolaris cifs
-nfs/ iscsi san and apple time-machine storage
-apache webserver with perl, php, gd graphic library
-mysql database server
-backup server


i'm not an experienced solaris user but i will see how i can install the missing CGI::Carp module (or did anybody know how).

Its not necessary to run but its important for users who want to change or edit menue items because it will display script errors in your browser window and not only in apache error log (together with a error 500 message).

there is also a new beta version available. it includes a easy to use time based auto-job management system for tasks like autosnap, autoscrub or auto-copy. its nearly feature complete (user management is missing)

i will eventually change napp-it to use lighttpd webserver in next version to have apache free for users. (did you had success with it and napp-it)


more at:
http://www.napp-it.org/napp-it


guenther

gea said...

hello andre

if you want to run unmodified napp-it, you must copy the missing perl library CGI.pm and folder CGI to your perl library folder /usr/perl5/5.8.4/lib/
you can download this module at http://www.napp-it.org/napp-it/carp.zip

napp-it is then copy and run (my preferred way for applications). copy it to your webserver's cgi-bin folder and make it and content rwx for all (use winscp recursive).
thats all to install and run.

ps
if have also tried new beta 0.212 on eon. scriptable auto-job seems to work. maybee you could include this module in eon. if you also enable root access via ssh per default, it will be possible to work with eon via winscp and putty for those without solaris and unix knowledge and without vi (this Very Inhuman thing, i hate it, every time i must use it and had to remember how to use it).

napp-it should not only be a cgi-application but a concept of a complete basic ready to run server for common use and with usability in mind.


another thing.
apache + cgi application napp-it need root permission to manage eon via pfexec. maybee you or anybody else have an idea how to setup opensolaris. at the moment, my suggested setting is to open everything for the apache user account without password. only acceptable in home and closed networks without ssh.


guenther

Peter J. Lu said...

This is, on the whole, a brilliant combination, and has the potential to make the technology much more accessible to people like me, who are barely getting to know OpenSolaris and ZFS. I knew basically nothing a week ago, and am still trying to get everything to work.

I think the most important feature, for me at least, is that the graphical interface gives you a lot more information without having to learn a lot of the OpenSolaris jargon-commands, which I define as commands that have equivalents in other operating systems, but don't have any additional major functionality. One example for me would be pfexec vs. sudo on linux; one has to keep track of two different commands, but for the same purpose. It not only wastes time and energy, but makes for an unnecessarily steep learning curve for newbies like me. Just to list which services are running, and then activate/deactivate them requires piling through tons of webpages and/or documentation---and you don't really learn anything new. So napp-it is a HUGE help in this area. In fact, I realized that there was no NFS running on my EON install, so hours spent trying to troubleshoot why NFS wasn't working obviously were in vain (more on this later!).

I think the install instructions could use a little modification, because at least my image of Eon doesn't have unzip included. So let's start from the beginning, assuming someone just has the LiveCD of the latest EON downloaded and burned. The instructions for napp-it would then be as follows:

1. Download the ZIP file napp-it-0.210.zip from the website linked in the post.

2. Copy it to an empty working directory of your choice (e.g. /tmp on your regular system). Unzip it on a Linux system (I'm using Ubuntu 9.10), from the command line, using "unzip -aa /tmp/napp-it-0.210.zip". If you just use the default Archive Manager in Ubuntu, and extract the directory, you'll get some funny "^M" characters at the line breaks.

3. Make your life easy, and edit the admin.pl file, as in the post, with your favorite editor, to comment out the single line. I never use vi, and it took forever to figure out how to make those changes when I did it on the EON system; since you have to copy files, there's no reason for the extra hassle.

4. Now, you have a complete directory structure with all of the files for napp-it. There are several ways to handle it from here. My way was to copy the files to a place on the zpool that I created. Why? because I can't (yet) get the USB stick to work, so I have to reboot off of the LiveCD every time. There's some errors for me, and in the meantime I want to get the system up and running, and will then worry about the USB stick. So I have to put the files in the actual disk-based storage, or it won't be there the next time I reboot.

I used secure copy (scp), since that's the only thing that works; I can't get SMB to work properly with Ubuntu, which isn't much of a surprise, and there is no NFS service running on my CD of EON (again, see below). Fortunately, the ssh/scp always works, if slowly. So I copy the entire napp-it directory, with the modified admin.pl file, to a new directory.

5. While in that directory, of which napp-it is now a subdirectory containing all of the relevant files, I execute the following commands (you can just copy and paste this into a .sh script, or one line at a time):

cp -r napp-it napp-it/ /var/apache2/2.2/cgi-bin/
cd /var/apache2/2.2/cgi-bin/
chown webservd:webservd napp-it/
chmod -R 777 ./*

5a. the first line just moves the files to the right place in the directory (so that admin.pl is located at /var/apache2/2.2/cgi-bin/napp-it/admin.pl

5b. The "chown" command changes ownership from root (assuming that's what you logged in as to do all of this administration), so that the webserver has the right permissions.

5c. Finally, the "chmod" command gives everyone the correct access (Andre says 755, Guenther says 777 in his online help; I suppose it doesn't matter too much).

[had to split the post into two parts]

Peter J. Lu said...

[continued from above]

6. Now, you should be able to test it out by going to the web address in the post. Note also, that by default there is a test script, at http://EON_ZFS_IP/cgi-bin/test-cgi. That should give you a text file with some information on your configuration. Mine was:

CGI/1.0 test script report:

argc is 0. argv is .

SERVER_SOFTWARE = Apache
SERVER_NAME = 192.168.1.102
GATEWAY_INTERFACE = CGI/1.1
SERVER_PROTOCOL = HTTP/1.1
SERVER_PORT = 80
REQUEST_METHOD = GET
HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
PATH_INFO =
PATH_TRANSLATED =
SCRIPT_NAME = /cgi-bin/test-cgi
QUERY_STRING =
REMOTE_HOST =
REMOTE_ADDR = 192.168.1.101
REMOTE_USER =
AUTH_TYPE =
CONTENT_TYPE =
CONTENT_LENGTH =

This is very helpful in demonstrating that your apache server is working (you can also go to http://EON_ZFS_IP/ and see the message "It works!". If either of those messages fail to appear, then you know there's something wrong with the http connection to the EON box.

Okay, that was really kind of long, but basically it's a complete, self-contained set of instructions that will work, based only on what comes by default on the latest EON iso image, and the download from napp-it.

My personal opinion is that it would be quite valuble to include a version of napp-it with the next release of EON, though of course that depends on a number of other factors. But the reason that it's so useful is that it tells you what is running and what is not, and this is a huge help in troubleshooting for beginners. If it's auto-configured properly, anyone can just point their web browser, and immediately know that the EON box is working, that it's talking to the right machines, that ZFS is working, etc. etc. etc. This would be a HUGE improvement in usability and robustness.

A final word: for those of us who are starting with OpenSolaris, it's not at all obvious to figure out what's installed with EON, vs. the standard (and obviously much larger) default OpenSolaris installation. In particular, the "unzip" programs in this post were not included.

Much more importantly, I don't see NFS/server when I run "svcs". And when I type "svcadm enable nfs/server", as every web page on the subject tells me to, I get "svcadm: Pattern 'nfs/server' doesn't match any instances.

If I understand correctly, that means that NFS isn't installed or running on the standard EON iso image? I think this needs to be fixed, or at least indicated. I've spent many hours trying to figure this out (I still don't know how to install packages on EON, either). It would be very good if the next version of the software would include this, and some instructions for us newbies on how to get it. Until then, I can't really make use of my EON box, since there's nothing by ultra-slow SSH allowing me to move data around. I hope I'm just missing something really trivial and obvious, so I can get up and running fast. Thanks!

Andre Lue said...

Peter,

Thanks for your instructions. You are correct unzip is not in the base image. Sorry, I didn't make it clear that it was being used from the binary kit.

chmod 777 (world writable) may have some security concerns, hence I opted to 755.

As far as NFS setup goes, here is the quick howto from the FAQ
How do I start NFS server services?
First, import the services
cd /var/svc/manifest/network
svccfg -v import rpc/bind.xml
svccfg -v import nfs/status.xml
svccfg -v import nfs/nlockmgr.xml
svccfg -v import nfs/server.xml
Then, enable them
svcadm enable rpc/bind
svcadm enable nfs/status
svcadm enable nfs/nlockmgr
svcadm enable nfs/server

How do I start NFS client services?
First, import the services
cd /var/svc/manifest/network
svccfg -v import nfs/client.xml
Then, enable them
svcadm enable nfs/client

Peter J. Lu said...

Brilliant. This is just brilliant.

Looks like I need to "RTF-FAQ" next time. This is the problem for me of being dumb and inexperienced; thanks for your patience in explaining the obvious to me...

Fortunately, everything is now working just fine, and I'm getting nearly 60 MB/sec over standard gigabit ethernet, to a Dell Optiplex 620 (single-core 3 GHz P4 with 2.5 GB of RAM) with a single 750 GB SATA Hitachi drive that's several years old. This is amazing!

What makes EON so unbelievably effective is that you can literally dig an older computer out of the closet, plug in some random drives, and get better performance (with compression, CRC error checking, and lots of inherent duplication) than ANY of the regularly available commercial NAS units.

[If you could point me to the documentation to install the binary kit, that would be great. As-is, the shell script points to files on a cdrom, and so I just get the usual file-not-found errors.]

Has anyone used this with teamed ethernet (link aggregation), and seen a noticeable improvement in performance? Any hard numbers?

Looking forward to deduplication!

Peter J. Lu said...

One more small thing:

After I got NFS working with your instructions, the filesystem I wanted was available over NFS---even though I had (accidentally) set sharenfs=no for that filesystem. Why then does NFS still work? I'm really confused.

Max said...

@Peter: Binary kit instructions here..

http://eonstorage.blogspot.com/2009/08/using-binary-kit-with-your-zfs-nas.html

ìgbàlonígbàńlò said...
This comment has been removed by the author.
gea said...

27.11.09 napp-it Version 0.213
new nightly beta of napp-it
(runs on eon, but not fully tested or adapted)

enhancements:
-basic user and group management
-auto-job management: auto/manual mode
-security: autoset of folder /napp-it
-> auto-change owner and 755 permission of folder napp-it/* to napp-it-webserver-account
big fixes

gea

gea said...

reference hardware for napp-it

we all know, that opensolaris does not support as much hardware than windows or linux. the opensolaris hcl is not really helpful, if you are looking for a hardware without too much problems.


in my case, i was looking for a current medium-priced micro-atx server mainboard, suitable for basic - up to high-power vmware and storage needs that should be under 500,-- euro together with quadcore xeon cpu and 2GB RAM.



my demands:

- micro atx with new server chipset intel 3420 on socket 1156

- quadcore xeon cpu X3400 or low power L-series

- ecc-memory up to 32 gb

- onboard: 6 x sata + 2 x intel nic 1 gbe + vga

- 3 free pci-e-8x slots (to use them for 2 x 8 channel SAS + 10 Gbe)



i tested and use now supermicro's X8SIL-F and for me it seems to be a perfect

candidate for a reference hardware for napp-it. if you also use this mainboard and you
discover any problems with it, please tell me.



more see www.napp-it.org/hardware.html

gea

gea said...

how to napp-it on eon
with new beta 0.217

-you must use a cifs-version with http-server
-you must copy content of /napp-it/_log/lib/* to perl library folder /usr/perl5/5.8.4/lib/
(use winscp) - otherwise you will get error 500 due to missing library carp.pm

read the manual napp-it.pdf

not implemented yet (needs to be done) - compared to nexenta version
(this menue items are disabled when running on eon):

- create and select system-snapshots to boot from
- grouping of napp-it server for tiering and syncing (will run you install socat)

gea

Unknown said...

Thanks for doing this work. I noticed that Solaris has a web-server GUI interface for ZFS administration. Have you tried it? Can I get it to work with EON? Here is an article about it: http://blogs.sun.com/talley/entry/manage_zfs_from_your_browser

Andre Lue said...

Curtis,

The dependencies for the SMC web gui are fairly large. So right now there are no plans to integrate it. It might not be such a difficult exercise to add in the form of the binary kit but I do not have the bandwidth right now.

Andre Lue said...

gea,

It would be nice to get some feedback on how your intel 3420 micro atx board performs with EON. Looks like it should put down some awesome numbers.

gea said...

hello andre

eon is running virtually on this hardware (i use it as nfs pool for my esxi testserver). my current installed
os is nexenta3 a2 (with dedup)
but eon should perform similar.

i just made a bonnie++ test to see, how zfs3, dedup and compress will impact performance. my results:

Hardware:
Supermicro X8SIL
CPU X3440 (4 core, 2,53 GhZ)
8 GB RAM
SAS Controller LSI 1068
4 x Seagate Cheetah 15K.6 - 147GB


Bonnie Version 1.03b
------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--

mirror (2 drives)
myhost,16G,102261,99,130724,13,70623,14,76347,88,108402,8,1464.4,5,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++

z3 (4 drives) + compress enabled
myhost,16G,100777,97,865705,83,476662,64,88091,97,855013,41,4727.1,7,16,+++++,+++,+++++,+++,+++++,+++,20103,99,+++++,+++,+++++,+++

z3 (4 drives) + compress +dedup enabled
myhost,16G,103201,98,760643,87,233945,32,87182,96,752177,37,6694.0,10,16,+++++,+++,+++++,+++,+++++,+++,27939,100,+++++,+++,+++++,+++

i have no reference, how good this values are absolutely. but i have had not a problem with this board until now and it is really fast - seems to be as fast as - or even better than my 8core xeon server with p5000 chipset. (they have other drives so benchmarks are useless)

but first results:
-use as much drives as possible
-no performance impact with raidz3 and compression on
-much better performance with dedup on
(but dedup ratio was extremely high, so it is too early to give a statement about)

but intels new low-cost server chipset 3420 especially on this nice and relativley cheap micro atx board seems to be really good server base.

at the moment a can´t test it with eon (need it running) but i suppose it will run with opensolaris/ eon as well.

i will tell you, if i have more infos.


gea

gea said...

i can add these links:

OS Compatibility Chart
www.supermicro.com/support/resources/OS/X8S.cfm

Performance Chart
browse.geekbench.ca/geekbench2/view/175660

Comments
blog.wolfplusplus.com/?p=180#comments

About ram
www.webhostingtalk.com/showthread.php?t=895830&page=1



ps
i will try eon + dedup asap

Unknown said...

You may want to have a look at the admin interface described there
http://hardforum.com/showthread.php?t=152180

Andre Lue said...

Hi Nicolas,

I get a "No thread specified" error when I follow your link. I would be interested take a look, if you can repost a working link.

Marc said...

nicolas missed a "3" off the end of his URL

Andre Lue said...

Hi Marc,

Thanks for the corrected link.

So the ZFS interface thread starts here

The sub.mesa interface download is here (scroll to bottom)

smyth_rj said...

Hey, I am running the snv_130 build 64bit and having issues getting napp-it to stay persistent after reboot. I get it all setup as per the instructions in the original post, test it out and its all working but then I run updimg.sh and reboot its gone. I have changed the account password at the same stage and that is persistent but not napp-it.
It's probably my lack of understanding as far as this ram disk image stuff goes. Should I maybe be using the instructions to add drivers to the image instead?
Any tips would be greatly appreciated.

Andre Lue said...

Hi smyth_rj,

It sounds like the napp-it path has to:
- be added to the /mnt/eon0/.backup file or
- a symlink has to be created to it's location (/var/apache2/2.2/cgi-bin) in /mnt/eon0/.exec

smyth_rj said...

Hey Andre, AWESOME, I added /var/apache2/2.2/cgi-bin/* to .backup, ran updimg and rebooted, My napp-it interface is still there and ready to go. Thanks for the info, I take it this would be the way to get any addon files to be persistent?
Thanks for a great product.

smyth_rj said...

For anyone interested I have done up a barebones doco on how I setup EON with napp-it. You can get it here.

Anonymous said...

New Install instruction for napp-it v.0325

This version uses sudo instead of pfexec. There are changes that needs to be done to alleviate this. Unfortunately, I can't find any reference on the admin.pl or admin-lib.pl to change the usage of sudo to pfexec. So, I just symlinked sudo with pfexec. And everything worked perfect! (well, so far). I haven't fully tested everything yet.

Follow all previous instructions. Make sure that napp-it files are executable. For my installation, I installed napp-it on my zfspool and symlinked it on my apache cgi-bin directory. Make sure you cp all the CGI folder to /usr/perl5/5.8.4/lib/ directory. Also copy Carp.pm from the CGI folder to /usr/perl5/5.8.4/lib/ folder. The last thing should be to symlink /usr/bin/pfexec to /usr/bin/sudo. I'm pretty sure the same thing could be done when installing napp-it with the online installer. Just have to make sure sudo is mapped to pfexec. Also, add the proper entries in .backup for the CGI directory at /usr/perl5/5.8.4/lib, the Carp.pm and on .exec make your symlink for sudo to pfexec.

David said...

FYI:

I've managed to install napp-it 5 on top of EON (*solaris* appliance v. 0.500k nightly Jun.01.2011) using the online installer.

I still have permission problems but seems to be it will work just fine.

Gonzalo said...

I can't find EON isos for download, ¿is this project dead or something?