?i»?

Your IP : 3.144.86.105


Current Path : /home/scgforma/www/cloud/core/doc/admin/configuration_files/
Upload File :
Current File : /home/scgforma/www/cloud/core/doc/admin/configuration_files/files_locking_transactional.html

<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Transactional file locking &mdash; Nextcloud 13 Administration Manual 13 documentation</title>
    
    <link rel="stylesheet" href="../_static/" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/main.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/styles.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '13',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="../_static/js/jquery-fix.js"></script>
    <script type="text/javascript" src="../_static/bootstrap-3.1.0/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
    <link rel="top" title="Nextcloud 13 Administration Manual 13 documentation" href="../contents.html" />
    <link rel="up" title="File sharing and management" href="index.html" />
    <link rel="next" title="Previews configuration" href="previews_configuration.html" />
    <link rel="prev" title="Encryption configuration" href="encryption_configuration.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#1d2d44">

  </head>
  <body role="document">


<div class="wrap container not-front">
  <div class="content row">
  <main class="main">
    
			<div class="row">
				<div class="col-md-3">
					<div class="sidebar">
            <h1>Nextcloud 13 Administration Manual</h1>
            
            <div class="sidebar-search">
              <form class="headersearch" action="../search.html" method="get">
                <input type="text" value="" name="q" id="q" class="form-control" /> 
                <button  class="btn btn-default" type="submit" id="searchsubmit">Search</button>
              </form>
            </div>
            
							<div class="menu-support-container">
								<ul id="menu-support" class="menu">
									<ul>
                    <li><a href="../contents.html">Table of Contents</a></li>
									</ul>
                  <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_server/index.html">Server configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_user/index.html">User management</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">File sharing and management</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="file_sharing_configuration.html">File Sharing</a></li>
<li class="toctree-l2"><a class="reference internal" href="federated_cloud_sharing_configuration.html">Configuring Federation Sharing</a></li>
<li class="toctree-l2"><a class="reference internal" href="big_file_upload_configuration.html">Uploading big files &gt; 512MB</a></li>
<li class="toctree-l2"><a class="reference internal" href="default_files_configuration.html">Providing default files</a></li>
<li class="toctree-l2"><a class="reference internal" href="external_storage_configuration_gui.html">Configuring External Storage (GUI)</a></li>
<li class="toctree-l2"><a class="reference internal" href="external_storage_configuration.html">Configuring External Storage (configuration file)</a></li>
<li class="toctree-l2"><a class="reference internal" href="external_storage/auth_mechanisms.html">External Storage authentication mechanisms</a></li>
<li class="toctree-l2"><a class="reference internal" href="encryption_configuration.html">Encryption configuration</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Transactional file locking</a></li>
<li class="toctree-l2"><a class="reference internal" href="previews_configuration.html">Previews configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_versioning.html">Controlling file versions and aging</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../file_workflows/index.html">File workflows</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_database/index.html">Database configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_mimetypes/index.html">Mimetypes management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintenance/index.html">Maintenance</a></li>
<li class="toctree-l1"><a class="reference internal" href="../issues/index.html">Issues and troubleshooting</a></li>
</ul>

								</ul>
							</div>
					</div>
				</div>
        

				<div class="col-md-9">
					<div class="page-content">
            
<ul class="prevnext-title list-unstyled list-inline">
  <li class="prev">
    <a href="encryption_configuration.html" title="Previous Chapter: Encryption configuration"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm">&laquo; Encryption configuration</span>
    </a>
  </li>
  <li class="next">
    <a href="previews_configuration.html" title="Next Chapter: Previews configuration"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm">Previews configuration &raquo;</span>
    </a>
  </li>
</ul>
						
  <div class="section" id="transactional-file-locking">
