Skip to main content

Posts

Apache Tomcat Load Balance in windows

- apache tomcat Load Balance 1. apache installation httpd-2.2.25-win32-x86-openssl-0.9.8y.msi 2. Module copy tomcat-connectors-1.2.40-windows-i386-httpd-2.2.x/mod_jk.so => /apache/modules/mod_jk.so 3. tomcat copy /apache-tomcat-7 /apache-tomcat-72 4. apache configuration modify /apache/conf/httpd.conf # apache-tomcat connector <IfModule mod_proxy.c> <IfModule mod_proxy_ajp.c> Include "conf/extra/httpd-apj.conf" </IfModule> </IfModule> LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties JkLogLevel info JkLogFile logs/mod_jk.log JkMount /*.html lb JkMount /*.jsp lb JkMount /*.ajax lb JkMount /*.xpl lb JkMount /j_spring_security_check lb DocumentRoot "/wtpwebapps/testApp" <Directory "/wtpwebapps/testApp">    Options Indexes FollowSymLinks    AllowOverride None    Order allow,deny    Allow from all </Directory> <Location /jkmanage...

Port forwarding with ELB in AWS vs NginX

< requirement > input 1 : http://aaa1.testdomain.com internal service 1 : http://localhost:3000 input 2 : http://aaa2.testdomain.com internal service 2 : http://localhost:3001 < 1. AWS approach > 1. create LoadBalancers cf. https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LoadBalancers: ㅇ create Load Balancer for 1st port 1. Define Load Balancer Load Balancer name: aaa1-test Load Balancer Port: 80 Instance Port: 3000 2. Configure Health Check Ping Path: it's important! 3. Add EC2 Instances: Add EC2 Instances to Load Balancer 4. check out the domain and service (1st Load Balancer's Description > DNS Name > A Record : ex) aaa1-test-1425011489.us-east-1.elb.amazonaws.com ) - test service : http://aaa1-test-1425011489.us-east-1.elb.amazonaws.com ㅇ create Load Balancer for 2nd port 1. Define Load Balancer Load Balancer name: aaa2-test Load Balancer Port: 80 Instance Port: 3001 2. Conf...

experience sharing for real-time log indexing in Elasticsearch

Elasticsearch automatically makes type mapping with log data, but in the most of cases, the mapping data is not correct, so we should change them. this is my experience of that. 1) run elasticsearch 2) run logstash with configration elk:/data1/elasticsearch/logstash-1.4.0> vi logstash-teton_runtime.conf& input{     file{         codec => json         path => ["/data1/elasticsearch/temp/*.log"]         start_position => "end"     } } output{     elasticsearch {         cluster => "locketCast"         node_name => "logstash-teton_runtime"         host => "xxx.xxx.xxx.xxx"         index => "teton_runtime"     } } elk:/data1/elasticsearch/logstash-1.4.0> bin/logstash -f mixpanel.conf 3) make log file in /data1/elasticsearch/temp/*.log {"androidId":"91e8b0...

Fluentd for mysql in AWS

(0) preparation ulimit -n If your console shows 1024, it is insufficient. Please add following lines to your /etc/security/limits.conf file and reboot your machine. root soft nofile 65536 root hard nofile 65536 (1) install Fluentd // “Ubuntu 12.04 LTS / Precise” curl -L http://toolbelt.treasuredata.com/sh/install-ubuntu-precise.sh | sh /etc/init.d/td-agent start/stop/restart/status // test curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test /etc/init.d/td-agent stop chown: changing ownership of `/var/run/td-agent/td-agent.pid': Operation not permitted chown: changing ownership of `/var/run/td-agent': Operation not permitted  * Stopping td-agent td-agent                                                                                   ...

LEK stack for node.js

LEK stack for node.js  1) node access log file 1. node access log json formatting   (/Users/mac/git/fuji/config/express.js) app.use(expressWinston.logger({      transports: [        new winston.transports.DailyRotateFile({  json: true ,  filename: config.logs_dir + '/access-',  datePattern: 'yyyy-MM-dd.log' })      ]    })); 2) logstash 1. logstash download http://logstash.net/ extract file to mac:/data1/logstash-1.4.0 2. make config file mac:/data1/logstash-1.4.0> vi logstash-node.conf input{    file{        codec => json        path => ["/Users/mac/git/fuji/logs/access*.log"]        start_position => "beginning"    } ...

imagemagick node.js module error in macbook

When you use imagemagick module in macbook and get this error, then you can follow below steps. var im = require('imagemagick'); im.resize({     srcPath: "/Users/mac/tmp/test/a.jpg",     destPath: "/Users/mac/tmp/test/a1.jpg",     width: 200,     height: 200,     quality: 0.8 }, function(error, stdout, stderror) {     if (error) {        console.error(error); } }); "Command failed: convert: unable to load module `/usr/local/Cellar/imagemagick/6.8.7-7/lib/ImageMagick//modules-Q16/coders/jpeg.la': file not found @ error/module.c/OpenModule/1277. convert: no decode delegate for this image format `/Users/mac/tmp/test/test.jpg' @ error/constitute.c/ReadImage/555. convert: no images defined `jpg:-' @ error/convert.c/ConvertImageCommand/3145. " brew update brew doctor brew uninstall imagemagick brew uninstall libtool brew install libtool ( --universal ) brew install imag...

elasticsearch with hanb-elasticsearch-beginner

1) making server You can make a clustered server which contains 3 folders, node1, node2, node3. Each of node has a configuration file like "elasticsearch.yml". node.name: "node1" transport.tcp.port: 9300 http.port: 9200 node.name: "node2" transport.tcp.port: 9301 http.port: 9201 node.name: "node2" transport.tcp.port: 9302 http.port: 9202 2) running server And you can run the each server with this command. ./elasticsearch/node1> ./start.sh ./elasticsearch/node2> ./start.sh ./elasticsearch/node3> ./start.sh cf. https://github.com/doohee323/hanb-elasticsearch-beginner