Tag: should

  • Solr replication

    1)On solr.master:
    +Edit scripts.conf:
    solr_hostname=localhost
    solr_port=8983
    rsyncd_port=18983
    +Enable and start rsync:
    rsyncd-enable; rsyncd-start
    +Run snapshooter:
    snapshooter
    After running this, you should be able to see a new folder named snapshot.*
    in data/index folder.
    You can can solrconfig.xml to trigger snapshooter after a commit or
    optimise.
    
    2) On slave:
    +Edit scripts.conf:
    solr_hostname=solr.master
    solr_port=8986
    rsyncd_port=18986
    data_dir=
    webapp_name=solr
    master_host=localhost
    master_data_dir=$MASTER_SOLR_HOME/data/
    master_status_dir=$MASTER_SOLR_HOME/logs/clients/
    +Run snappuller:
    snappuller -P 18983
    +Run snapinstaller:
    snapinstaller
    
    You should setup crontab to run snappuller and snapinstaller periodically.

    Re: Solr replication.

  • Dell 5150c not noisy any longer

    My desktop, a Dell Dimension 5150c, purchased about 3-4 years ago, was annoyingly noisy for a while. Last time when I changed the PSU, I thought the annoyance would go away. But it didn’t. The CPU fan, San Ace 80, was the main culprit. At sometimes (which was almost everytime) it used to power the CPU fan so loud, that to listen to music or watch a video, we had to pump up the volume to almost twice than usually should be.
    Today I took up in my mind to replace it, and switched to a Kama-Flex.
    Superbly quiet, about 2500 rpm, and cooling efficiency nothing comparable to the older one.
    Was worth the try!

  • Eset Nod32 blocks Trusted zone IPs

    Last whole week I was stumbled by the fact that my home network with 3 PCs suddenly stopped working. None of them were able to “see” each other, except for a little while… strange.
    Technically (since it is easier to describe), A, B, C – my 3 computers – could reach each other, share files, host apache, download files without any extra configuration.
    Last week, however while using C’s http server from A suddenly stopped. Puzzled, I thought the machine might be overloaded, or something like this must be causing page to timeout, or apache must have hanged (does it?). But things seemed to be working OK on C, in fact top showed a load average below 1 ?
    Further puzzled, I tried pinging A to C, and vice-versa. It worked… but only for a while. Pinging after a while seemed to stop. Huh?
    Scourging over the Internet wasn’t easy for answer. Maybe my way of searching was wrong, but I did spent a good week trying to fish out the ping issue, then next to dig deeper to find that accessing C’s IP from outside (it already has a global ip; though dynamic, paired through dyndns to the world) worked. Now each of them – A, B, C – have no internal 192.168 ip’s, just public ip’s. What good are public ip’s if I have to access them from outside than just sitting home?
    Something was wrong.
    To cut short, I called the ISP, asked them if they have changed anything recently (well, I was using A, B, C sharing files for over 6 months now). My ISP reported that no such upgrade, or settings were done. Deeply mad about this situation, I chose to disable the firewall (Eset Nod32) on A, and then tryout the ping – which worked effortlessly to C, and back.
    What the hell! Why did Nod32 suddenly seem to block my own A, B, C from seeing each other? ARP Poisioning? I don’t know, only thing I know is that it shouldn’t block them. 🙂
    Well, atleast things are fine now. I’ve changed settings on Nod32 to Not block threat detected addresses henceforth.

  • Using Apache’s mod_rewrite on Windows

    I recently happened to experiment with Apache’s mod_rewrite, an excellent library to change your machine friendly (or perhaps program friendly?) web urls into user friendly urls.

    The steps to make mod_rewrite to work on Windows is-
    – Edit httpd.conf for Apache, and uncomment the following line
    # LoadModule rewrite_module modules/mod_rewrite.so
    -to-
    LoadModule rewrite_module modules/mod_rewrite.so

    – Next, under <Directory “{Your document root}“> change
    AllowOverride None
    -to-
    AllowOverride All

    – Restart Apache

    – Create a sample folder “rewrite” under {Your document root}, with the following files
    {Your document root}
     
    rewrite
        .htaccess
        details.php

    – What we will attempt now is to have a url like http://localhost/rewrite/details/shantibhushan to be automatically executed as http://localhost/rewrite/details.php?user=shantibhushan

    – Edit your .htaccess file as follows
    <IfModule rewrite_module>
     RewriteEngine on
     RewriteBase /rewrite/
     RewriteRule ^details/(.+)$ details.php?user=$1 [L]
    </IfModule>

    – The RewriteRule is the actual line where we specify what url is to be mapped to which actual url. ^details/(.+)$ takes a user friendly url /details/shantibhushan and extracts “shantibhushan” as $1. It then replaces $1 into details.php?user=$1 resulting in details.php?user=shantibhushan as the actual url.

    – Edit details.php as follows
    <?php
    $user= $_REQUEST[‘user’];
    print(“<h1>$user</h1>”);
    ?>

    – The above sample simply takes “user” from details.php?user={user} and shows it back.

    – Done! Try accessing http://localhost/rewrite/details/shantibhushan and you should see details.php getting called with parameter as “shantibhushan”

    TODO
    – Simply accessing details/ results in error, and rewrite rule doesn’t assume such a case. It can be handled by RewriteCond
    – First I wanted to have details:shantibhushan as the url, but this has a bug on Windows not allows : in path. It seems to work fine on non-Windows.
    – The example assumes Apache is running on port 80 on your machine.