From e58d165dd53a17cbe341070ea3c8f24ecc492d2c Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja.osipov@gmail.com>
Date: Fri, 3 Jun 2011 01:19:35 +0400
Subject: [PATCH] User guide: add content.

Add more content to the user guide (language reference, memcached support).
---
 doc/user/CMakeLists.txt              |  20 +++++
 doc/user/configuration-reference.xml | 115 +++++++++++++++++++--------
 doc/user/connectors.xml              |  57 +++++++++++++
 doc/user/data-model.xml              |   2 +-
 doc/user/errcode.xml                 |   2 +-
 doc/user/language-reference.xml      | 107 +++++++++++++++++--------
 doc/user/preface.xml                 |  11 +--
 doc/user/replication.xml             |  23 ++++++
 doc/user/target.db                   |   2 +-
 doc/user/tnt-fo.xsl                  |  14 ++++
 doc/user/tutorial.xml                |   8 +-
 doc/user/user.xml                    |   4 +-
 12 files changed, 286 insertions(+), 79 deletions(-)
 create mode 100644 doc/user/connectors.xml
 create mode 100644 doc/user/replication.xml
 create mode 100644 doc/user/tnt-fo.xsl

diff --git a/doc/user/CMakeLists.txt b/doc/user/CMakeLists.txt
index b48472a876..54df67d597 100644
--- a/doc/user/CMakeLists.txt
+++ b/doc/user/CMakeLists.txt
@@ -5,6 +5,14 @@ add_custom_target(html ALL
         tnt-html.xsl
         user.xml)
 
