<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>8.0 &#8211; Solr.pl</title>
	<atom:link href="https://solr.pl/en/tag/8-0-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://solr.pl/en/</link>
	<description>All things to be found - Blog related to Apache Solr &#38; Lucene projects - https://solr.apache.org</description>
	<lastBuildDate>Sat, 14 Nov 2020 15:08:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Solr 8 &#8211; ByteBuffersDirectory &#8211; quick look</title>
		<link>https://solr.pl/en/2019/04/15/solr-8-bytebuffersdirectory-quick-look/</link>
					<comments>https://solr.pl/en/2019/04/15/solr-8-bytebuffersdirectory-quick-look/#respond</comments>
		
		<dc:creator><![CDATA[Rafał Kuć]]></dc:creator>
		<pubDate>Mon, 15 Apr 2019 14:07:46 +0000</pubDate>
				<category><![CDATA[Solr]]></category>
		<category><![CDATA[8.0]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[solr]]></category>
		<guid isPermaLink="false">http://sematext.solr.pl/?p=990</guid>

					<description><![CDATA[One of the new features introduced in the recently released Solr 8.0 is new implementation of the Directory interface &#8211; one that will replace not scalable RAMDirectory. The new implementation called ByteBuffersDirectory is dedicated to small, short lived data that]]></description>
										<content:encoded><![CDATA[
<p>One of the new features introduced in the recently released Solr 8.0 is new implementation of the <em>Directory</em> interface &#8211; one that will replace not scalable <em>RAMDirectory</em>. The new implementation called <em>ByteBuffersDirectory</em> is dedicated to small, short lived data that is held only in memory. Let&#8217;s have a quick look into potential use cases, advantages and drawbacks of this new implementation.</p>



<span id="more-990"></span>



<h2 class="wp-block-heading">Configuration</h2>



<p>Simplest things first &#8211; let&#8217;s start with configuration. This time the situation is very simple. The only thing that we need to take care of is proper <em>DirectoryFactory</em> implementation in the <em>solrconfig.xml</em> file, file example</p>



<pre class="wp-block-code">&lt;directoryFactory name="DirectoryFactory" class="solr.ByteBuffersDirectoryFactory" /&gt;</pre>



<p>One thing we need to remember though is the <em>lockType</em> implementation. At the time of writing, the only possible value for <em>lockType</em> when <em>ByteBuffersDirectoryFactory</em> is used is <em>simple</em>. No other lock type is supported.</p>



<h2 class="wp-block-heading">Possible Usage</h2>



<p>The new implementation of the <em>Directory</em> interface will replace <em>RAMDirectory</em> &#8211; implementation that is present in Lucene and Solr for a long period of time now. However, keep in mind that <em>RAMDirectory</em> is not suggested to be used because of its issues. </p>



<p>Theortically we should use the in-memory <em>Directory</em> implementation for small, short lived Lucene indices. This allows us to avoid disk usage for writes and reads for potentially higher indexing throughput and lower query latency.</p>



<p>For example, you can use the newly introduced <em>Directory</em> implementation for keeping highly updated data like number of products or for that needed only once &#8211; i.e. reports coming from multiple data sources. </p>



<p>You need to remember though that similar to <em>RAMDirectory</em>, the <em>ByteBuffersDirectory</em> doesn&#8217;t save data to disk. This means that you need to re-index your data after each Solr restart or failure. </p>



<h2 class="wp-block-heading">Advantages</h2>



<p>The main advantage, that we already mentioned, is that the data indexed to the core/collection that uses <em>ByteBuffersDirectory</em> will not use disk resources. That means that the data write and read will be blazingly fast, which can result in higher indexing throughput and lower query latency. However keep in mind that similar behavior can be achieved when using <em>mmap</em> calls to the I/O subsystem of the operating system, so for example when using the <em>MMapDirectory</em>. This <em>Directory</em> implementation shares the I/O cache of the operating system and will re-use data that is put in memory by the operating system. The second advantage, especially when compared to the <em>RAMDirectory</em> is that the <em>ByteBuffersDirectory</em> fully supports multi-threading, so we won&#8217;t have issues when using the multi-threaded data indexing and access.</p>



<h2 class="wp-block-heading">Drawbacks</h2>



<p>Of course not everything is bright and shining, there are also drawbacks when using the <em>ByteBuffersDirectory</em> &#8211; we should mention three things here. First of all, when using this directory, the data will be volatile &#8211; every restart will require data re-indexing. It is one of the principles of that <em>Directory</em> implementation, but it is worth remembering about that. The second thing is heap memory. If the data will be stored on heap it will mean more heap memory usage and more work for the garbage collector, which can lead to less performance. Finally &#8211; we are partially limited by the amount of physical memory and the memory assigned to the JVM heap. This means that the core/collections that are using <em>ByteBuffersDirectory</em> shouldn&#8217;t be too large.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solr.pl/en/2019/04/15/solr-8-bytebuffersdirectory-quick-look/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Migration to Solr 8</title>
		<link>https://solr.pl/en/2019/03/18/migration-to-solr-8/</link>
					<comments>https://solr.pl/en/2019/03/18/migration-to-solr-8/#respond</comments>
		
		<dc:creator><![CDATA[Rafał Kuć]]></dc:creator>
		<pubDate>Mon, 18 Mar 2019 15:07:07 +0000</pubDate>
				<category><![CDATA[Solr]]></category>
		<category><![CDATA[8.0]]></category>
		<category><![CDATA[8.0.0]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[solr]]></category>
		<category><![CDATA[upgrade]]></category>
		<guid isPermaLink="false">http://sematext.solr.pl/?p=988</guid>

					<description><![CDATA[With the recent release of Solr 8.0 you may be wondering if it is worth migrating to the new version and how to do it. Is it possible to upgrade your cluster without major downtime? Is it possible to upgrade]]></description>
										<content:encoded><![CDATA[
<p>With the recent release of <a href="https://solr.pl/en/2019/03/14/lucene-solr-8-0/">Solr 8.0</a> you may be wondering if it is worth migrating to the new version and how to do it. Is it possible to upgrade your cluster without major downtime? Is it possible to upgrade to new version using rolling restarts? We will try to answer that question in this blog post. </p>



<span id="more-988"></span>



<h2 class="wp-block-heading">Which version to migrate from</h2>



<p>The first thing that we should mention are the changes to LIR and recovery algorithm introduced with Solr 7.3. Because of those changes it is impossible to use rolling restarted when migrating from version that is older then 7.3. In such cases you need a full cluster restart.</p>



<p>We should also remember that Apache Lucene library version 8.0 and thus Solr 8.0 is not able to read data created with Solr 5.x. Because of this you will have to go through each major version up to 8.x and rewrite your data on each or just created new cluster and re-idnex your data.</p>



<h2 class="wp-block-heading">Migrating from Solr 7.3 and newer</h2>



<p>If you will be migrating from Solr 7.3 or newer you can upgrade your cluster to 8.0.0 without the need of full cluster rrestart and just by using rolling restarts. This is how the procedure should look like:</p>



<ol class="wp-block-list"><li>Prepare the cluster for upgrade, create data backup, Zookeeper data backup and so on.</li><li>Turn off one Solr instance.</li><li>Update the turned off instance to 8.0.</li><li>Add <em>-Dsolr.http1=true</em> parameter to <em>SOLR_OPTS</em> property in <em>solr.in.sh</em> configuration file.</li><li>Launch the updated Solr instance.</li><li>Wait for the cluster to stabilize (there may be a need of data replication, so it may take a while).</li><li>Start the upgrade of the next Solr instance, so begin with point 2).</li></ol>



<p>After being done with all the instances we need to do one more round of node by node restarts. This time we need to do the following for each instance belonging to our cluster:</p>



<ol class="wp-block-list"><li>Turn off a single Solr instance.</li><li>Remove the <em>-Dsolr.http1</em> parameter from the <em>SOLR_OPTS</em> property in the <em>solr.in.sh</em> configuration file.</li><li>Start the modified Solr instance.</li><li>Wait for the cluster to stabilize.</li><li>Repeat from point 1) for the next instance.</li></ol>



<h2 class="wp-block-heading">Additional restarts round &#8211; but why?</h2>



<p>You may be asking yourself why we do the additional, second round of restarts once we have all the nodes upgraded to version 8. The problem lies in the foundation of the changes that were introduced to the newest version of Solr. With Solr 8.0.0 the internal communication between the nodes is done using the <em>HTTP/2</em> protocol. The usage of that protocol and the changes done to introduce it resulted in more robustness and higher efficiency of the inter-node communication. However the downside is that the changes are not compatible with the earlier Solr versions. That&#8217;s why, when we have 7.x and 8.0 Solr version in the cluster we need to be sure that they are compatible with each other. Once all the nodes are running the newest version of Solr we can finally turn off forcing the backwards compatibility and fully use the latest and greatest features introduced in Solr 8.0. This is why we first add the <em>-Dsolr.http1=true</em> parameter and then remove it.  </p>



<h2 class="wp-block-heading">Should I be afraid of the upgrade</h2>



<p>Each migration comes with a degree of risk and possible complications. Because of that it is crucial to plan and prepare. We shouldn&#8217;t do the upgrade during peak hours or during the period of time where we expect a higher load on the cluster. We should think if it is possible to minimize or completely turn off indexing during the upgrade time &#8211; it will minimize the time needed for the instance restart. It is also crucial to be able to roll back if something goes wrong, though it is not always possible, especially if you have a large amount of data. You should think about it all and prepare. Good luck with your upgrades</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solr.pl/en/2019/03/18/migration-to-solr-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
