๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ปTech160

[๋ฆฌ๋ˆ…์Šค] ant ์„ค์น˜ ๋ฐ ์„ค์ • ant๋Š” Java ๊ธฐ๋ฐ˜์˜ ๋นŒ๋“œํˆด๋กœ ๋ฆฌ๋ˆ…์Šค์—์„œ make ์™€ ์œ ์‚ฌํ•œ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. 1. ์•„๋ž˜ ์ฃผ์†Œ์—์„œ ant ์ตœ์‹  ๋ฒ„์ „ ํ™•์ธ apache-ant-1.10.5-bin.tar.gz ํŒŒ์ผ ํ™•์ธ https://archive.apache.org/dist/ant/binaries/ 2. ๋‹ค์šด๋กœ๋“œ wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz 3. ์••์ถ• ํ•ด์ œ tar -zxvf apache-ant-1.10.5-bin.tar.gz 4. ํŒจ์Šค ์„ค์ • ๋ณธ์ธ์ด ์••์ถ•ํ•ด์ œํ•œ bin ๊ฒฝ๋กœ๋ฅผ ์„ค์ •ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค vi ~/.bash_profile -- ์•„๋ž˜ ๋‚ด์šฉ ์ถ”๊ฐ€ export ANT_HOME=/usr/bin/ant export PATH=$PA.. 2019. 8. 20.
[๋ฆฌ๋ˆ…์Šค] MySQL ์ ‘์† ๋ฐ ์ฟผ๋ฆฌ ์‹คํ–‰ ๋ช…๋ น์–ด mysql -h'$hostname' -u'$user' -p'$password' $TABLE_NM -e "์‹คํ–‰์ฟผ๋ฆฌ" h : ํ˜ธ์ŠคํŠธ๋ช… u : ๊ณ„์ • p : ํŒจ์Šค์›Œ๋“œ TABLE_NM : ํ…Œ์ด๋ธ”๋ช… e : ์‹คํ–‰ ์ฟผ๋ฆฌ ๋‚ด์šฉ ๐Ÿ”Ž ์ฐธ๊ณ  ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ์‰˜ ๋ณ€์ˆ˜์— ์ €์žฅํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด -N ์˜ต์…˜์„ ๋ถ™์—ฌ์„œ ์‚ฌ์šฉ 2019/09/04 - [Programming/Linux] - [๋ฆฌ๋ˆ…์Šค] mysql ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ ์‰˜ ๋ณ€์ˆ˜์— ์ €์žฅ 2019. 8. 5.
[Java] ์›ํ•˜๋Š” ํฌ๋งท์œผ๋กœ ํ˜„์žฌ ๋‚ ์งœ ์ถœ๋ ฅ ์›ํ•˜๋Š” ๋‚ ์งœ ํฌ๋งท(yyyyMMdd,yyyyMMddHH ๋“ฑ)์„ ์ž…๋ ฅํ•˜์—ฌ ํ˜„์žฌ๋‚ ์งœ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. public static String getCurrent(String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(Calendar.getInstance().getTimeInMillis()); } 2019. 7. 5.
[๋ฆฌ๋ˆ…์Šค] ์›ํ•˜๋Š” ํŒŒ์ผ ์ฐพ๊ธฐ(find ๋ช…๋ น์–ด) ํ˜„์žฌ ์œ„์น˜์—์„œ aa๋กœ ์‹œ์ž‘ํ•˜๋Š” ํŒŒ์ผ ๋ชจ๋‘ ์ฐพ๊ธฐ find . -name 'aa*' -print 2019. 7. 5.
[๋ฆฌ๋ˆ…์Šค] ์œˆ๋„์šฐ ํ…์ŠคํŠธ๋ฅผ ์œ ๋‹‰์Šค ํ…์ŠคํŠธ๋กœ ๋ณ€ํ™˜ ๋ฆฌ๋ˆ…์Šค์— ์ต์ˆ™ํ•˜์ง€ ์•Š์„ ๋•Œ ๋งŽ์ด ํ•˜๋Š” ์‹ค์ˆ˜๋กœ ์œˆ๋„์šฐ์—์„œ ํŽธ์ง‘๊ธฐ๋กœ ์ž‘์—…ํ•œ ํ…์ŠคํŠธ ํŒŒ์ผ์„ ๋ฆฌ๋ˆ…์Šค๋กœ ์—…๋กœ๋“œ ํ›„ ์‚ฌ์šฉํ•˜๋ฉด ์‚ฌ์šฉ์ด ์•ˆ๋ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์‰˜ ํŒŒ์ผ์„ ์œˆ๋„์šฐ์—์„œ ์ž‘์—… ํ›„ ๋ฆฌ๋ˆ…์Šค์—์„œ ์‹คํ–‰ํ•˜๋ ค๊ณ  ํ•˜๋ฉด ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š”๋ฐ ๋ฆฌ๋ˆ…์Šค ์‚ฌ์šฉ ์ดˆ๊ธฐ์— ํ•œ์ฐธ ๊ณ ์ƒ ํ–ˆ๋„ค์š”. ๐Ÿ˜ฅ vi๋กœ ํŒŒ์ผ ์—ด์–ด์„œ ์•„๋ž˜ ๋ช…๋ น์–ด ์‹คํ–‰ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ด ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํŒŒ์ผ์˜ ์ค„ ๋ฐ”๊ฟˆ ๋ฌธ์ž ํ˜•์‹์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ฃผ๋กœ Windows ์Šคํƒ€์ผ(CR+LF)์ด๋‚˜ Mac ์Šคํƒ€์ผ(CR)๋กœ ์ž‘์„ฑ๋œ ํŒŒ์ผ์„ Unix ์Šคํƒ€์ผ(LF)๋กœ ๋ณ€ํ™˜ํ•  ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. :se ff=unix 2019. 7. 5.
Oozie ๋ช…๋ น์–ด ์ •๋ฆฌ oozie๋ž€ Apache Hadoop ์ž‘์—…์„ ๊ด€๋ฆฌํ•˜๋Š” ์›Œํฌํ”Œ๋กœ์šฐ ์Šค์ผ€์ค„๋Ÿฌ ์‹œ์Šคํ…œ ๋ฐ์ดํ„ฐ ์ถ”์ถœ,๋ณ€ํ™˜,์ ์žฌ ์ž‘์—…์ธ ETL(Extraction Transformation Loading)์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. โ—พ coordinator ๋“ฑ๋ก coordinator job์„ ์‹คํ–‰ oozie job -config $job.properties -run โ—พ coordinator ์กฐํšŒ ๋“ฑ๋ก๋˜์–ด ์žˆ๋Š” coordinator job ๋ชฉ๋ก์„ ์กฐํšŒ oozie jobs -jobtype coord โ—พ coordinator update coordinator์˜ ๋‚ด์šฉ(coordinator.xml) ์ˆ˜์ • ํ›„ ์—…๋ฐ์ดํŠธ oozie job -config $job.properties -update $coordinator_job_id) ex) .. 2019. 7. 5.
[Java] ์ž๋ฃŒ๊ตฌ์กฐ,์•Œ๊ณ ๋ฆฌ์ฆ˜ ์šฉ์–ด/๊ฐœ๋… ์ •๋ฆฌ ์ž๋ฃŒ๊ตฌ์กฐ,์•Œ๊ณ ๋ฆฌ์ฆ˜ ์šฉ์–ด/๊ฐœ๋… ์ •๋ฆฌ ์ž๋ฃŒ๊ตฌ์กฐ ์ฝ”๋“œ์ƒ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ํšจ์œจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ๊ตฌ์กฐํ™” ํ•œ ๊ฒƒ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์–ด๋–ค ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ์ ˆ์ฐจ ๋˜๋Š” ๋ฐฉ๋ฒ• ๋ฐฐ์—ด(Array) ๋ฐ์ดํ„ฐ๋ฅผ ๋‚˜์—ดํ•˜๊ณ , ๊ฐ ๋ฐ์ดํ„ฐ๋ฅผ ์ธ๋ฑ์Šค์— ๋Œ€์‘ํ•˜๋„๋ก ๊ตฌ์„ฑํ•œ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ ํ(Queue) ๋จผ์ € ๋„ฃ์€ ๋ฐ์ดํ„ฐ๋ฅผ ๋จผ์ € ๊บผ๋‚ผ ์ˆ˜ ์žˆ๋Š” ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ (FIFO, LILO) ์Šคํƒ(Stack) ๋‚˜์ค‘์— ๋„ฃ์€ ๋ฐ์ดํ„ฐ๋ฅผ ๋จผ์ € ๊บผ๋‚ผ ์ˆ˜ ์žˆ๋Š” ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ (FILO, LIFO) ๋งํฌ๋“œ๋ฆฌ์ŠคํŠธ(LinkedList) ๋–จ์–ด์ ธ ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํฌ์ธํ„ฐ๋กœ ์—ฐ๊ฒฐํ•ด์„œ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ LinkedList LinkedList๋Š” ๋ฐ์ดํ„ฐ์™€ ๋‹ค์Œ ๋…ธ๋“œ์˜ ์ฃผ์†Œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”(ํฌ์ธํ„ฐ) ๊ตฌ์กฐ ArrayList์™€ ๊ฐ™์ด ๋ฐ์ดํ„ฐ์˜ ์ถ”๊ฐ€,์‚ญ์ œ์‹œ ๋ถˆํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ์˜ ๋ณต์‚ฌ๊ฐ€ ์—†์–ด ๋ฐ์ดํ„ฐ.. 2019. 6. 20.
[Apache Hadoop] ๋ฐ์ดํ„ฐ ๋…ธ๋“œ ์ถ”๊ฐ€/์ œ๊ฑฐ ๋ฐฉ๋ฒ• โ—พ DataNode ์ถ”๊ฐ€ 1. NameNode์˜ hosts ํŒŒ์ผ์— ์ถ”๊ฐ€ํ•  DataNode ์ •๋ณด (ip, host) ์ถ”๊ฐ€ vi /etc/hosts 2. NameNode์˜ includes ํŒŒ์ผ์„ ์ƒ์„ฑ ๋˜๋Š” ํŽธ์ง‘ํ•˜์—ฌ ์ถ”๊ฐ€ํ•  node์˜ hostname์„ ์ถ”๊ฐ€ vi /hadoop์„ค์น˜๊ฒฝ๋กœ/etc/hadoop/dfs.hosts 3. ์ถ”๊ฐ€ํ•œ ์„œ๋ฒ„ ์ ‘์† ํ›„ ๋…ธ๋“œ ์‹คํ–‰ hadoop-daemon.sh start datanode yarn-daemon.sh start nodemanager 4. Namonde ์„œ๋ฒ„์—์„œ node refresh ๋ช…๋ น ์ˆ˜ํ–‰ hdfs dfsadmin -refreshNodes โ—พ DataNode ์ œ๊ฑฐ 1. $HADOOP_HOME/etc/hadoop/hdfs.site.xml ํŒŒ์ผ์— ์•„๋ž˜ ๋‚ด์šฉ ์ถ”๊ฐ€ dfs... 2019. 6. 17.