HTML52014. 8. 13. 00:03

AutocompleteEditor.prototype.updateChoicesList = function (choices) {


     this.choices = choices;


    this.$htContainer.handsontable('loadData', Handsontable.helper.pivot([choices]));


/*    if(this.cellProperties.strict === true){

      this.highlightBestMatchingChoice();

    }*/

    var value = this.getValue();

    var rowToHighlight;


    if(this.cellProperties.strict === true){


      rowToHighlight = findItemIndexToHighlight(choices, value);


      if ( typeof rowToHighlight == 'undefined' && this.cellProperties.allowInvalid === false){

        rowToHighlight = 0;

      }


    }


    if(typeof rowToHighlight == 'undefined'){

      this.$htContainer.handsontable('deselectCell');

    } else {

      this.$htContainer.handsontable('selectCell', rowToHighlight, 0);

    }


    this.focus();

  };

'HTML5' 카테고리의 다른 글

d3에 대해 배우는 방법 정리  (0) 2014.11.28
특수기호 표시  (0) 2014.10.02
부트스트랩 관련 블로그  (0) 2013.08.13
Dectecting Mobile Devices with Javascript  (0) 2012.12.04
What’s Coming in Sencha Touch 2.1  (0) 2012.09.14
Posted by 미랭군
웹어플리케이션서버2014. 7. 24. 11:51

시스템 사용량이 많아 Tomcat 서버를 여러 대로 분할하려고 했으나 재정상 L4 스위치를 구비하기 어려운 경우가 발생하여 S/W적으로 이를 대체할 만한 방법을 찾다보니 Nginx라는 것이 이 역할을 한다는 것을 알고 직접 구성해보았다.

설치방법1

http://blog.naver.com/adventurez/193335400

설치방법2

http://opentutorials.org/module/384/4511

위 블로그를 참조하여 nginx를 설치

Test환경

서버가 한대 밖에 없을 경우

사용자 Browser1 -> nginx(80, 443) -> Tomcat1:8080

사용자 Browser1 -> nginx(80, 443) -> Tomcat2:8090


1. tomcat1/conf/sever.xml에 포트 8080으로 변경

2. tomcat2/conf/server.xml에 포트 8090으로 변경 및 각 포트 정보 아래와 같이 앞에 2를 붙임

   - <Server port="28005" shutdown="SHUTDOWN">

   - <Connector URIEncoding="UTF-8" port="28009" protocol="AJP/1.3" redirectPort="28443"/>

3. 같은 서버에 두 개의 Tomcat Instance를 실행할 경우 Session이 꼬이는 문제가 발생하므로 tomcat2/bin/catalina.sh에 아래와 같이 변경 필요

JAVA_OPTS="-Xms512M -Xmx1024M -Djava.awt.headless=true Dorg.apache.catalina.SESSION_COOKIE_NAME=MYSESSIONID -Dorg.apache.catalina.SESSION_PARAMETER_NAME=myjsessionid"


서버가 여러 대일  경우(서버A, 서버B, 서버C)

* 서버A에 nginx를 두고 나머지 서버B, C에 Tomcat설치 구성

* 서버A스펙이 좋을 경우에는 서버A에 nginx, Tomcat1를 두고 서버B, C에 각각 Tomcat2,3설치 구성도 가능


사용자 Browser1 -> nginx(80, 443) -> Tomcat1

사용자 Browser1 -> nginx(80, 443) -> Tomcat2


1. nginx1.6/conf/nginx.conf에 아래와 같이 수정 필요

upstream myapp1 {

ip_hash;

        server tomcat1 ip;

        server tomcat2 ip;

    }

    server {

        listen tomcat1 ip:80;

        location / {

            proxy_pass http://myapp1;

        }

 }

* 세션 클러스터링을 하지 않을 경우 ip_hash의 옵션을 주어 IP기준 최초 접속한 서버로 계속 연결을 포워딩 시켜줘야 함.
* 세션 클러스터링 구성을 할 경우 굳이 주지 않아도 상관 없음.
 server tomcat1 ip weight=5;와 같이 뒤에 weight옵션을 두면 부하를 수동으로 조정가능함(5의 지정할 경우 1로 지정한 서버보다 5배 접속)


나머진 알아서!


Posted by 미랭군
카테고리 없음2014. 7. 11. 16:37

1. Flume 라이브러리 다운 후 압축 풀기

 wget http://mirror.apache-kr.org/flume/1.4.0/apache-flume-1.5.0-bin.tar.gz
   tar zxvf apache-flume-1.5.0.bin.tar.gz


2. 환경변수 설정

   vi .bash_profile
   export FLUME_HOME=/home/bigdata/apache-flume-1.4.0-bin
   export PATH=$PATH:$FLUME_HOME/bin
   :wq
   source .bash_profile


3. Flume Configuration

   cd $FLUME_HOME/conf
   cp flume-conf.properties.template flume.conf
   vi flume.conf

agent.sources = seqGenSrc
agent.channels = memoryChannel
agent.sinks = hdfsSink

# For each one of the sources, the type is defined
agent.sources.seqGenSrc.type = exec
agent.sources.seqGenSrc.command = tail -F /home/bigdata/hadoop-1.2.1/logs/hadoop-hadoop-namenode-localhost.localdomain.log
#가상분산환경에서 테스트용으로 잡은것.

# The channel can be defined as follows.
agent.sources.seqGenSrc.channels = memoryChannel

# Each sink's type must be defined
agent.sinks.hdfsSink.type = hdfs
agent.sinks.hdfsSink.hdfs.path = hdfs://localhost:9000/flume/data     #테스트용
agent.sinks.hdfsSink.rollInterval = 30
agent.sinks.hdfsSink.sink.batchSize = 100

#Specify the channel the sink should use
agent.sinks.hdfsSink.channel = memoryChannel

# Each channel's type is defined.
agent.channels.memoryChannel.type = memory

# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent.channels.memoryChannel.capacity = 100000
agent.channels.memoryChannel.transactionCapacity = 10000


:wq

4. 동작 테스트
   cd ~
   flume-ng agent --conf-file ./apache-flume-1.4.0-bin/conf/flume.conf --name agent


Posted by 미랭군