sqoop 성능 튜닝

hadoop 2019. 1. 11. 18:33



sqoop에서 무거운 DB덤프 잡을 빨리 하려면 다음 옵션을  고려하길 바란다. 확실히 빨라진다. 10분 배치를 1분대로..



1)  mapper 메모리는 크게


           -Dmapreduce.map.memory.mb=(크게, 그러나 적절하게) -Dmapreduce.map.java.opts=-Xmx(크게, 그러나 적절하게)



2) mapper 개수는 많이 


        --num-mappers (크게, 그러나 적절하게)                                                




3) split-by와 $CONDITIONS



--split-by id : 쪼개는 컬럼 이름

$CONDITIONS : 내부 튜닝 값




https://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html


If you want to import the results of a query in parallel, then each map task will need to execute a copy of the query, with results partitioned by bounding conditions inferred by Sqoop. Your query must include the token $CONDITIONS which each Sqoop process will replace with a unique condition expression. You must also select a splitting column with --split-by.

For example:

$ sqoop import \
  --query 'SELECT a.*, b.* FROM a JOIN b on (a.id == b.id) WHERE $CONDITIONS' \
  --split-by a.id --target-dir /user/foo/joinresults

Alternately, the query can be executed once and imported serially, by specifying a single map task with -m 1:

$ sqoop import \
  --query 'SELECT a.*, b.* FROM a JOIN b on (a.id == b.id) WHERE $CONDITIONS' \
  -m 1 --target-dir /user/foo/joinresults





4) --boundary-query <sql 문>


전체를 덤프를 뜨려고 하면 속도가 통 나지 않는다. split-by id를 사용할 때 index가 있는 id를 기반으로 경계문을 전송하면 빠르게 쿼리 결과를 받을 수 있다.


Posted by '김용환'
,



spark 애플리케이션-haoop(yarn)  연동 잡을 실행하던 중에 


애플리케이션을 종료하려면.. 스파크 스케줄러(또는 hadoop 스케줄러)에서 


인스턴스 id인 application_11123123131321을 얻은 후,


yarn 커맨드의 kill 커맨드에 인스턴스 id를 추가한다.  



yarn application -kill application_11123123131321 





Posted by '김용환'
,



특정 장비에서 mysql DB로 


telnet은 접속이 안되었지만, 아래와 같은 mysql client 에러가 발생해 mysql에서 따로 deny하고 있는 줄 알았는데..



ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 104



알고보니 방화벽 ACL이었다..


Posted by '김용환'
,

yarn-spark 구조를 설명하려 할 때 도움되는 ㄷ그림.



출처 : https://hywelzhang.github.io/2018/12/06/Spark-Spark-Running-Architecture.html




Posted by '김용환'
,



맥 OS 탐색기에서 숨은 파일을 찾으려면 

shift + command + 점(마침표)를 선택하면 숨은 파일이 나타난다.

'Tool' 카테고리의 다른 글

td-agent 모니터링  (0) 2019.10.28
java.lang.NoSuchMethodError: No such DSL method 'withMaven' found among steps 에러  (0) 2019.03.11
tmux 사용 방법  (0) 2018.12.19
[git] no kex alg 이슈  (0) 2018.06.20
[intellij] 2018.1 lombok 설정  (0) 2018.06.19
Posted by '김용환'
,



ubuntu 16 에서 apt-get install을 이용해 설치하다가 다음과 같은 에러가 발생하면 ..



E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)

E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?  




다음과 같이 설치한다.



sudo rm /var/lib/apt/lists/lock

sudo rm /var/cache/apt/archives/lock

sudo rm /var/lib/dpkg/lock



 sudo dpkg --configure -a




Posted by '김용환'
,



ubuntu 16에 no_proxy가 안먹는 이슈가 있을 수 있다. 


https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1575877



$ vi /etc/profile


setproxy() {

...

}





따라서 필요하다면 apt-get update와 install을 아래와 같이 설치해야 할 수도 있다.



- name: Update cache

  shell: "source /etc/profile && setproxy sudo -E apt-get update"

  args:

    chdir: /kakao/source

    executable: /bin/bash


- name: Install Nginx

  shell: "source /etc/profile && setproxy sudo -E apt-get install nginx"

  args:

    chdir: /kakao/source

    executable: /bin/bash






'Ansible-Puppet-Chef' 카테고리의 다른 글

[ansible] copy mode 주의사항  (0) 2019.01.14
ansible-galaxy  (0) 2019.01.14
ansible 설치 (virtualenv)  (0) 2018.12.18
[ansible] lineinfile  (0) 2018.07.05
[ansible] 배포될 서버의 호스트명 얻는 방법  (0) 2018.04.02
Posted by '김용환'
,