<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0">
 <title type="html">그루비 groovy</title>
 <id>http://groovy.pe.kr/atom</id>
 <link rel="alternate" type="text/html" hreflang="ko" href="http://groovy.pe.kr/"/>
 <subtitle type="html">그루비 groovy : 자바 가상 기계에서 동작하는 프로그래밍 언어. 루비 ruby를 본따서 만들었다. 

이 블로그에는 그루비,루비,파이썬,클로저 따위따위에 대한 글과, 프로그래밍에 관련된 잡담이 올라온다.</subtitle>
 <updated>2010-06-19T15:59:50+09:00</updated>
 <generator>Textcube.com 2.0 Garnet</generator>
 <entry>
  <title type="html">톰캣 넷빈즈 그루비 스칼라</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/52"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/52" thr:count="0"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/52</id>
  <updated>2010-02-15T04:24:31+09:00</updated>
  <published>2010-02-15T04:10:24+09:00</published>
  <summary type="html">넷빈즈에서 톰캣에 곧바로 디플로이 할 수 있는 방법은 요기에 : http://groovy.pe.kr/51 이제 넷빈즈에서 그루비, 스칼라로 JDBC에 접근하는 법을 보자. 먼저, 서버와 로컬에 scala 설치 (현재 버전은 2.7.7), groovy 설치 (2.7.0) 서버쪽에서는 /usr/share/tomcat6/lib 에서 [code] ln -s /usr/share/groovy/lib/groovy-all-1.7.0.jar ln -s /usr/share/java/scala-library.jar ln -s /usr/share/java/scala-dbc.jar ln -s /usr/share/java/mysql.jar [/code] 따위를 해둔다. 그리고 넷빈즈의, library에서 Add Jar를 해서 scala-library.jar와 scala-compiler.jar, groovy-all-1.7.0 를 추가해준다. 그리고, 문제의 build.xml 은 아래쪽에 실었다. 시행착오 끝에 만들긴 했는데, 나중에 정식 지원되면 허무할듯. 이제는 src/java 자리에 xx.java, xx.scala, xx.groovy 로 서블릿 만들면 모두 잘 컴파일되고, war 만들어지고, 디플로이하면 서버에 올라간다. ^^ 그리고, 여전히 속도테스트를 해봤는데, 테스트는 데이터베이스 서버에 접속해서 데이터 긁어오고, 브라우저로 쏴주는 단순한 것. (레코드 50만개중에서 200개를 가져오게 했다) 자바로 만든 서블릿은 Time per request: &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.273 [ms] (mean) Time per request: &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.318 [ms] (mean, across all concurrent requests) 스칼라로 만든 서블릿은 Time per request: &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.261 [ms] (mean) Time per request: &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.315 [ms] (mean, across all concurrent requests) 그루비로 만든 서블릿은 Time per request: &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.836 [ms] (mean) Time per request: &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.459 [ms] (mean, across all concurrent requests) 그루비가 느렸다. 저게 문제가 될정도는 아닌 것같다. 게다가 Groovy++도 나오면.. ㅎㅎ (스칼라는... 자바버전보다 빠르게 나왔는데, 단순 스트레스 테스트였기 때문인.. 아닌지 모르겠다.) 하지만, 아직 나에겐 스칼라 문법은 어색 어색. 그루비가 코딩하기 편했다. 자. 문제의 build.xml [code] &amp;lt;target name=&amp;quot;taskdef-scala&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;taskdef resource=&amp;quot;scala/tools/ant/antlib.xml&amp;quot;&amp;nbsp; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;pathelement location=&amp;quot;${file.reference.scala-compiler.jar}&amp;quot; /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;pathelement location=&amp;quot;${file.reference.scala-library.jar}&amp;quot; /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;/taskdef&amp;gt; &amp;lt;/target&amp;gt; &amp;lt;taskdef name=&amp;quot;groovyc&amp;quot; classname=&amp;quot;org.codehaus.groovy.ant.Groovyc&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; classpath=&amp;quot;c:/Tools/groovy/embeddable/groovy-all-1.7.0.jar&amp;quot;/&amp;gt; &amp;lt;target name=&amp;quot;-init-macrodef-javac&amp;quot; depends=&amp;quot;taskdef-scala&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;macrodef name=&amp;quot;javac&amp;quot; uri=&amp;quot;http://www.netbeans.org/ns/web-project/2&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;attribute default=&amp;quot;${src.dir}&amp;quot; name=&amp;quot;srcdir&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;attribute default=&amp;quot;${build.classes.dir}&amp;quot; name=&amp;quot;destdir&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;attribute default=&amp;quot;${javac.classpath}:${j2ee.platform.classpath}&amp;quot; name=&amp;quot;classpath&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;attribute default=&amp;quot;${includes}&amp;quot; name=&amp;quot;includes&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;attribute default=&amp;quot;${excludes}&amp;quot; name=&amp;quot;excludes&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;attribute default=&amp;quot;${javac.debug}&amp;quot; name=&amp;quot;debug&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;attribute default=&amp;quot;${empty.dir}&amp;quot; name=&amp;quot;gensrcdir&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;element name=&amp;quot;customize&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;sequential&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property location=&amp;quot;${build.dir}/empty&amp;quot; name=&amp;quot;empty.dir&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;mkdir dir=&amp;quot;${empty.dir}&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;groovyc&amp;nbsp; destdir=&amp;quot;@{destdir}&amp;quot; srcdir=&amp;quot;@{srcdir}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; encoding=&amp;quot;utf-8&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; excludes=&amp;quot;@{excludes}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; includeantruntime=&amp;quot;false&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; includes=&amp;quot;@{includes}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;src&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;dirset dir=&amp;quot;@{gensrcdir}&amp;quot; erroronmissingdir=&amp;quot;false&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;include name=&amp;quot;*.groovy&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/dirset&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/src&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;path path=&amp;quot;@{classpath}&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/groovyc&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;javac debug=&amp;quot;@{debug}&amp;quot; source=&amp;quot;${javac.source}&amp;quot; target=&amp;quot;${javac.target}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; srcdir=&amp;quot;@{srcdir}&amp;quot; destdir=&amp;quot;@{destdir}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; deprecation=&amp;quot;${javac.deprecation}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; encoding=&amp;quot;${source.encoding}&amp;quot; excludes=&amp;quot;@{excludes}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; includeantruntime=&amp;quot;false&amp;quot; includes=&amp;quot;@{includes}&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;src&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;dirset dir=&amp;quot;@{gensrcdir}&amp;quot; erroronmissingdir=&amp;quot;false&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;include name=&amp;quot;*.java&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/dirset&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/src&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;path path=&amp;quot;@{classpath}&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;compilerarg line=&amp;quot;${endorsed.classpath.cmd.line.arg}&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;compilerarg line=&amp;quot;${javac.compilerargs}&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;customize/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/javac&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;scalac srcdir=&amp;quot;@{srcdir}&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destdir=&amp;quot;@{destdir}&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;include name=&amp;quot;**/*.scala&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;pathelement location=&amp;quot;${file.reference.scala-compiler.jar}&amp;quot; /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;pathelement location=&amp;quot;${file.reference.scala-library.jar}&amp;quot; /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;path path=&amp;quot;@{classpath}&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/classpath&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/scalac&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/sequential&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;/macrodef&amp;gt; &amp;lt;/target&amp;gt; [/code] * 그루비 참고 : http://www.ighani.info/?p=32&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/52&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">넷빈즈 톰캣 연동</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/51"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/51" thr:count="0"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/51</id>
  <updated>2010-02-15T00:09:09+09:00</updated>
  <published>2010-02-15T00:07:53+09:00</published>
  <summary type="html">로컬에 넷빈즈와 톰캣을 설치하면, 연동하는데 아무 문제가 없다. 하지만 톰캣이 외부에 있다면? 구글로 remote tomcat server deploy netbeans 를 종일 검색했다. 끙끙거리고 실패했던 시간들에 비하면 허무할 만큼 간단한 해법을 찾았다. 프로젝트에 build.xml에 다음 내용 추가 [code xml] &amp;nbsp; &amp;lt;target name=&amp;quot;tomcat-deploy-war&amp;quot; description=&amp;quot;Deploy the App to Tomcat&amp;quot;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;taskdef name=&amp;quot;deploy&amp;quot; classname=&amp;quot;org.apache.catalina.ant.DeployTask&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; classpath=&amp;quot;c:/TOMCAT_DIR/lib/catalina-ant.jar&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;lt;dirname file=&amp;quot;${dist.war}&amp;quot; property=&amp;quot;dist.jar.dir&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;lt;mkdir dir=&amp;quot;${dist.jar.dir}&amp;quot;/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;deploy update=&amp;quot;true&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url=&amp;quot;http://server_url:serverport/manager&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; username=&amp;quot;admin&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; password=&amp;quot;YOUR PASSWORD&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; path=&amp;quot;/&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; war=&amp;quot;file:d:/PROJECT_DIR/${dist.war}/&amp;quot;/&amp;gt; &amp;nbsp; &amp;lt;/target&amp;gt; &amp;nbsp; &amp;lt;target depends=&amp;quot;init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest,tomcat-deploy-war&amp;quot; name=&amp;quot;do-dist&amp;quot;&amp;gt; &amp;nbsp; &amp;lt;/target&amp;gt; [/code] (조기에서.. TOMCAT_DIR 과 PROJECT_DIR 을 넷빈즈 내부 변수로 바꾸는 것은 어찌하는 것인지 못찾음. 아는 분은 조언바랍니다.) 서버의 /etc/tomcat6/tomcat-users.xml [code]&amp;lt;user username=&amp;quot;admin&amp;quot; password=&amp;quot;YOUR PASSWORD&amp;quot; roles=&amp;quot;standard,admin,manager&amp;quot;/&amp;gt;[/code] 환경 : 넷빈즈 6.8, 톰캣 6, 데비안 5 &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/51&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">톰캣 메모리 늘려주기</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/50"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/50" thr:count="0"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/50</id>
  <updated>2010-02-15T00:00:13+09:00</updated>
  <published>2010-02-15T00:00:13+09:00</published>
  <summary type="html">무식한 스트레스 테스트를 해보았다. [code]ab -kc5 -t10 http://test_server_ip/test_db_connect.jsp[/code] 에서 동시접속과 시간을 조금씩 늘려가면서.. 테스트해보는 것. 테스트 페이지의 내용은 데이터베이스에서 몇개의 레코드를 보여주는 정도. 아주 단순한 응급 처치 /etc/init.d/tomcat6에 메모리를 512메가까지 쓰도록 설정해줬다. [code]JAVA_OPTS=&amp;quot;-Djava.awt.headless=true -Xms512M -Xmx512M&amp;quot;[/code] 데비안에서 톰캣6의 기본 메모리는 최대 128까지 쓸수있도록 설정되어있다. 저게 전부는 아닐꺼고, 실전에서는 더 세련된 방법이 있을 것도 같지만.. 관련 오류 : java.lang.OutOfMemoryError: Java heap space 참고: http://heedy.pe.kr/entry/linux200807051 &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/50&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">톰캣, 글래스피쉬</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/49"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/49" thr:count="0"/>
  <category term="glassfish"/>
  <category term="J2EE"/>
  <category term="TOMCAT"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/49</id>
  <updated>2010-02-15T00:45:34+09:00</updated>
  <published>2010-02-13T17:59:01+09:00</published>
  <summary type="html">서버를 설치하면 항상 톰캣을 기본으로 깔았었다. 톰캣이야 맨날 보는 거니까 다루기는 편했지만... 상용서버에서도 이 녀석이 잘 견뎌주는지는 항상 의문이었다. 그렇다고, 웹로직을 살수도 없고 연휴를 맞이하여, 전부터 관심있던 글래스피쉬(GlassFish)를 설치해봤다. 혹시 이녀석이라면 비싼거 안사고도 웬만큼 견디는 환경을 구축할수 있지 않을까. 여차저차해서 설치에 성공, db 컨넥션 만들고, 서블릿과 jsp 에서 데이터를 집어와봤다. 스트레스를 해본다. ab 가 만능은 아니지만, 스트레스 테스트는 언제나 ab로.. [code]ab -kc4 -t30 http://test_server_ip:8080/TestS[/code] 해봤다. 약간 실망스러운 것이, 톰캣이나 글래스피쉬나 속도/실패비율이 크게 다르지 않았다. EJB3라던가.. 모니터링이라던가.. 따위따위가 별로 필요없고 서블릿만 쓰는 거라면 글래스피쉬의 도입효과는 크지 않을 것 같다. 역시 용도가 다른 것일뿐, 톰캣이 만들어온 안정적인 서블릿 컨테이너라는 영역은 다른 녀석들 (그리즐리나..) 에 비해 떨어지지 않았다. 사실 속도보다는 다른 측면에서 호감이 가게 되었다. 넷빈즈에서 개발하고 디플로이 하는 과정같은 것들을 한번 겪고나니 이거 없이 어떻게 개발하나 싶은 생각이 들었다. (톰캣도 그런 식으로 개발할 수 있다. 다들 이런 식으로 개발하고 있었는데, 나는 이제서야 .. 촌스럽게 ㅜㅜ ) 그리고, EJB3 나 모니터링 따위도 다시한번 고민하게 된다. (공부해야하나.. 라고) 열시간 정도 걸린 타이핑과 구글링끝에 찾아낸 간단 자료. http://www.youtube.com/watch?v=CKuoDm6bqRM http://nigibox.wordpress.com/2009/10/03/glassfish-apache-on-debian/ http://netbeans.org/kb/docs/javaee/javaee-gettingstarted-screencast.html [code] su - glassfish wget http://download.java.net/glassfish/v3/release/glassfish-v3.zip glassfish@s:/opt/glassfish$ unzip glassfish-v3.zip glassfish@s:/opt/glassfish$ mv glassfishv3/* /opt/glassfish/ cd /opt/glassfish/ bin/asadmin start-domain domain1 [/code] 관련자료: * 글래스 피쉬의 앞단인 그리즐리(Grizzly)가 NIO에 기반하기 때문에 톰캣보다 엄청 많은 접속을 처리할 수 있다는 주장 : http://blogs.sun.com/thea...., 하지만 뒷단에는 어차피 서블릿 컨테이너일뿐, 앞단은.. nginx가 있잖아? * 넷빈즈에서 그루비 스크립트 돌리는 동영상 강의 : http://www.screenca...51 * 넷빈즈에서 스칼라 돌리기 : http://wiki.netbeans.org/... (다음버전에서는 더 쉽게 지원될 듯) * 글래스피쉬는 서블릿 스펙 3.0을 지원한다. 파일 업로드가 스펙에 들어있는 듯. http://www.ibm.com/... &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/49&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">톰캣 6 에서 JDBC로 MYSQL 사용하기</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/46"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/46" thr:count="0"/>
  <category term="debian"/>
  <category term="JDBC"/>
  <category term="MySQL"/>
  <category term="TOMCAT"/>
  <category term="&#xD1B0;&#xCEA3;"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/46</id>
  <updated>2010-02-13T17:39:31+09:00</updated>
  <published>2010-02-13T02:47:29+09:00</published>
  <summary type="html">debian 5 에 tomcat 6.0.20 을 설치하고 테스트용 JSP를 작성해보았다. 기본 설정으로는 JDBC 연결이 되지 않는다. 먼저 설치 확인하고 톰캣에 mysql jar 연결 [code] apt-get install libmysql-java tomcat6 tomcat-common cd /usr/share/tomcat6/lib ln -s /usr/share/java/mysql.jar [/code] JSP Examples /etc/tomcat6/server.xml 수정 [code] &amp;nbsp; &amp;nbsp; &amp;lt;GlobalNamingResources&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ... &amp;nbsp; &amp;nbsp; &amp;lt;Resource name=&amp;quot;jdbc/mydbname&amp;quot; auth=&amp;quot;Container&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=&amp;quot;javax.sql.DataSource&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; username=&amp;quot;mysql_loginid&amp;quot; password=&amp;quot;mysql_pass&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; driverClassName=&amp;quot;com.mysql.jdbc.Driver&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url=&amp;quot;jdbc:mysql://server_ip:3306/databasename&amp;quot; /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ... &amp;nbsp; &amp;nbsp; &amp;lt;/GlobalNamingResources&amp;gt;[/code] (removeAbandoned 따위 인자는 안적는게 좋네요.. ㅜㅜ) /etc/tomcat6/context.xml 파일 수정 [code] &amp;lt;ResourceLink global=&amp;quot;jdbc/mydbname&amp;quot; &amp;nbsp;&amp;nbsp; name=&amp;quot;jdbc/mydbname&amp;quot; type=&amp;quot;javax.sql.DataSource&amp;quot; /&amp;gt; [/code] (만약... 호스트나 어플리케이션에 특화시키려면.. /etc/tomcat6/Catalina/[hostname]/[appname].xml 혹은 /etc/tomcat6/Catalina/[hostname]/ROOT.xml 에 적어야한다.) 자바 소스에서 사용할 때는 [code] Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(&amp;quot;java:comp/env/jdbc/mydbname&amp;quot;); Connection conn = ds.getConnection(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery(&amp;quot;select ...&amp;quot;); while(rst.next()) { ... } [/code] 다 했는데.. 이런 오류가 난다면, (Could not create connection to database server. Attempted reconnect 3 times. Giving up.) /etc/tomcat6/policy.d/04webapps.policy 에 다음 코드를 추가한다. [code] permission java.net.SocketPermission &amp;quot;데이터베이스서버_아이피:3306&amp;quot;, &amp;quot;connect&amp;quot;;[/code] 검색에 걸리게 하기 위해 설정을 제대로 안했을 때 나타나는 오류를 적어둔다. * Name jdbc is not bound in this Context * JSP Examples Cannot create JDBC driver of class &amp;#039;&amp;#039; for connect URL &amp;#039;null&amp;#039; JSP Examples * Cannot load JDBC driver class &amp;#039;com.mysql.jdbc.Driver&amp;#039; &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/46&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">그루비기반 게시판?</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/45"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/45" thr:count="0"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/45</id>
  <updated>2010-02-15T00:52:53+09:00</updated>
  <published>2010-01-15T19:34:36+09:00</published>
  <summary type="html">다른 이의 블로그를 읽다가, 이런 대목을 발견했다. 여기서 중요한 것은 승리한 기술이 항상 우월하지 않다는 점이다. 한 기술이 표준으로 선택되는 데에는 기술 자체의 편리성보다는 보급률이나 특허같은 기술 외부의 요인이 더 영향을 끼친다. 우리는 베타 방식의 비디오가 화질이나 여러 면에서 뛰어남에도 불구하고, 포르노를 쉽게 구할 수 있는 VHS에 밀린 사실을 잘 알고 있다. 꼭 뛰어난 기술이 승리하는 것은 아니며, 때로는 익숙하고 도입하기 쉬운(진입장벽이 낮은) 기술이 표준으로 자리잡기도 하는 것이다. - http://docean.egloos.com/4625621 써본 사람들은 편하다고 말하는데, 그루비 사용인구가 적은 것은, 제로보드와 같은 당장 적용가능한 템플릿이 없기 때문일까. &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/45&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">스칼라</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/44"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/44" thr:count="0"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/44</id>
  <updated>2010-01-14T00:30:49+09:00</updated>
  <published>2010-01-14T00:04:29+09:00</published>
  <summary type="html">스칼라가 좋다는 의견이 종종 있어서, 가끔 코드를 들여다보곤 했었다. 하지만 콜론이 너무 자주나오는게 이상하게 보기싫었다. 콜론들 덕분에 첫인상이 구겨졌고, 그 다음 진도는 나가기 힘들었었다. 오늘 Programming In Scala을 앞부분부터 다시 읽다가,&amp;nbsp; 1장을 건너뛰고 (건너뛰는게 더 좋은 것 같다.) 2장부터 진도를 나가보았다. 위의 그림은 62페이지 중간쯤에 나오는 그림이다. 자꾸 보니까 그런걸까. 콜론이나 &amp;quot;Int&amp;quot; 들이 눈에 거슬리지 않고, 대신 &amp;quot;=&amp;quot; 이 묘하게 감동적으로 눈에 들어왔다. 저게 함수 &amp;quot;정의&amp;quot;다. 그러고나서 보니까, &amp;quot;Int&amp;quot;도 &amp;quot;:&amp;quot;도 그닥 별스럽지 않게보였다. 이 그림은 앞의 함수를 정의하는 또다른 방법이다. 리턴 타입이 Int 임에 틀림없으니까 생략할 수 있단다. 아직, 그루비에서 처럼 SQL을 편하게 다룰수있는지 (어떤 사람은 groovy sql을 scala에서 쓰기도 한다. 그정도로 아직 스칼라쪽에 라이브러리가 부족하다.) 더 알아봐야한다. 그리고, 거의 첫번째 관문을 넘었을 뿐이다. 이런 곳의 코드를 보고 있으면, 여전히 불친절한 문법이란 생각이 든다. 힘든 산일수록 넘고나면 기쁘겠지만. &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/44&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">CouchDB</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/43"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/43" thr:count="0"/>
  <category term="couchDB"/>
  <category term="Groovy"/>
  <category term="&#xADF8;&#xB8E8;&#xBE44;"/>
  <category term="&#xCE74;&#xC6B0;&#xCE58;&#xB514;&#xBE44;"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/43</id>
  <updated>2010-01-01T19:50:54+09:00</updated>
  <published>2010-01-01T17:55:46+09:00</published>
  <summary type="html">몽고디비(MongoDB)로 마음이 쏠렸었는데, 너무 겉핥기로만 지나쳤다는 미안함이 있어, CouchDB도 테스트 해봤습니다. 드라이버 -------- 그루비쪽에서 보면, 몽고나 카우치나 거기서 거기더군요. 테스트에는 jcouchdb를 드라이버로 사용했습니다. 그루비에 내장된 REST 로 시도해보았는데, jcouchdb에 비해 너무 느리더군요. groovyx.net.http.RESTClient 는 구현이 제대로 안된 것 같습니다. jcouchdb는 자바용 드라이버이지만, 그루비에서도 이런 식으로 사용할 수 있었습니다. [code groovy] def db = new org.jcouchdb.db.Database(&amp;quot;xxx.xxx.xxx.xx&amp;quot;, 5987, &amp;quot;dbname&amp;quot;); def doc = [name:&amp;#039;박제권&amp;#039; ....] db.createDocument(doc); [/code] 테스트 ------ 테스트는 게시문 20만건, 사용자디비 6만건, 댓글 100만건 정도를 INSERT 해보았습니다. 서버는 몇군데서 돌아가면서 해봤는데, 체감결과는 비슷했습니다. 메모리가 많으면 더 잘도는 것 같긴합니다만, 워낙 느려서... 다음은 기록해둘만한 사항들입니다. 버전 ---- 데비안에서 couchdb의 안정버전은 아직도 0.8 입니다.&amp;nbsp; 문제는 0.10 버전이 조금 빨라지기도 했고, VIEW 쪽 접근 URL도 다르다는&amp;nbsp; 점입니다. (view 의 url 이 달라지니까... 나중에 0.10 이 안정버전이 되면 어플리케이션 코드를 손대야 하는...) 데비안4 나 5 모두 couchdb 0.10 을 설치하려면 testing으로 올려야합니다. ubuntu 9.10 / fedora 11 에서는 문제없이 0.10을 설치해줬습니다. 컴파일하는 것도 한가지 방법인데... erlang, openssl 까지 의존 목록에 들어있더군요. 따라서....귀찮습니다. (저는 안정버전에 집착하는 편인데, 좀 문제네요.) 벌크 인서트 ---------- 처음에 며칠동안은 테스트 데이터 한 건식 루프를 돌면서 insert 해보았는데요. 최장 8시간까지 걸리더군요. 댓글의 경우는 그나마 데이터가 적어서인지 빨리되는데, 게시물같은 경우는 초당 10개가 안되기도 합니다. 상황에 따라 정확한 시간은 달라질 수 있습니다만, 동일 환경에서 mongodb에서는 13분 걸리더군요. 그냥 두 DB가 성격이 다른 거니까, 속도를 비교하는 것은 무리인 듯 합니다. 더 조사해보니, 벌크인서트(bulk insert)라는 것이 있어서 이걸 써봤습니다. [code groovy] def array = []; rawdata.each {r-&amp;gt; &amp;nbsp;&amp;nbsp; def doc = [name:r-&amp;gt;name, ....] &amp;nbsp;&amp;nbsp; array.add(doc); &amp;nbsp;&amp;nbsp; if((i%500) != 0) { &amp;nbsp; &amp;nbsp;&amp;nbsp; db.buldCreateDocuments(array); &amp;nbsp; &amp;nbsp;&amp;nbsp; array = []; &amp;nbsp;&amp;nbsp; } } [/code] 와 같은 방식으로 사용할 수 있습니다. 이 API를 이용하니까, 전체 데이터 로딩속도가 엄청나게 빨라졌습니다. (30분정도) ======== 여기 시간 적어 ============= 뷰 == 미리 정의해야 하나 ----------------------- 다음 문제는 뷰(View)였습니다. 카우치에서 가장 독특해보이는 녀석이 자바스크립트로 만들어진 뷰인데요. 여기에 map/reduce라는 개념까지 들어가면 공부하기 힘들어보입니다. 저는 테스트 데이터를 입력하면서 회원/게시물/댓글 에 대해서 doc_type 이라는 필드를 만들고, 각각 member/article/comment 라는 값을 주었습니다. [code groovy] articles_data.each { r-&amp;gt; &amp;nbsp; def doc = [doc_type :&amp;#039;article&amp;#039;, name:r-&amp;gt;name, ....] &amp;nbsp; db.createDocument(doc); } comments_data.each { r-&amp;gt; &amp;nbsp; def doc = [doc_type :&amp;#039;comment&amp;#039;, name:r-&amp;gt;name, ....] &amp;nbsp; db.createDocument(doc); } [/code] 그리고, 각 타입의 문서가 몇개나 있는지 세어보는 view를 만들었습니다. 앞의 함수가 map 이고, 뒤의 함수가 reduce 입니다. [code groovy] function(doc) { &amp;nbsp; emit(doc.doc_type, 1); } function(key, values) { &amp;nbsp; &amp;nbsp; return sum(values); } [/code] 아래는 결과입니다. [code groovy] &amp;quot;article&amp;quot; &amp;nbsp;&amp;nbsp; : 245328 &amp;quot;member&amp;quot;&amp;nbsp; : 68076 &amp;quot;comments&amp;quot;:1157777 [/code] 이 녀석이 카우치 디비에서 가장 감동적인 장면인 것 같아서 캡쳐해봤습니다. (테스트 도중이라 값이 다른 부분이 있습니다) 맵/리듀스를 이리저리 쓰다보면 기존의 SQL과는 또다른 재미있는 데이터 인출기법이란 점이, 꽤 ... 재미있습니다. 하지만, 문제는 저 함수가 호출될 때마다, 인덱스가 수정된다는 점이었습니다. 카우치는 데이터와 인덱스를 분리해서 관리합니다. 데이터를 저장할 때는 인덱스 처리를 하지 않습니다. 대신 VIEW 엔진이 동작할 때, 관련된 인덱스를 수정하게 됩니다. 이게 묘한 부작용을 일으키는데요. update나 insert 가 많이 이루어진 후에 view를 호출하면 인덱스하는데 시간이 너무 오래걸린다는 점입니다. 테스트를 포기할 정도로 오래걸린 경우도 많았습니다. 나중에 찾아낸 해결책은 벌크-인서트를 수행하면서, 중간 중간에 view 엔진을 호출해주는 겁니다. 그렇게 하면 어느정도 참고 기다릴만합니다. 하지만 좀.. 뻘짓하는 느낌이었습니다. 인덱스 수정이 완료된 이후에는 VIEW를 수행하는데 걸리는 시간이 굉장히 짧아집니다. 그리고, 테스트에서 처럼 몇만개씩이 아닌, 천개정도의 데이터를 추가하고, VIEW를 돌려봤는데요. 응답을 얻기까지 얼마 안걸리더군요. 1~4초 내외인데, 오래걸린다는 느낌은 없었습니다. 유니크 키 --------- 이건 좀 문젠데요. 카우치는 유니크키(unique key)를 지원하지 않습니다. (몽고는 지원) 편법은 있는 것 같지만, 어쨌든, 시스템이 자동생성하는 키( 필드명 : _id ) 를 제외하고는 유니크 키를 지원하지 않습니다. 즉, 회원 아이디라던가, 하는 것을 유니크 키로 지정해서, 동일한 아이디의 회원이 만들어지지 않도록 디비를 설정하는 것이 안됩니다. 요기 맨아래에 설명이 있는데... 노드가 하나일 때는 _id 필드에 원하는 필드를 넣으면 되긴하는데, multi-master 환경에서는 충돌할 수도 있다, 라고 적혀있습니다. 데이터 사이즈 ------------ MySQL : 1.9G MongoDB: 2.1G CouchDB non-bulk: 18G CouchDB bulk: 3.5G 데이터의 형태에 따라 차이가 날 것 같습니다만, 비율은 저정도 인것 같습니다. 특이한 점은 카우치는 MVCC때문인 것 같습니다만, 벌크일때와 아닐때 차이가 납니다. (compact db 라는 명령이 따로 있습니다.) 결론 ---- 몽고디비랑 카우치디비를 일대일로 비교하기는 힘듭니다. 초당 insert 가 너무 느리긴 합니다만, 카우치는 원래 컴퓨터를 추가하고 연결만 하면 자동으로 클라우드로 동작하는 것이 목표인 데이터베이스입니다. 느리면 서버를 추가하면 되죠. 몽고디비는 처음부터 속도를 중시하는 쪽이구요. (몽고도.. master-master 지원하지만 fail-over를 위한 것이라고 하네요. 그래도 그냥 잘 쓴다는 사람도 있긴합니다만..) 카우치디비는 일단 재미삼아 공부하기 적당하구요. 서비스 환경에 적용한 케이스도 꽤 있고, 그리 나쁜 선택은 아닌 것 같습니다. 하지만, 문제를 공부를 해야한다는 점입니다. 몽고디비는 지금 돌아보니 mysql 의 document-db 버전인 것 같다는 인상입니다. sql을 알던 사람이 적응하기 쉽고, 드라이버나 예제들도 따라하기 좋습니다. 공부하는데 드는 시간이 비교적 짧습니다. 아마도, 테스트 과제 따위에서는 카우치, 당장 서비스 할 것에는 몽고, 가 어떨까 합니다. 저는 한동안 두가지 모두 병행해서 사용해보려고 합니다. 카우치쪽이 다음버전에서 어떤 점이 좋아질지 궁금하기 때문입니다. (어쩌면 속도?) 이상입니다. &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/43&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">데비안 우분투</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/42"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/42" thr:count="1" thr:updated="2009-11-14T22:03:25+09:00"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/42</id>
  <updated>2009-11-13T17:45:19+09:00</updated>
  <published>2009-11-13T00:30:56+09:00</published>
  <summary type="html">우분투로 이것 저것 재미있게 놀았다. 리눅스 데스크탑도 쓸만한 것 같다. 서버에서도 우분투를 쓰는게 좋을까? 지난번에 서버에도 우분투 쓰기로 작정했었는데.. 다음주에 IDC에 서버가 새로 들어와서 가져갈 씨디를 고르다가, 갑자기 고민이 돼서, 이것저것 둘러보고, 테스트 설치도 다시 해보는 중이다. 가장 중요한 문서는 우분투쪽에서 데비안과 자기들과의 관계를 설명한 글. 관계가 나쁘다 좋다, 그런게 아니라, (당근 좋다.. 고 쓰여있다.) &amp;nbsp; &amp;nbsp;&amp;nbsp; * 자기들이 새 버전을 만들기 시작할 때 데비안의 &amp;quot;stable&amp;quot; 이 아닌, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;development&amp;quot;버전에서 시작한다는 이야기가 눈에 걸렸다. &amp;nbsp; &amp;nbsp; * 그 다음에는 6개월마다 새버전을 내놓는다는 이야기. (그럴필요는 없잖아?) &amp;nbsp; &amp;nbsp;&amp;nbsp; * 하지만 우분투에도 LTS 버전이 있다. 우분투 LTS 서버버전은 5년간 지원된다. 그러니까, &amp;quot;8.04는 2013년까지 지원&amp;quot;이라고 쓰여있다. 그럼 2013년이후에는? 이게 처음봤을 때부터 궁금했는데, 위키백과에 따르면, 메인 서버에서도 삭제될꺼라고 한다. 엉? 그럼 어쩌라고? 역시 데비안이군.. 이라고 중얼거리면서 데비안쪽을 뒤져봤다. 뒤져본 결과... 2002년에 나온 데비안우디..는 2006년에 보안패치까지도 중단된 상태다. (http://www.debian.org/releases/woody/) 데비안도 마찬가지네. 어차피 이쪽은 업그레이드 하면서 쓰는거니까... 우분투는 7.10 LTS에서 8.04 LTS로 업그레이드하다가 문제가 있었다는 보고가 있긴한데... 데비안에서도 full-upgrade에서는 가끔 깨진다는 보고도있고... 마찬가지인 것 같다. 처음에 우분투를 선택했던 이유는. 나같은 초보 관리자가 우분투를 선택하기 더 쉬울꺼고, 그럼 더 많은 아티클이 나올꺼고, 막힐때 찾아볼 자원이 늘어날꺼라는 생각이었다. 이건 아직도 유효한것 같은데.. 아.. 귀찮아. 그냥 구워놓은 우분투 8.04 LTS들고 갈까.. ==== 추가 참고 포스트 : http://hostingfu.com/article/keeping-your-php-fastcgi-processes-alive &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/42&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
 <entry>
  <title type="html">몽고디비</title>
  <link rel="alternate" type="text/html" href="http://groovy.pe.kr/41"/>
  <link rel="replies" type="application/atom+xml" href="http://groovy.pe.kr/atom/discuss/41" thr:count="0"/>
  <author>
   <name>박제권</name>
  </author>
  <id>http://groovy.pe.kr/41</id>
  <updated>2009-11-10T00:14:18+09:00</updated>
  <published>2009-11-09T23:57:47+09:00</published>
  <summary type="html">몽고디비란 것이 있다. MongoDB. 속도도 빠르고, 개념도 깔끔하다. CouchDB라던가 Hadoop 따위는 아직은 나한테는 공부용인 것 같았지만 이 녀석은 달라보인다. 실무에 곧바로 적용해보기로 하고, 간단하게 방금 공부한 것을 정리해둔다. 먼저 깔끔한 우분투 8.04 LTS를 서버버전으로 깔았다. [code shell]sudo mkdir -p /data/db &amp;nbsp; cd /opt/ wget http://downloads.mongodb.org/linux/mongodb-linux-i686-latest.tgz sudo tar -zxvf mongodb-linux-i686-latest.tgz sudo mv mongodb-linux-i686-2009-11-09/ mongodb &amp;nbsp;&amp;nbsp; sudo mongodb/bin/mongod [/code] 라고 하고, 터미널을 하나 더 열었다. vi m.groovy 해서 다음 내용을 넣었다. [code groovy]import com.mongodb.* def m = new Mongo() def db = m.getDB(&amp;quot;mydb&amp;quot;) def coll = db.getCollection(&amp;quot;myfam&amp;quot;) coll.drop() def doc = [name:&amp;quot;한글&amp;quot;, desc:&amp;quot;mytest&amp;quot;, age:21, loc: [x:203, y:102]] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; as BasicDBObject def doc2 = [name:&amp;quot;영어&amp;quot;, desc:&amp;quot;wife&amp;quot;, age:22,&amp;nbsp; loc: [x:253, y:102]] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; as BasicDBObject coll.insert(doc) coll.insert(doc2) println coll.getCount() def obj = coll.findOne([age:21] as BasicDBObject) println obj println &amp;quot;showing a custom query&amp;quot; def cur = coll.find([age:[&amp;#039;$lt&amp;#039;:23]] as BasicDBObject) while(cur.hasNext()) { &amp;nbsp;&amp;nbsp; println cur.next() } def obj2 = coll.findOne([name:&amp;quot;한글&amp;quot;] as BasicDBObject)&amp;nbsp; println obj2[/code] 그리고 [code shell]wget http://cloud.github.com/downloads/mongodb/mongo-java-driver/mongo-1.0.jar groovy -cp mongo-1.0.jar m.groovy[/code] 여기까지 실행해보면, 서버가 잘 동작하고, 자바/그루비랑도 잘 어울리는 것을 알 수있다. 조금만 더 공부해보자. (여기가 더 재미있다.) -------- [code shell]~$ /opt/mongodb/bin/mongo[/code] 를 실행해보자. [code]MongoDB shell version: 1.1.3- url: test connecting to: test type &amp;quot;help&amp;quot; for help &amp;gt; show dbs admin local mydb &amp;gt; show collections system.indexes testCollection &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // 방금 그루비로 만든 녀석이다. &amp;gt; db.xx.save({name:&amp;quot;hhh&amp;quot;,age:11})&amp;nbsp; // xx 는 정의한적이 없다. &amp;gt; db.xx.save({name:&amp;quot;yyy&amp;quot;,age:12}) &amp;nbsp; //스키마도 만든적이 없다. &amp;gt; db.xx.save({name:&amp;quot;xxx&amp;quot;,age:13})&amp;nbsp; //그냥 save해버린다. &amp;gt; show collections &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; system.indexes testCollection xx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // xx라는 컬렉션이 생겼다. // 검색도 해보자 &amp;gt; db.xx.find({age:12}) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; { &amp;quot;_id&amp;quot; : ObjectId(&amp;quot;4af82b2e3138af056bab5259&amp;quot;), &amp;quot;name&amp;quot; : &amp;quot;yyy&amp;quot;, &amp;quot;age&amp;quot; : 12 } // 11살넘는 아이들만.. &amp;gt; db.xx.find({age: {$gt : 11}}) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;quot;_id&amp;quot; : ObjectId(&amp;quot;4af82b2e3138af056bab5259&amp;quot;), &amp;quot;name&amp;quot; : &amp;quot;yyy&amp;quot;, &amp;quot;age&amp;quot; : 12 } { &amp;quot;_id&amp;quot; : ObjectId(&amp;quot;4af82cb03138af056bab525a&amp;quot;), &amp;quot;name&amp;quot; : &amp;quot;xxx&amp;quot;, &amp;quot;age&amp;quot; : 13 } exit [/code] 여기까지.. 이후에는 몽고디비 홈페이지에서 문서를 보면서 조금씩 더 공부하면 되겠다. P.S. 그루비 소스는 http://jameswilliams.be/blog/entry/165 에서 가져왔다. (한글 때문에 조금 손댔다) mongo 쉘 데모는 http://hompy.info/586 를 참고했다. (조금만 바꿔서 해봤다) &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://groovy.pe.kr/41&quot;&gt;글 전체보기&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</summary>
 </entry>
</feed>