<h1>Transactional file locking<a class="headerlink" href="#transactional-file-locking" title="Permalink to this headline">¶</a></h1>
<p>Nextcloud&#8217;s Transactional File Locking mechanism locks files to avoid
file corruption during normal operation. It performs these functions:</p>
<ul class="simple">
<li>Operates at a higher level than the filesystem, so you don&#8217;t need to use a
filesystem that supports locking</li>
<li>Locks parent directories so they cannot be renamed during any activity on
files inside the directories</li>
<li>Releases locks after file transactions are interrupted, for
example when a sync client loses the connection during an upload</li>
<li>Manages locking and releasing locks correctly on shared files during changes
from multiple users</li>
<li>Manages locks correctly on external storage mounts</li>
<li>Manages encrypted files correctly</li>
</ul>
<p>What Transactional File locking is not for: it will not prevent multiple users
from editing the same document, or give notice that other users are working on
the same document. Multiple users can open and edit a file at the same time and
Transactional File locking does not prevent this. Rather, it prevents
simultaneous file saving.</p>
<p>File locking is enabled by default, using the database locking backend. This
places a significant load on your database. Using <code class="docutils literal"><span class="pre">memcache.locking</span></code> relieves
the database load and improves performance. Admins of Nextcloud servers with
heavy workloads should install a memcache. (See
<a class="reference internal" href="../configuration_server/caching_configuration.html"><em>Configuring memory caching</em></a>.)</p>
<p>To use a memcache with Transactional File Locking, you must install the Redis
server and corresponding PHP module. After installing Redis you must enter a
configuration in your <code class="docutils literal"><span class="pre">config.php</span></code> file like this example:</p>
<div class="highlight-python"><div class="highlight"><pre>&#39;filelocking.enabled&#39; =&gt; true,
&#39;memcache.locking&#39; =&gt; &#39;\OC\Memcache\Redis&#39;,
&#39;redis&#39; =&gt; array(
     &#39;host&#39; =&gt; &#39;localhost&#39;,
     &#39;port&#39; =&gt; 6379,
     &#39;timeout&#39; =&gt; 0.0,
     &#39;password&#39; =&gt; &#39;&#39;, // Optional, if not defined no password will be used.
      ),
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For enhanced security it is recommended to configure Redis to require
a password. See <a class="reference external" href="http://redis.io/topics/security">http://redis.io/topics/security</a> for more information.</p>
</div>
<p>If you want to configure Redis to listen on an Unix socket (which is
recommended if Redis is running on the same system as Nextcloud) use this example
<code class="docutils literal"><span class="pre">config.php</span></code> configuration:</p>
<div class="highlight-python"><div class="highlight"><pre>&#39;filelocking.enabled&#39; =&gt; true,
&#39;memcache.locking&#39; =&gt; &#39;\OC\Memcache\Redis&#39;,
&#39;redis&#39; =&gt; array(
     &#39;host&#39; =&gt; &#39;/var/run/redis/redis.sock&#39;,
     &#39;port&#39; =&gt; 0,
     &#39;timeout&#39; =&gt; 0.0,
      ),
</pre></div>
</div>
<p>See <code class="docutils literal"><span class="pre">config.sample.php</span></code> to see configuration examples for Redis, and for all
supported memcaches.</p>
<p>If you are on Ubuntu you can follow <a class="reference external" href="https://www.techandme.se/how-to-configure-redis-cache-in-ubuntu-14-04-with-owncloud/">this guide</a> for a complete installation from scratch.</p>
<p>Learn more about Reds at <a class="reference external" href="http://redis.io/">Redis</a>. Memcached, the popular
distributed memory caching system, is not suitable for the new file locking
because it is not designed to store locks, and data can disappear from the cache
at any time. Redis is a key-value store, and it guarantees that cached objects
are available for as long as they are needed.</p>
</div>


            
<ul class="prevnext-title list-unstyled list-inline">
  <li class="prev">
    <a href="encryption_configuration.html" title="Previous Chapter: Encryption configuration"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm">&laquo; Encryption configuration</span>
    </a>
  </li>
  <li class="next">
    <a href="previews_configuration.html" title="Next Chapter: Previews configuration"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm">Previews configuration &raquo;</span>
    </a>
  </li>
</ul>
					</div>
				</div>
			</div>
  </main>  
  </div>
</div>
  </body>
</html>