<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.old.lustre.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Isaac</id>
	<title>Obsolete Lustre Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.old.lustre.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Isaac"/>
	<link rel="alternate" type="text/html" href="http://wiki.old.lustre.org/index.php?title=Special:Contributions/Isaac"/>
	<updated>2026-04-12T04:11:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://wiki.old.lustre.org/index.php?title=LibLustre_How-To_Guide&amp;diff=6191</id>
		<title>LibLustre How-To Guide</title>
		<link rel="alternate" type="text/html" href="http://wiki.old.lustre.org/index.php?title=LibLustre_How-To_Guide&amp;diff=6191"/>
		<updated>2009-05-13T16:05:23Z</updated>

		<summary type="html">&lt;p&gt;Isaac: /* Necessary Environmental Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liblustre A How to Guide =&lt;br /&gt;
== Introduction to liblustre ==&lt;br /&gt;
&lt;br /&gt;
For some Lustre versions, a library version of the Lustre client file system (liblustre) is now available. Liblustre gives a user application (linked with the library) access to Lustre file systems, without needing to mount Lustre (VFS) on the client. The key goals for the library are to provide a portable mechanism to access Lustre from different POSIX-compliant operating systems, and to provide access from microkernel-based systems and from the Windows operating system.&lt;br /&gt;
&lt;br /&gt;
Currently, liblustre is still under development and only works on linux (i386 &amp;amp; x86_64, not tested on ia64).&lt;br /&gt;
&lt;br /&gt;
In this document, we will discuss how to use liblustre.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note that liblustre is NOT a required element of Lustre.&#039;&#039;&#039;&lt;br /&gt;
liblustre is not required or even recommended for running Lustre on Linux. Instead, you should use the Lustre (VFS) client filesystem to mount Lustre directly.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, liblustre implements the Lustre client filesystem in user space. The liblustre component links LNET and libsysio together to form a shared library which can be used by applications to perform file I/O.&lt;br /&gt;
&lt;br /&gt;
== Building Clients and Servers for liblustre ==&lt;br /&gt;
&lt;br /&gt;
When using liblustre, servers are first built/configured in the usual way as described in the [http://wiki.lustre.org/index.php?title=Lustre_Howto How to Guide to Lustre]. By default, liblustre is built unless &amp;quot;./configure --disable-liblustre&amp;quot; is specified.&lt;br /&gt;
&lt;br /&gt;
The following liblustre files are located in lustre/liblustre:&lt;br /&gt;
&lt;br /&gt;
* liblustre/liblustre.so&lt;br /&gt;
* liblustre/tests/&lt;br /&gt;
&lt;br /&gt;
== How to Use liblustre ==&lt;br /&gt;
&lt;br /&gt;
First, you must run the Lustre servers (MDS/OSTs) without ACLs and accept connections on insecure ports. For example, add &#039;&#039;&#039;options lnet networks=tcp(eth0) accept=all&#039;&#039;&#039; to /etc/modprobe.conf, then run the script &#039;&#039;&#039;sh llmount.sh&#039;&#039;&#039; (if you do not already have a mounted Lustre filesystem to test against).  This sets up a MDS, OST and client on the local machine. You should umount the Lustre client at /mnt/lustre to avoid confusion between the liblustre client and the normal VFS client.&lt;br /&gt;
&lt;br /&gt;
=== Mount Target ===&lt;br /&gt;
&lt;br /&gt;
liblustre needs to know the &#039;&#039;mount target&#039;&#039; before connecting to a Lustre server. The format is similar to the following:&lt;br /&gt;
&lt;br /&gt;
    mgs_nid:/profile_name&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;mgs_nid&#039;&#039;&#039; is the actual hostname of the MGS (or IP address if you do not have proper name resolution set up).&lt;br /&gt;
       &lt;br /&gt;
* &#039;&#039;&#039;profile_name&#039;&#039;&#039; is the profile name of the client mount point, also called the &#039;&#039;&#039;filesystem name&#039;&#039;&#039; in many configurations.&lt;br /&gt;
&lt;br /&gt;
For additional information on mount target, refer to Lustre documentation. This can be passed to most liblustre programs via the environment variable LIBLUSTRE_MOUNT_TARGET.&lt;br /&gt;
&lt;br /&gt;
=== Sanity Test ===&lt;br /&gt;
&lt;br /&gt;
There is a statically built-in liblustre test program at &#039;&#039;lustre/liblustre/tests/sanity&#039;&#039;. You can use this test to verify if liblustre is working properly:&lt;br /&gt;
&lt;br /&gt;
    sanity --target mgs_nid:/profile_name&lt;br /&gt;
&lt;br /&gt;
=== How It Works ===&lt;br /&gt;
&lt;br /&gt;
If we run a program, e.g. iozone, then we will use LD_PRELOAD to load &#039;&#039;liblustre.so&#039;&#039; first. The start function of &#039;&#039;liblustre.so&#039;&#039; will mount a lustre partition on certain directories, e.g. /mnt/lustre. Furthermore, following loaded iozone&#039;s functions calls such as open/read/write... will dynamically linked with implementations in &#039;&#039;liblustre.so&#039;&#039;, instead of &#039;&#039;libc&#039;&#039; in the usual case. Thus, we can intercept filesystem-related system calls and translate them into Lustre commands.&lt;br /&gt;
&lt;br /&gt;
=== Necessary Environmental Variables ===&lt;br /&gt;
&lt;br /&gt;
There is a simple script &#039;&#039;lustre/utils/lrun&#039;&#039; which set some ENVs:&lt;br /&gt;
&lt;br /&gt;
* mount point&lt;br /&gt;
   &lt;br /&gt;
    LIBLUSTRE_MOUNT_POINT=${LIBLUSTRE_MOUNT_POINT:-&amp;quot;/mnt/lustre&amp;quot;}&lt;br /&gt;
This is where liblustre mounts the remote Lustre filesystem. The default location is &#039;&#039;/mnt/lustre&#039;&#039;. Make sure it exists on your system.&lt;br /&gt;
&lt;br /&gt;
* mount target&lt;br /&gt;
    &lt;br /&gt;
    LIBLUSTRE_MOUNT_TARGET=${LIBLUSTRE_MOUNT_TARGET:-&amp;quot;your_mount_target&amp;quot;}&lt;br /&gt;
Before using liblustre, you need to fill in the actual mount target (e.g. mdshost:/mdsname/client).&lt;br /&gt;
&lt;br /&gt;
* shared library&lt;br /&gt;
    &lt;br /&gt;
    LD_PRELOAD=${LD_PRELOAD:-&amp;quot;/usr/lib/liblustre.so&amp;quot;}&lt;br /&gt;
Make sure you have installed lustre/liblustre/liblustre.so in this location.&lt;br /&gt;
&lt;br /&gt;
* server port&lt;br /&gt;
&lt;br /&gt;
    LNET_ACCEPT_PORT=${LNET_ACCEPT_PORT:-&amp;quot;40&amp;quot;}&lt;br /&gt;
This is optional, necessary only when the Lustre server doesn&#039;t listen on the default port (e.g. server uses the lnet option &amp;quot;accept_port&amp;quot; to change its port). It&#039;s only meaningful for the socklnd.&lt;br /&gt;
&lt;br /&gt;
* other lnet options&lt;br /&gt;
&lt;br /&gt;
You&#039;d need to set LNET_ROUTES for the liblustre client to use routing to access the remote filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Running Programs over liblustre ===&lt;br /&gt;
&lt;br /&gt;
Until now, only a small number of applications have been tested with liblustre:&lt;br /&gt;
&lt;br /&gt;
* iozone&lt;br /&gt;
* IOR&lt;br /&gt;
* simul&lt;br /&gt;
&lt;br /&gt;
And also several standard UNIX commands:&lt;br /&gt;
&lt;br /&gt;
* ls&lt;br /&gt;
* touch&lt;br /&gt;
* rm&lt;br /&gt;
* mkdir&lt;br /&gt;
* rmdir&lt;br /&gt;
* mv&lt;br /&gt;
* cp&lt;br /&gt;
* find&lt;br /&gt;
* grep&lt;br /&gt;
&lt;br /&gt;
You need to prepend &#039;lrun&#039; before the programs that you intend to run:&lt;br /&gt;
 &lt;br /&gt;
   lrun iozone -f /mnt/lustre/ioz_testfile -r 256k -s 1g&lt;br /&gt;
    &lt;br /&gt;
   lrun mkdir /mnt/lustre/testdir&lt;br /&gt;
   lrun touch /mnt/lustre/testdir/testfile&lt;br /&gt;
   lrun cp /etc/fstab /mnt/lustre/testdir&lt;br /&gt;
   lrun ls /mnt/lustre/testdir&lt;br /&gt;
   lrun find /mnt/lustre/&lt;br /&gt;
   lrun .....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
liblustre is somewhat sensitive to the glibc version. We are using glibc-2.2.5 and glic-2.3.2.&lt;br /&gt;
----&lt;br /&gt;
*&#039;&#039;&#039;[http://wiki.lustre.org/index.php?title=Main_Page FrontPage]&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Isaac</name></author>
	</entry>
</feed>