Ask To Apps
  • Home
  • WordPress
  • Elasticsearch
  • PHP
  • Linux
  • Website Peformance

Tag : remote-sync

Lsyncd Installation and Configuration

20/08/2013 Article

Login on server as a “root” user.

cd /usr/local/
wget http://lsyncd.googlecode.com/files/lsyncd-2.1.5.tar.gz
tar \-xvzf lsyncd-2.1.5.tar.gz
cd lsyncd-2.1.5
yum install gcc-c+\+
yum install lua
yum install lua-devel
./configure
make
make install

Now we need to create Linux daemon which call up our customized lsyncd config file. Daemon script would be like…

. /etc/rc.d/init.d/functions
user=glmstudio
config="<path>/lsyncd.lua"
lsyncd="/usr/local/bin/lsyncd"
lockfile="<lock PATH>/lsyncd"
prog="lsyncd"
RETVAL=0
start() {
        if [ -f $lockfile ]; then
        echo -n $"$prog is already running: "
        echo
        else
        echo -n $"Starting $prog: "
        #su - $user -c "$lsyncd $config -insist"
        daemon --user $user $lsyncd $config -insist
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && su - $user -c "touch $lockfile"
        return $RETVAL
        fi
    }
stop() {
        echo -n $"Stopping $prog: "
        killproc -d 60 lsyncd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f $lockfile
        return $RETVAL
    }
case "$1" in
        start)
        start
        ;;
        stop)
        stop
        ;;
        restart)
        stop
        start
        ;;
        status)
        status lsyncd
        ;;
        *)
        echo "Usage: lsyncd {start|stop|restart|status}"
        exit 1
    esac
    exit $?

</lock></path>

Lsyncd.lua file would have your sync configuration. Something as follows.

--SETTINGS
settings {
    logfile         = "<path>/lsyncd.log",
    statusFile      = "</path><path>/lsyncd.stat",
    statusInterval  = 300
    }
--ENDSETTINGS
--SERVERS
 serverlist = {"SERVER1:DISTINATION",
"SERVER2:DISTINATION"}
--ENDSERVERS
for _, server in ipairs(serverlist) do
  sync {
    default.rsync,
    source="<source PATH/>",
    target=server,
     delay = 30,
    rsync  = {
        protect_args = false
    }
  }
end

</path>

How to start and stopwatch film King Arthur: Legend of the Sword now

/etc/init.d/lsyncd start

/etc/init.d/lsyncd stop

There might be the issue during start of lsyncd, as some time list of files are more than max user watches. For fixing this we need to change from following file.

/proc/sys/fs/inotify/max_user_watches

//Command 

echo "819211" > /proc/sys/fs/inotify/max_user_watches

Categories: Linux, Website Peformance

Tags: lsyncd, remote sync, sync

About Author:

Elasticsearch Installation and Configuration

25/03/2013 Article

Elasticsearch is …

  • Open Source (Apache 2)
  • Distributed
  • RESTful
  • Search Engine built on top of Apache Lucene.

It is …..

  1. Very fast
  2. Schema Free
  3. JSON over HTTP
  4. Scale to hundred and real time search.

 Installation

Elasticsearch is based on java, so we need to install JAVA>6


yum install java-1.7.0-openjdk.x86_64
java -version

Download source from


wget https://download.elasticsearch.org/
elasticsearch/elasticsearch/elasticsearch-0.20.5.tar.gz
tar -xvf elasticsearch-0.20.5.tar.gz
cp -r elasticsearch-0.20.5.tar.gz elasticsearch
cd elasticsearch

Add elastic home path in “.bash_profile”


export $ES_HOME=/home/elasticsearch

Start/Run Elasticsearch


cd elasticsearch
bin/elasticsearch -f

Is it started?

You can confirm it by browsing URL like - http://127.0.0.1:9200/, it will shows something like


{
"ok" : true,
"status" : 200,
"name" : "Neville, Kate",
"version" : {
"number" : "0.20.5",
"snapshot_build" : false
},
"tagline" : "You Know, for Search"
}

 

Categories: Elasticsearch, Linux, Website Peformance

Tags: Apache Lucene, Distributed, Elastic Index, Elasticsearch, JSON over HTTP, Linux Commands, Open Source, optimization, performance, real time search, remote sync, RESTful, Scale, Schema Free, Search Engine, Search Index, Very fast

About Author:

Recent Posts

  • Install and configure logstash-forwarder
  • Redirect request on php script through squid proxy
  • Alerting for Elasticsearch : Log watcher in elasticsearch using ES Watcher
  • Detect face from image using python script with OpenCV
  • Change mysql root password on centos
  • Search part of word in elasticsearch using nGram – auto-complete search
  • Connect VPN on centos linux using command line
  • Custom river plugin in elasticsearch
  • Backup elasticsearch with snapshot and restore api
  • PHP code to exact keywords from text.

Tags

apache Apache Lucene cache Distributed Elastic Index Elasticsearch elasticsearch performance Git Clone Git Hub Git Hub Configuration Git Hub Installation grep Import Install MySQL JSON over HTTP Linux Linux Command Linux Commands Linux search local file lsyncd md5sum Multile Domain Multisite MySQL Open Source optimization performance php performance real time search remote file Remote Git Hub remote sync RESTful Scale Schema Free Search Engine Search Index Search keyword static cache Sub Domain sync Very fast Wordpress Wordpress multisite

Copyright Ask To Apps 2021 | Proudly powered by WordPress

facebook twitter google linkedin Email Rss