Symmetric Multiprocessing (SMP:대칭형 다중처리)

 - 여러개의 프로세서가 탑재되어 있고, 각 프로세서에 부하를 균등하게 분배할 수 있는 OS가 설치된 컴퓨터 시스템을 일컫는 단어

'Erlang' 카테고리의 다른 글

[UTF-8 인코딩] - String to binary  (0) 2015.09.02
분산 테스트  (0) 2015.08.17
참조 투명성?  (0) 2015.08.04
Erlang/OTP 란?  (0) 2015.08.03
Posted by 짱가쟁이
2015. 8. 17. 14:51

테스트 환경


OS - windows7

노트북-A(211.xxx.xxx.101) 

노트북-B(211.xxx.xxx.102


노트북-A


 - 노드 시작

  : werl -name a@211.xxx.xxx.101 -setcookie abc


(a@11.xxx.xxx.101)1> kvs:start().


노트북-B


 - 노드 시작

  : werl -name b@211.xxx.xxx.102 -setcookie abc


 - 테스트
  (b@11.xxx.xxx.102)1> rpc:call('a@211.232.21.50', kvs, store, [weather,cold]).
 (b@11.xxx.xxx.102)2> net_kernel:connect('a@211.232.21.50').

 - 추신 : 노드 이름은 Name@Host 형태이고, Name과 Host는 모두 Atom이다. 만약 Atom이 아닌 문자가 들어 있는 경우에는 인용 부호('')로 감싸야 할 것이다.  (출처 - 프로그래밍얼랭/인사이트) 


'Erlang' 카테고리의 다른 글

[UTF-8 인코딩] - String to binary  (0) 2015.09.02
Symmetric Multiprocessing (SMP:대칭형 다중처리)  (0) 2015.08.28
참조 투명성?  (0) 2015.08.04
Erlang/OTP 란?  (0) 2015.08.03
Posted by 짱가쟁이
2015. 8. 10. 09:21


클러스터링

 - 테스트환경 : V3.X

 - 잡설 : 임베디드 모드로 실행하면 클러스터링 동작 안함

 

cluster.xml

<join>

    <multicast enabled="true">

        <multicast-group>224.2.2.3</multicast-group>

        <multicast-port>54327</multicast-port>

    </multicast>

    <tcp-ip enabled="false">

        <interface>xxx.xxx.xxx.xxx</interface> 

    </tcp-ip>

    ....

<join>


<interfaces enabled="true">

    <interface>xxx.xxx.xxx.xxx</interface>

    <interface>xxx.xxx.xxx.xxx</interface>

</interfaces>



실행

Main class : io.vertx.core.Starter

Arguments : run platform.vertx.EchoServer -cluster -cluster-host xxx.xxx.xxx.xxx


-cluster-host는 해당 서버 아이피 (중요)


Posted by 짱가쟁이
2015. 8. 4. 17:59

Referential Transparency

- 함수는 항상 같은 파라미터에 같은 결과를 반환해야한다. 정도로 이해하면되나? 

'Erlang' 카테고리의 다른 글

[UTF-8 인코딩] - String to binary  (0) 2015.09.02
Symmetric Multiprocessing (SMP:대칭형 다중처리)  (0) 2015.08.28
분산 테스트  (0) 2015.08.17
Erlang/OTP 란?  (0) 2015.08.03
Posted by 짱가쟁이
2015. 8. 3. 08:47

Erlang

 - Functional Programming Language이며, 동시성/높은 신뢰성을 갖춘 서버 개발 환경으로 이해하면 무난할 듯 싶다.


OTP 란?

- Open Telecom Platform (OTP)으로, 표준라이브러리및 각종 도구의 모음으로 생각하며 됨. 


'Erlang' 카테고리의 다른 글

[UTF-8 인코딩] - String to binary  (0) 2015.09.02
Symmetric Multiprocessing (SMP:대칭형 다중처리)  (0) 2015.08.28
분산 테스트  (0) 2015.08.17
참조 투명성?  (0) 2015.08.04
Posted by 짱가쟁이
2015. 2. 6. 09:44

jboss manager를 사용하여 배포


pom.xml

..........

<build>

<plugins>

<plugin>

<groupId>org.jboss.as.plugins</groupId>

<artifactId>jboss-as-maven-plugin</artifactId>

<version>7.4.Final</version>

<executions>

<execution>

<id>test_id</id>

<phase>install</phase>

<goals>

<goal>deploy</goal>

</goals>

<configuration>

<force>true</force>

<hostname>127.0.0.1</hostname>

<port>9999</port>

<username>username</username>

<password>pwssword</password>

</configuration>

</execution>

</executions>

</plugin>

..........


goals

clean install


Posted by 짱가쟁이

maven 코드 커버리지 플러그인


pom.xml

.....

                 <plugin>

    <groupId>org.codehaus.mojo</groupId>

       <artifactId>cobertura-maven-plugin</artifactId>

       <version>2.6</version>

   </plugin>

</plugins>

    </reporting>

...

             <plugin>

          <groupId>org.codehaus.mojo</groupId>

          <artifactId>cobertura-maven-plugin</artifactId>

          <version>2.6</version>

          <configuration>

                          <formats>

          <foramt>html</foramt>

          <foramt>xml</foramt>

          </formats>

          <instrumentation>

        <ignores>

                  <ignore>platform.web.common.*</ignore>

             </ignores>

             <excludes>

              <exclude>platform/web/common/**</exclude>

             </excludes>

        </instrumentation>

       </configuration>

        </plugin>

    </plugins>

</build>


goal

clean site:site cobertura:cobertura


'maven' 카테고리의 다른 글

로컬 저장소(local repository) 없이 jar 파일 추가하기  (0) 2016.05.03
jobss 7.1.Final 배포  (0) 2015.02.06
[PMD] - reporting 설정  (0) 2015.02.02
Posted by 짱가쟁이
2015. 2. 2. 14:14

출처 : http://lesstif.com/pages/viewpage.action?pageId=22643564 


site plugin을 사용하여 PMD 리포트를 생성


pom.xml

..........

<reporting>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-pmd-plugin</artifactId>

<version>3.3</version>

<configuration>

<format>xml</format>

<minimumTokens>100</minimumTokens>

<targetJdk>1.6</targetJdk>

<linkXref>true</linkXref>

<sourceEncoding>UTF-8</sourceEncoding>

<rulesets>

<ruleset>file:///${project.basedir}/bms-pmd-ruleset.xml</ruleset>

</rulesets>

<excludes>

<exclude>platform/web/common/**</exclude>

</excludes>

<excludeRoots>

<excludeRoot>target/generated-sources/*</excludeRoot>

</excludeRoots>

</configuration>

<reportSets>

<reportSet>

<reports>

<report>pmd</report>

</reports>

</reportSet>

</reportSets>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-jxr-plugin</artifactId>

<version>2.5</version>

</plugin>

</plugins>

</reporting>

..........


goals

clean site:site


Posted by 짱가쟁이

- 함수 생성

-- $1 : lat (기준점:위도)

-- $2 : lng  (기준점:경도)

-- $3: lat (target : 위도)

-- $4 : lng (target : 경도)

create function fn_geo_distance(double precision, double precision, double precision, double precision) returns double precision as $$

select 

   ( 

(

   acos(

   sin( $1 * PI() /180.0 ) * 

   sin( $3 * PI() /180.0 ) + 

   cos( $1 * PI() /180.0 )  * 

   cos( $3 * PI() /180.0 ) * 

   cos( ($2 - $4) * PI() /180.0  ) 

   ) 

) *  180.0 / PI() 

   ) * 60*1.1515*1.609344*1000 

)

$$ LANGUAGE SQL;


- 사용 예

select fn_geo_distance(37.51084072964695, 127.01951086521149, cast(lat as double precision), cast(lng as double precision)) as distance


ps

 - 계산 알고리즘은 이해 못함. (ㅠㅠ)

'DBMS > postgresql' 카테고리의 다른 글

[poostgresql] - postgis 사용하여 반경 검색하기  (0) 2015.01.09
[postgresql] - OIDS 란?  (0) 2015.01.02
Posted by 짱가쟁이

1. 설치

우분투

 : http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt

CentOS

 :  http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21CentOS6pgdg


2. 테이블 생성

CREATE TABLE tb_poi

(

    idx INTEGER not null,

    gps geometry, 

    CONSTRAINT pk_poi PRIMARY KEY (idx)

)

WITH (

    OIDS=FALSE

);


3. 데이터 입력

WGS84:4326 좌표계로 거리 계산이 안되기 때문에 EPSG:2097 좌표계로 변환하여 데이터 입력함


- geometry : WGS84 좌표계 (경도/위도)

    : ST_GeomFromText('POINT(127.01763868331909 37.508993923524145)', 4326)

- geometry : WGS84 좌표계 -> EPSG 좌표계 변환

    : ST_Transform(ST_GeomFromText('POINT(127.01763868331909 37.508993923524145)', 4326), 2097)


INSERT INTO tb_poi(idx, gps) VALUES (1, ST_Transform(ST_GeomFromText('POINT(127.01763868331909 37.508993923524145)', 4326), 2097));


4. 반경검색

WGS84:4326 좌표계를 EPSG:2097 좌표계로 변환하여 반경검색 

 - 미터기준


SELECT *  -- 100미터 반경 검색에 포함된 POI 조회

FROM tb_poi

WHERE 

    ST_DWithin(gps, ST_Transform(ST_GeomFromText('POINT(127.01937675476074 37.50916413798163)', 4326), 2097), 100); 


'DBMS > postgresql' 카테고리의 다른 글

WGS84 거리 계산 함수  (0) 2015.01.15
[postgresql] - OIDS 란?  (0) 2015.01.02
Posted by 짱가쟁이