Archive for the 'Linux' Category

Solr 1.4 Upgrade P2 – Out with Rsync CollectionDistribution in with JavaReplication

March 03rd, 2010 | Category: Development,Linux

Solr 1.4 made replication from Master to Slave servers a whole lot easier.  Before solr1.4 we were using rsync via the snapshooter and snappuller scripts As seen here.  This method worked OK, but intermittently we would see the snapshooter or puller fail for various Java reasons (Memory usually).

Please see Solr Java-Based Replication for setup overview.  I will cover specific modification I had to make compared to what is in their documentation.  In my solrconfig.xml on my Master server, I have the following:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
      <lst name="master">
          <!--Replicate on 'startup' and 'commit'. 'optimize' is also a valid value for replicateAfter. -->
          <str name="replicateAfter">startup</str>
          <str name="replicateAfter">commit</str>
      </lst>
  </requestHandler>

Then on the slave servers, I have:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
      <lst name="slave">
          <!--fully qualified url for the replication handler of master . It is possible to pass on this as a request param for the fetchindex command-->
          <str name="masterUrl">http://{solr_host}:{solr_port}/solr/${solr.core.name}/replication</str>
          <!--Interval in which the slave should poll master .Format is HH:mm:ss . If this is absent slave does not poll automatically. 
           But a fetchindex can be triggered from the admin or the http API -->
          <str name="pollInterval">00:00:30</str>
          <str name="httpReadTimeout">10000</str>-->
       </lst>
  </requestHandler>

Substitute {solr_host} and {solr_port} with your specific settings. IMPORTANT: Note the ${solr.core.name} variable.  This makes it so the slaves will poll from the correct MultiCore path on the Master server.

3 comments

Ubuntu Intrepid Sound Juicer MP3 support

November 15th, 2008 | Category: Linux,Ubuntu

After upgrading to Intrepid Kaudiocreator was no longer available, so I decided to give Sound Juicer a try. When I went to the preferences to change the encoding to MP3, I found that it was missing. So I clicked edit and found that the option was there for MP3 output. Turns out the option will not show up until you install this package – gstreamer0.10-plugins-ugly-multiverse. So just type the following and your set.

sudo apt-get install gstreamer0.10-plugins-ugly-multiverse
1 comment

My simple ruby backup

November 04th, 2008 | Category: Development,Linux

After using a Linux dev laptop for almost a year, I went back to a MacBook Pro for work. I had forgotten the pains of finding a good backup solution for a Mac. I needed something that would incrementally back up my work laptop and my home Linux box to the same external hard drive. After trying various solutions(Time Machine, CCC, iBackup, etc), they all seemed to either not work at all or hog up way too much room on the drive. So I decided to just write my own backup solution using Ruby and Rsync.

This initial release is very basic and only requires you have ruby and rsync installed. It supports Mac or Linux and can back up to any drive that supports hard links (ext2, ext3, hfs, hfs+). Future releases will include integration with s3 as well as Cron scheduling. For now I just wanted to share this with others having similar gripes.

Steps to getting up and running:
1. Download Ruby Backup Zip or Ruby Backup tarball.
2. Extract the contents of the above package.
3. Edit the backup_settings.yml.sample file and save it as backup_settings.yml
4. run the script via “ruby ruby_backup.rb” or “./ruby_backup.rb”

1 comment

VIM tricks: comment block of code

October 16th, 2008 | Category: Development,Linux

A friend of mine (Shovan) was asking how to comment out a block of code using VIM. This can easily be done using the “Visual Block” feature of VIM. To enter visual block mode use “Ctrl + v”. At this point you can use “j” or “k” to highlight the lines in which you want to comment out. Then use “Shift + i” to enter insert mode. Type the respective comment character (# for ruby and bash, // for php), then hit “Esc” to exit insert mode.

No comments

Ubuntu SVN cannot set LC_CTYPE locale

September 08th, 2008 | Category: Linux,Ubuntu

I ran into this error on a fresh Ubuntu Hardy server I set up hosting a SVN repository.  The error messages may look like the following:

 
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is en_US.UTF-8
svn: warning: please check that your locale name is correct

This won’t cause any problems with the functionality of Subversion, but it gets annoying.  So the problem is that the LANG that is specified (in my case en_US.UTF-8) isn’t installed.  So, to install it do the following:

 
apt-get install language-pack-en-base

This will ask you if you want to install language-pack-en also, so say yes to the prompt.  Then you will be set.  If you language is something other than English “en”, then install the appropriate locale package.

1 comment