+add_custom_target(pdf
+    COMMAND ${XSLTPROC} --nonet
+        --stringparam collect.xref.targets "all"
+        --xinclude -o tarantool_user_guide.fo
+        tnt-fo.xsl
+        user.xml
+    COMMAND fop tarantool_user_guide.fo tarantool_user_guide.pdf)
+
 add_custom_target(relink
     COMMAND ${XSLTPROC} --nonet
         --stringparam collect.xref.targets "only"
@@ -23,6 +31,18 @@ add_custom_target(html-saxon
         -r org.apache.xml.resolver.tools.CatalogResolver
         -u -o tarantool_user_guide.html user.xml tnt-html.xsl)
 
+add_custom_target(pdf-saxon
+    COMMAND java -cp "/usr/share/java/saxon.jar:/usr/share/java/xml-commons-resolver-1.1.jar:/usr/share/java/docbook-xsl-saxon.jar:/usr/share/java/xercesImpl.jar:/etc/xml/resolver:/usr/share/java/xslthl.jar"
+        -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
+        -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
+        -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration
+        com.icl.saxon.StyleSheet
+        -x org.apache.xml.resolver.tools.ResolvingXMLReader
+        -y org.apache.xml.resolver.tools.ResolvingXMLReader
+        -r org.apache.xml.resolver.tools.CatalogResolver
+        -u -o tarantool_user_guide.fo user.xml tnt-fo.xsl
+    COMMAND fop tarantool_user_guide.fo tarantool_user_guide.pdf)
+
 # XMLLINT is not able to validate SCHEMATRON constraints, and
 # therefore is not a good validation tool for DocBook 5.  However,
 # it can validate the entire document, following xinclude
diff --git a/doc/user/configuration-reference.xml b/doc/user/configuration-reference.xml
index b86c48c7e7..17de362371 100644
--- a/doc/user/configuration-reference.xml
+++ b/doc/user/configuration-reference.xml
@@ -180,7 +180,7 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000
   </itemizedlist>
 </section>
 
-<section>
+<section xml:id="option-file" xreflabel="option file">
 <title>The option file</title>
   <para>
     All advanced configuration parameters must be specified in a
@@ -225,9 +225,11 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000
     <filename xlink:href="https://github.com/mailru/tarantool/blob/master/test/box_big/tarantool.cfg">test/box_big/tarantool.cfg</filename>.
   </para>
 
-  <table frame='all'>
+  <table frame='all' pgwide='1'>
     <title>Basic parameters</title>
     <tgroup cols='6' colsep='1' rowsep='1'>
+      <colspec colnum="1" colname="col1" colwidth="2*"/>
+      <colspec colnum="6" colname="col4" colwidth="6*"/>
 
       <thead>
         <row>
@@ -310,7 +312,8 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000
         </row>
 
         <row>
-          <entry>secondary_port</entry>
+          <entry xml:id="secondary_port"
+            xreflabel="secondary_port">secondary_port</entry>
           <entry>integer</entry>
           <entry>none</entry>
           <entry>no</entry>
@@ -320,7 +323,7 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000
         </row>
 
         <row>
-          <entry>admin_port</entry>
+          <entry xml:id="admin_port" xreflabel="admin_port">admin_port</entry>
           <entry>integer</entry>
           <entry>none</entry>
           <entry>no</entry>
@@ -365,9 +368,11 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting>
     </tgroup>
   </table>
 
-  <table frame='all'>
+  <table frame='all' pgwide='1'>
     <title>Configuring the storage</title>
     <tgroup cols='6' colsep='1' rowsep='1'>
+      <colspec colnum="1" colname="col1" colwidth="2*"/>
+      <colspec colnum="6" colname="col4" colwidth="6*"/>
 
       <thead>
         <row>
@@ -447,9 +452,11 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting>
     </tgroup>
   </table>
 
-  <table frame='all'>
+  <table frame='all' pgwide='1'>
     <title>Binary logging and snapshots</title>
     <tgroup cols='6' colsep='1' rowsep='1'>
+      <colspec colnum="1" colname="col1" colwidth="2*"/>
+      <colspec colnum="6" colname="col4" colwidth="6*"/>
 
       <thead>
         <row>
@@ -522,24 +529,11 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting>
           <entry>WAL writer is a separate process whose sole
           purpose is to write the change log to disk. Every
           incoming data change is sent to this process and
-          queued for write. This parameter sets the size
-          of the queue. However, it has no effect
-          due to <link
-          xlink:href="https://bugs.launchpad.net/tarantool/+bug/791498">Bug#791498</link>.</entry>
-        </row>
-
-        <row>
-          <entry>readahead</entry>
-          <entry>integer</entry>
-          <entry>16384</entry>
-          <entry>no</entry>
-          <entry>no</entry>
-          <entry>WAL writer network read-ahead buffer size, in
-          bytes.
-            It's not recommended to change this value until
-            <link xlink:href="https://bugs.launchpad.net/tarantool/+bug/791498">Bug#791498</link>
-            is fixed.
-            </entry>
+          queued for write. This parameter affects the size of the
+          user space buffer that WAL writer uses to queue
+          write requests. By default, up to 128 client
+          connections can have pending updates waiting on disk.
+          </entry>
         </row>
 
         <row>
@@ -564,9 +558,11 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting>
     </tgroup>
   </table>
 
-  <table frame='all'>
+  <table frame='all' pgwide='1'>
     <title>Replication</title>
     <tgroup cols='6' colsep='1' rowsep='1'>
+      <colspec colnum="1" colname="col1" colwidth="2*"/>
+      <colspec colnum="6" colname="col4" colwidth="6*"/>
 
       <thead>
         <row>
@@ -581,7 +577,8 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting>
 
       <tbody>
         <row>
-          <entry>replication_port</entry>
+          <entry xml:id="replication_port"
+            xreflabel="replication_port">replication_port</entry>
           <entry>integer</entry>
           <entry>0</entry>
           <entry>no</entry>
@@ -621,19 +618,67 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting>
     </tgroup>
   </table>
 
-<!--
+  <table frame='all' pgwide='1'>
+    <title>Networking</title>
+    <tgroup cols='6' colsep='1' rowsep='1'>
+      <colspec colnum="1" colname="col1" colwidth="2*"/>
+      <colspec colnum="6" colname="col4" colwidth="6*"/>
 
-# delay between loop iterations
-io_collect_interval=0.0, ro
+      <thead>
+        <row>
+          <entry>Name</entry>
+          <entry>Type</entry>
+          <entry>Default</entry>
+          <entry>Required?</entry>
+          <entry>Dynamic?</entry>
+          <entry>Description</entry>
+        </row>
+      </thead>
 
-# size of listen backlog
-backlog=1024, ro
+      <tbody>
 
--->
+        <row>
+          <entry>io_collect_interval</entry>
+          <entry>float</entry>
+          <entry>0.0</entry>
+          <entry>no</entry>
+          <entry>no</entry>
+          <entry>If non-zero, a sleep given duration is
+          injected between iterations of the event loop. Can be
+          used to reduce CPU load in deployments in which the
+          number of client connections is large, but requests are
+          not so frequent (for example, each connection issuing
+          just a handful of requests per second). </entry>
+        </row>
+
+        <row>
+          <entry>readahead</entry>
+          <entry>integer</entry>
+          <entry>16384</entry>
+          <entry>no</entry>
+          <entry>no</entry>
+          <entry>The size of read-ahead buffer associated with
+              a client connection.</entry>
+        </row>
+
+        <row>
+          <entry>backlog</entry>
+          <entry>integer</entry>
+          <entry>1024</entry>
+          <entry>no</entry>
+          <entry>no</entry>
+          <entry>The size of listen backlog.</entry>
+       </row>
+
+      </tbody>
+    </tgroup>
+  </table>
 
-  <table frame='all'>
+  <table frame='all' pgwide='1'>
     <title>Logging</title>
     <tgroup cols='6' colsep='1' rowsep='1'>
+      <colspec colnum="1" colname="col1" colwidth="2*"/>
+      <colspec colnum="6" colname="col4" colwidth="6*"/>
 
       <thead>
         <row>
@@ -712,9 +757,11 @@ backlog=1024, ro
     </tgroup>
   </table>
 
-  <table frame='all'>
+  <table frame='all' pgwide='1'>
     <title>Memcached protocol support</title>
     <tgroup cols='6' colsep='1' rowsep='1'>
+      <colspec colnum="1" colname="col1" colwidth="2*"/>
+      <colspec colnum="6" colname="col4" colwidth="6*"/>
 
       <thead>
         <row>
diff --git a/doc/user/connectors.xml b/doc/user/connectors.xml
new file mode 100644
index 0000000000..ac5298b799
--- /dev/null
+++ b/doc/user/connectors.xml
@@ -0,0 +1,57 @@
+<!DOCTYPE book [
+<!ENTITY % tnt SYSTEM "../tnt.ent">
+%tnt;
+]>
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="connectors">
+
+<title>Connectors</title>
+<blockquote><para>
+  This chapter documents APIs for various programming languages --
+  C, Perl, Ruby, PHP and Python.
+</para></blockquote>
+
+<para>All connectors are located in srcdir/connector directory. Apart from the native Tarantool client driver, you can always use a <emphasis role="strong">Memcached</emphasis> driver of your choice, after enabling Memcached protocol in the configuration file.</para>
+
+  <section>
+    <title>C</title>
+    <para>
+       Please see (xref here).
+    </para>
+  </section>
+
+  <section>
+    <title>Perl</title>
+    <para>
+       Please see (xref here).
+    </para>
+  </section>
+
+  <section>
+    <title>PHP</title>
+    <para>
+       Please see (xref here).
+    </para>
+  </section>
+
+  <section>
+    <title>Python</title>
+    <para>
+       Please see (xref here).
+    </para>
+  </section>
+
+  <section>
+    <title>Ruby</title>
+    <para>
+       Please see (xref here).
+    </para>
+  </section>
+
+</chapter>
+
+<!--
+vim: tw=66 syntax=docbk
+vim: spell spelllang=en_us
+-->
diff --git a/doc/user/data-model.xml b/doc/user/data-model.xml
index 1e00090e35..0eee0b8764 100644
--- a/doc/user/data-model.xml
+++ b/doc/user/data-model.xml
@@ -109,7 +109,7 @@
 <para>
   Since not all NoSQL operations can be expressed in SQL, to gain
   complete access to data manipulation functionality one must use
-  a Perl, Python, Ruby or C connector. The client/server protocol
+  a <olink targetptr="connectors">Perl, Python, Ruby or C connector</olink>. The client/server protocol
   is open and documented: an annotated BNF can be found in the
   source tree, file <filename
   xlink:href="https://github.com/mailru/tarantool/blob/master/doc/box-protocol.txt" xlink:title="A complete BNF of Tarantool client/server protocol">doc/protocol.txt</filename>.
diff --git a/doc/user/errcode.xml b/doc/user/errcode.xml
index 5d23b526e4..1f55d388d0 100644
--- a/doc/user/errcode.xml
+++ b/doc/user/errcode.xml
@@ -9,7 +9,7 @@ which is normally more descriptive than error code,
 is not present in server response. The actual message may contain
 a file name, a detailed reason or operating system error code.
 All such messages, however, are logged in the error log. When
-using memcached protocol, the error message is sent to the
+using <emphasis role="strong">Memcached</emphasis> protocol, the error message is sent to the
 client along with the code. Below follow only general descriptions
 of existing codes.</para>
 <variablelist>
diff --git a/doc/user/language-reference.xml b/doc/user/language-reference.xml
index 2115197c7d..95ab30c1d2 100644
--- a/doc/user/language-reference.xml
+++ b/doc/user/language-reference.xml
@@ -16,7 +16,7 @@
   Unlike many other key/value servers, Tarantool uses
   different TCP ports and client/server protocols for data
   manipulation and administrative statements.
-  On start up, the server connects to three TCP ports:
+  On start up, the server connects to four TCP ports:
   <itemizedlist>
     <listitem><para>
       Read/write data port, to handle INSERTs, UPDATEs,
@@ -24,60 +24,105 @@
       </para>
       <para>
       The default value of the port is <literal>33013</literal>,
-      as defined in <emphasis>primary_port</emphasis>
+      as defined in <olink targetptr="primary_port"/>
       configuration option.
     </para></listitem>
     <listitem><para>
       Read only port, which only accepts SELECTs, port number
       <literal>33014</literal>, as defined in
-      <emphasis>secondary_port</emphasis> configuration option.
+      <olink targetptr="secondary_port"/> configuration option.
     </para></listitem>
     <listitem><para>
       Administrative port, which defaults to <literal>33015</literal>,
-      and is defined in <emphasis>admin_port</emphasis>
+      and is defined in <olink targetptr="admin_port"/>
       configuration option.
     </para></listitem>
+    <listitem><para>Replication port (see <olink
+        targetptr="replication_port"/>), by default set to
+        <literal>33016</literal>, used to send updates to
+        replicas. Replication is optional, and if its port is not
+        set in the option file, the corresponding server process
+        is not started.
+      </para></listitem>
   </itemizedlist>
-
-  The data protocol is binary; a complete description is
-  provided in doc/box-protocol.txt.
-
-</para>
-<para>
-  separation of ports is done in part to allow system
-  administrators to secure the read/write port or the
-  administrative port. The values of read-only, read-write and
-  administrative ports can be specified in the configuration file.
-</para>
-<para>
-  How command line client understands what port to use.
+  In absence of authentication, this approach allows system
+  administrators to restrict access to read/write or
+  administrative ports. The client, however, has to be aware of
+  the separation, and <command>tarantool</command> command line
+  client will automatically selects the correct port for you
+  with help of a simple regular expression. SELECTs, UPDATEs,
+  INSERTs and DELETEs are sent to the primary port, whereas SHOWs,
+  RELOAD, SAVE and others -- to the administrative port.
 </para>
 
-<!--
 <section>
+  <title>Data manipulation</title>
 
-  <title>Data console</title>
-
-  <para>The default data port is 33014. It can be set in the
-  configuration file. Data console supports asynchronous I/O.
-  Four commands are supported. For a complete protocol manual, see
-  developers guide.
+  <para>Tarantool protocol was designed with focus on asynchronous
+    I/O and easy integration with proxies. Each client
+    request starts with a simple binary header, containing three
+    fields: request type, length, and a numeric id.
   </para>
+  <para>
+    Four basic request types are supported: INSERT, UPDATE, DELETE
+    and SELECT. The mandatory length, present in the header,
+    allows to simplify client or proxy I/O.
+    The server response to a request always carries in its header
+    the same command type and request id.
+    The id makes it possible to always match request to a
+    response, even if the latter arrived out of order.
+  </para>
+  <para>Request type defines the format of the payload.
+    INSERTs and DELETEs can only be made by the primary key, so
+    an index id and key value are always present in these requests.
+    SELECTs and UPDATEs can use secondary keys. UPDATE only needs to
+    list the fields that are actually changed. With this one
+    exception, all commands operate on the whole tuple(s).
+  </para>
+  <para>Unless implementing a client driver, one needn't
+    concern him or her self with the complications of the binary
+    protocol. <olink targetptr="connectors">Language-specific
+    drivers</olink> provide a friendly way to store domain
+    language data structures in Tarantool, and the command line
+    client supports a subset of the standard SQL.
+    A complete description of both, the binary protocol and
+    the supported SQL, is maintained in annotated Backus-Naur
+    form in the source tree: please see
+    <link xlink:href="https://github.com/mailru/tarantool/blob/master/doc/box-protocol.txt"><filename>doc/box-protocol.txt</filename></link>
+    and
+    <link xlink:href="https://github.com/mailru/tarantool/blob/master/doc/box-protocol.txt"><filename>doc/sql.txt</filename></link> respectively.
+  </para>
+  <para>The other easy alternative is to access Tarantool using
+  Memcached protocol. </para>
+</section>
 
+<section>
+  <title>Writing stored procedures in Lua</title>
+  <para>
+    Lua.
+  </para>
 </section>
 
 
--->
 <section>
   <title>Administrative console</title>
   <para>
-    The administrative console uses a simple text protocol, so you
-    can connect to it using any <command>telnet</command> client,
-    or a tool like <command>rlwrap</command>, if access to
-    readline features is desired. Additionally, Tarantool features
-    its own Python-based client, located in directory <filename>test</filename>, <command>tarantool</command>.
-    Tarantool replies to administrative command in YAML.
+    The administrative console uses a simple text protocol.
+    All commands are case-insensitive.
+    You can connect to the administrative port using any
+    <command>telnet</command> client, or a tool like
+    <command>rlwrap</command>, if access to readline features is
+    desired. Additionally, Tarantool SQL-capable
+    command line client understands all administrative statements
+    and automatically directs them to the administrative port.
+    The server response to an administrative command even though
+    is always in plain text, can be quite complex,
+    and is encoded with YAML markup to simplify automated parsing.
   </para>
+  <para>To learn about all supported administrative commands, you
+    can type <emphasis role="tntadmin">help</emphasis> in the
+    administrative console. A reference description also follows
+    below:</para>
 
   <para><emphasis xml:id="reload-configuration" xreflabel="RELOAD CONFIGURATION" role="tntadmin">reload
   configuration</emphasis> Re-read the configuration file. If the
diff --git a/doc/user/preface.xml b/doc/user/preface.xml
index 34c7bd612f..09b6362682 100644
--- a/doc/user/preface.xml
+++ b/doc/user/preface.xml
@@ -74,7 +74,8 @@
     one of the leading Russian web content providers. At Mail.Ru,
     the sowtware serves the <quote>hottest</quote>
     data, such as online users and their sessions, online application
-    properties, the map between users and their serving shards.
+    properties, mapping between users and their serving shards,
+    and so on.
   </para>
 
   <para>
@@ -136,11 +137,11 @@
   </para>
   <para>
     <emphasis role="strong">Caution:</emphasis> To prevent spam, Launchpad
-    mailing list software silently drops all mail sent by
-    unregistered users. Registration also
-    allows you to report bug and create feature requests.
+    mailing list software silently drops all mail sent from
+    non-registered email addresses. Launchpad registration also
+    allows you to report bugs and create feature requests.
     You can always check whether or not your mail has been
-    delivered in the public mailing list archive, <link
+    delivered to the mailing list in the public list archive, <link
     xlink:href="https://lists.launchpad.net/tarantool-developers"/>.
   </para>
 </section>
diff --git a/doc/user/replication.xml b/doc/user/replication.xml
new file mode 100644
index 0000000000..78ef48bf1d
--- /dev/null
+++ b/doc/user/replication.xml
@@ -0,0 +1,23 @@
+<!DOCTYPE book [
+<!ENTITY % tnt SYSTEM "../tnt.ent">
+%tnt;
+]>
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="replication">
+
+<title>Replication</title>
+<blockquote><para>
+  How to set up replication?
+</para></blockquote>
+
+<para>
+Replication.
+</para>
+
+</chapter>
+
+<!--
+vim: tw=66 syntax=docbk
+vim: spell spelllang=en_us
+-->
diff --git a/doc/user/target.db b/doc/user/target.db
index ff99ff1b80..5e50818005 100644
--- a/doc/user/target.db
+++ b/doc/user/target.db
@@ -1 +1 @@
-<div element="book" href="#tarantool-user-guide" number="" targetptr="tarantool-user-guide"><ttl>Tarantool/Box User Guide, version 1.4.1-31-g8a3bd2c</ttl><xreftext>Tarantool/Box User Guide, version 1.4.1-31-g8a3bd2c</xreftext><div element="chapter" href="#id502411" number="1"><ttl>Preface</ttl><xreftext>Chapter 1, <i>Preface</i></xreftext><div element="section" href="#preface" number="" targetptr="preface"><ttl>Tarantool/Box: an overview</ttl><xreftext>the section called “Tarantool/Box: an overview”</xreftext></div><div element="section" href="#id502454" number=""><ttl>Conventions</ttl><xreftext>the section called “Conventions”</xreftext></div><div element="section" href="#id502528" number=""><ttl>Reporting bugs</ttl><xreftext>the section called “Reporting bugs”</xreftext></div></div><div element="chapter" href="#id503666" number="2"><ttl>Getting started</ttl><xreftext>Chapter 2, <i>Getting started</i></xreftext></div><div element="chapter" href="#id504673" number="3"><ttl>Dynamic data model</ttl><xreftext>Chapter 3, <i>Dynamic data model</i></xreftext></div><div element="chapter" href="#language-reference" number="4" targetptr="language-reference"><ttl>Language reference</ttl><xreftext>Chapter 4, <i>Language reference</i></xreftext><div element="section" href="#id502876" number=""><ttl>Administrative console</ttl><xreftext>the section called “Administrative console”</xreftext><obj element="emphasis" href="#reload-configuration" number="" targetptr="reload-configuration"><ttl>???TITLE???</ttl><xreftext>RELOAD CONFIGURATION</xreftext></obj><obj element="emphasis" href="#show-configuration" number="" targetptr="show-configuration"><ttl>???TITLE???</ttl><xreftext>SHOW CONFIGURATION</xreftext></obj><obj element="emphasis" href="#save-snapshot" number="" targetptr="save-snapshot"><ttl>???TITLE???</ttl><xreftext>SAVE SNAPSHOT</xreftext></obj></div></div><div element="chapter" href="#configuration-reference" number="5" targetptr="configuration-reference"><ttl>Configuration reference</ttl><xreftext>Chapter 5, <i>Configuration reference</i></xreftext><div element="section" href="#id504902" number=""><ttl>Command line options</ttl><xreftext>the section called “Command line options”</xreftext><obj element="listitem" href="#help-option" number="" targetptr="help-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#version-option" number="" targetptr="version-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#config-option" number="" targetptr="config-option"><ttl>???TITLE???</ttl><xreftext/></obj></div><div element="section" href="#id504287" number=""><ttl>The option file</ttl><xreftext>the section called “The option file”</xreftext><obj element="table" href="#id507149" number="5.1"><ttl>Basic parameters</ttl><xreftext>Table 5.1, “Basic parameters”</xreftext></obj><obj element="entry" href="#wal_dir" number="" targetptr="wal_dir"><ttl>???TITLE???</ttl><xreftext>wal_dir</xreftext></obj><obj element="entry" href="#snap_dir" number="" targetptr="snap_dir"><ttl>???TITLE???</ttl><xreftext>snap_dir</xreftext></obj><obj element="entry" href="#primary_port" number="" targetptr="primary_port"><ttl>???TITLE???</ttl><xreftext>primary_port</xreftext></obj><obj element="table" href="#id507511" number="5.2"><ttl>Configuring the storage</ttl><xreftext>Table 5.2, “Configuring the storage”</xreftext></obj><obj element="anchor" href="#slab_alloc_arena" number="" targetptr="slab_alloc_arena"><ttl>???TITLE???</ttl><xreftext>slab_alloc_arena</xreftext></obj><obj element="para" href="#namespace" number="" targetptr="namespace"><ttl>???TITLE???</ttl><xreftext>the section called “The option file”</xreftext></obj><obj element="table" href="#id507782" number="5.3"><ttl>Binary logging and snapshots</ttl><xreftext>Table 5.3, “Binary logging and snapshots”</xreftext></obj><obj element="table" href="#id508062" number="5.4"><ttl>Replication</ttl><xreftext>Table 5.4, “Replication”</xreftext></obj><obj element="entry" href="#replication_source_port" number="" targetptr="replication_source_port"><ttl>???TITLE???</ttl><xreftext>replication_source_port</xreftext></obj><obj element="table" href="#id508228" number="5.5"><ttl>Logging</ttl><xreftext>Table 5.5, “Logging”</xreftext></obj><obj element="table" href="#id508414" number="5.6"><ttl>Memcached protocol support</ttl><xreftext>Table 5.6, “Memcached protocol support”</xreftext></obj></div></div><div element="appendix" href="#errcode" number="A" targetptr="errcode"><ttl>List of error codes</ttl><xreftext>Appendix A, <i>List of error codes</i></xreftext><obj element="term" href="#ERR_CODE_NONMASTER" number="" targetptr="ERR_CODE_NONMASTER"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NONMASTER</xreftext></obj><obj element="term" href="#ERR_CODE_ILLEGAL_PARAMS" number="" targetptr="ERR_CODE_ILLEGAL_PARAMS"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_ILLEGAL_PARAMS</xreftext></obj><obj element="term" href="#ERR_CODE_NODE_IS_RO" number="" targetptr="ERR_CODE_NODE_IS_RO"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NODE_IS_RO</xreftext></obj><obj element="term" href="#ERR_CODE_MEMORY_ISSUE" number="" targetptr="ERR_CODE_MEMORY_ISSUE"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_MEMORY_ISSUE</xreftext></obj><obj element="term" href="#ERR_CODE_WAL_IO" number="" targetptr="ERR_CODE_WAL_IO"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_WAL_IO</xreftext></obj><obj element="term" href="#ERR_CODE_INDEX_VIOLATION" number="" targetptr="ERR_CODE_INDEX_VIOLATION"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_INDEX_VIOLATION</xreftext></obj><obj element="term" href="#ERR_CODE_NO_SUCH_NAMESPACE" number="" targetptr="ERR_CODE_NO_SUCH_NAMESPACE"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NO_SUCH_NAMESPACE</xreftext></obj><obj element="term" href="#ERR_CODE_NO_SUCH_INDEX" number="" targetptr="ERR_CODE_NO_SUCH_INDEX"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NO_SUCH_INDEX</xreftext></obj></div></div>
+<div element="book" href="#tarantool-user-guide" number="" targetptr="tarantool-user-guide"><ttl>Tarantool/Box User Guide, version 1.4.1-32-g189b126</ttl><xreftext>Tarantool/Box User Guide, version 1.4.1-32-g189b126</xreftext><div element="chapter" href="#id402127" number="1"><ttl>Preface</ttl><xreftext>Chapter 1, <i>Preface</i></xreftext><div element="section" href="#preface" number="" targetptr="preface"><ttl>Tarantool/Box: an overview</ttl><xreftext>the section called “Tarantool/Box: an overview”</xreftext></div><div element="section" href="#id402170" number=""><ttl>Conventions</ttl><xreftext>the section called “Conventions”</xreftext></div><div element="section" href="#id402244" number=""><ttl>Reporting bugs</ttl><xreftext>the section called “Reporting bugs”</xreftext></div></div><div element="chapter" href="#id403369" number="2"><ttl>Getting started</ttl><xreftext>Chapter 2, <i>Getting started</i></xreftext></div><div element="chapter" href="#id404402" number="3"><ttl>Dynamic data model</ttl><xreftext>Chapter 3, <i>Dynamic data model</i></xreftext></div><div element="chapter" href="#language-reference" number="4" targetptr="language-reference"><ttl>Language reference</ttl><xreftext>Chapter 4, <i>Language reference</i></xreftext><div element="section" href="#id402550" number=""><ttl>Data manipulation</ttl><xreftext>the section called “Data manipulation”</xreftext></div><div element="section" href="#id402606" number=""><ttl>Writing stored procedures in Lua</ttl><xreftext>the section called “Writing stored procedures in Lua”</xreftext></div><div element="section" href="#id402616" number=""><ttl>Administrative console</ttl><xreftext>the section called “Administrative console”</xreftext><obj element="emphasis" href="#reload-configuration" number="" targetptr="reload-configuration"><ttl>???TITLE???</ttl><xreftext>RELOAD CONFIGURATION</xreftext></obj><obj element="emphasis" href="#show-configuration" number="" targetptr="show-configuration"><ttl>???TITLE???</ttl><xreftext>SHOW CONFIGURATION</xreftext></obj><obj element="emphasis" href="#save-snapshot" number="" targetptr="save-snapshot"><ttl>???TITLE???</ttl><xreftext>SAVE SNAPSHOT</xreftext></obj></div></div><div element="chapter" href="#replication" number="5" targetptr="replication"><ttl>Replication</ttl><xreftext>Chapter 5, <i>Replication</i></xreftext></div><div element="chapter" href="#configuration-reference" number="6" targetptr="configuration-reference"><ttl>Configuration reference</ttl><xreftext>Chapter 6, <i>Configuration reference</i></xreftext><div element="section" href="#id404261" number=""><ttl>Command line options</ttl><xreftext>the section called “Command line options”</xreftext><obj element="listitem" href="#help-option" number="" targetptr="help-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#version-option" number="" targetptr="version-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#config-option" number="" targetptr="config-option"><ttl>???TITLE???</ttl><xreftext/></obj></div><div element="section" href="#option-file" number="" targetptr="option-file"><ttl>The option file</ttl><xreftext>option file</xreftext><obj element="table" href="#id407246" number="6.1"><ttl>Basic parameters</ttl><xreftext>Table 6.1, “Basic parameters”</xreftext></obj><obj element="entry" href="#wal_dir" number="" targetptr="wal_dir"><ttl>???TITLE???</ttl><xreftext>wal_dir</xreftext></obj><obj element="entry" href="#snap_dir" number="" targetptr="snap_dir"><ttl>???TITLE???</ttl><xreftext>snap_dir</xreftext></obj><obj element="entry" href="#primary_port" number="" targetptr="primary_port"><ttl>???TITLE???</ttl><xreftext>primary_port</xreftext></obj><obj element="entry" href="#secondary_port" number="" targetptr="secondary_port"><ttl>???TITLE???</ttl><xreftext>secondary_port</xreftext></obj><obj element="entry" href="#admin_port" number="" targetptr="admin_port"><ttl>???TITLE???</ttl><xreftext>admin_port</xreftext></obj><obj element="table" href="#id407640" number="6.2"><ttl>Configuring the storage</ttl><xreftext>Table 6.2, “Configuring the storage”</xreftext></obj><obj element="anchor" href="#slab_alloc_arena" number="" targetptr="slab_alloc_arena"><ttl>???TITLE???</ttl><xreftext>slab_alloc_arena</xreftext></obj><obj element="para" href="#namespace" number="" targetptr="namespace"><ttl>???TITLE???</ttl><xreftext>the section called “The option file”</xreftext></obj><obj element="table" href="#id407932" number="6.3"><ttl>Binary logging and snapshots</ttl><xreftext>Table 6.3, “Binary logging and snapshots”</xreftext></obj><obj element="table" href="#id408194" number="6.4"><ttl>Replication</ttl><xreftext>Table 6.4, “Replication”</xreftext></obj><obj element="entry" href="#replication_port" number="" targetptr="replication_port"><ttl>???TITLE???</ttl><xreftext>replication_port</xreftext></obj><obj element="entry" href="#replication_source_port" number="" targetptr="replication_source_port"><ttl>???TITLE???</ttl><xreftext>replication_source_port</xreftext></obj><obj element="table" href="#id408382" number="6.5"><ttl>Networking</ttl><xreftext>Table 6.5, “Networking”</xreftext></obj><obj element="table" href="#id408538" number="6.6"><ttl>Logging</ttl><xreftext>Table 6.6, “Logging”</xreftext></obj><obj element="table" href="#id408746" number="6.7"><ttl>Memcached protocol support</ttl><xreftext>Table 6.7, “Memcached protocol support”</xreftext></obj></div></div><div element="chapter" href="#connectors" number="7" targetptr="connectors"><ttl>Connectors</ttl><xreftext>Chapter 7, <i>Connectors</i></xreftext><div element="section" href="#id402820" number=""><ttl>C</ttl><xreftext>the section called “C”</xreftext></div><div element="section" href="#id404440" number=""><ttl>Perl</ttl><xreftext>the section called “Perl”</xreftext></div><div element="section" href="#id404451" number=""><ttl>PHP</ttl><xreftext>the section called “PHP”</xreftext></div><div element="section" href="#id405761" number=""><ttl>Python</ttl><xreftext>the section called “Python”</xreftext></div><div element="section" href="#id405772" number=""><ttl>Ruby</ttl><xreftext>the section called “Ruby”</xreftext></div></div><div element="appendix" href="#errcode" number="A" targetptr="errcode"><ttl>List of error codes</ttl><xreftext>Appendix A, <i>List of error codes</i></xreftext><obj element="term" href="#ERR_CODE_NONMASTER" number="" targetptr="ERR_CODE_NONMASTER"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NONMASTER</xreftext></obj><obj element="term" href="#ERR_CODE_ILLEGAL_PARAMS" number="" targetptr="ERR_CODE_ILLEGAL_PARAMS"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_ILLEGAL_PARAMS</xreftext></obj><obj element="term" href="#ERR_CODE_NODE_IS_RO" number="" targetptr="ERR_CODE_NODE_IS_RO"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NODE_IS_RO</xreftext></obj><obj element="term" href="#ERR_CODE_MEMORY_ISSUE" number="" targetptr="ERR_CODE_MEMORY_ISSUE"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_MEMORY_ISSUE</xreftext></obj><obj element="term" href="#ERR_CODE_WAL_IO" number="" targetptr="ERR_CODE_WAL_IO"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_WAL_IO</xreftext></obj><obj element="term" href="#ERR_CODE_INDEX_VIOLATION" number="" targetptr="ERR_CODE_INDEX_VIOLATION"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_INDEX_VIOLATION</xreftext></obj><obj element="term" href="#ERR_CODE_NO_SUCH_NAMESPACE" number="" targetptr="ERR_CODE_NO_SUCH_NAMESPACE"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NO_SUCH_NAMESPACE</xreftext></obj><obj element="term" href="#ERR_CODE_NO_SUCH_INDEX" number="" targetptr="ERR_CODE_NO_SUCH_INDEX"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NO_SUCH_INDEX</xreftext></obj></div></div>
diff --git a/doc/user/tnt-fo.xsl b/doc/user/tnt-fo.xsl
new file mode 100644
index 0000000000..6952f3bfca
--- /dev/null
+++ b/doc/user/tnt-fo.xsl
@@ -0,0 +1,14 @@
+<?xml version='1.0'?> 
+<xsl:stylesheet  
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+    xmlns:xslthl="http://xslthl.sf.net">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/fo/docbook.xsl"/> 
+
+<xsl:param name="generate.toc" select="'book toc'"/>
+<xsl:param name="fop1.extentions">1</xsl:param>
+<xsl:param name="paper.type">A4</xsl:param>
+<xsl:param name="highlight.source" select="1"/>
+<xsl:param name="highlight.xslthl.config">file:////usr/share/xml/docbook/stylesheet/docbook-xsl-ns/highlighting/xslthl-config.xml</xsl:param>
+
+</xsl:stylesheet>
diff --git a/doc/user/tutorial.xml b/doc/user/tutorial.xml
index f38b015635..201be01f5a 100644
--- a/doc/user/tutorial.xml
+++ b/doc/user/tutorial.xml
@@ -41,7 +41,7 @@
 <para>
   After download, unpack the binary package, an own directory will be created:
   <programlisting>
-  <prompt>$ </prompt><command>tar</command> <option>zxvf</option> <filename>package-name.tar.gz</filename></programlisting>
+  <prompt>$ </prompt><command>tar</command> <option>zxvf</option> <filename><replaceable><replaceable>package-name</replaceable></replaceable>.tar.gz</filename></programlisting>
   The binary download contains just two subdirectories:
   <filename>bin</filename> and <filename>doc</filename>.
   The server, by default, looks for its configuration file in
@@ -50,7 +50,7 @@
   <filename>bin</filename>, thus the server can be started
   right out of it:
   <programlisting>
-  <prompt>$ </prompt><command>cd package-name/bin &amp;&amp; ./tarantool_box</command>
+  <prompt>$ </prompt><command>cd <replaceable>package-name</replaceable>/bin &amp;&amp; ./tarantool_box</command>
   ...
   1301424353.416 3459 104/33013/acceptor _ I> I am primary
   1301424353.416 3459 1/sched _ I> initialized</programlisting>
@@ -61,7 +61,7 @@
   Once the server is started, you can connect to it and issue
   queries using a command line client implemented in Python:
   <programlisting>
-  <prompt>$ </prompt><command>cd package-name/bin &amp;&amp; ./tarantool</command>
+  <prompt>$ </prompt><command>cd <replaceable>package-name</replaceable>/bin &amp;&amp; ./tarantool</command>
   <prompt>tarantool> </prompt> <userinput>show info</userinput>
   <computeroutput>
   ---
@@ -82,7 +82,7 @@
   necessary: configuration and build. The easiest way to configure
   a source directory with CMake is by requesting an in-source build:
   <programlisting>
-  <prompt>$ </prompt><command>cd</command> <filename>package-name</filename> &amp;&amp; <command>cmake</command> .</programlisting>
+  <prompt>$ </prompt><command>cd</command> <filename><replaceable>package-name</replaceable></filename> &amp;&amp; <command>cmake</command> .</programlisting>
   Upon successful configuration, CMake prints the status
   of optional features:
   <programlisting>
diff --git a/doc/user/user.xml b/doc/user/user.xml
index 02e677b59e..114a077ea6 100644
--- a/doc/user/user.xml
+++ b/doc/user/user.xml
@@ -12,11 +12,11 @@
 <xi:include href="tutorial.xml"/>
 <xi:include href="data-model.xml"/>
 <xi:include href="language-reference.xml"/>
+<xi:include href="replication.xml"/>
 <xi:include href="configuration-reference.xml"/>
+<xi:include href="connectors.xml"/>
 <!--
-<xi:include href="replication.xml"/>
 <xi:include href="memcached.xml"/>
-<xi:include href="configuration.xml"/>
 <xi:include href="logging.xml"/>
 <xi:include href="connectors.xml"/>
 <xi:include href="faq.xml"/>
-- 
GitLab