Waiting for table metadata lock 재현하기 


이 때 의도적으로 지연해야 하기 sleep 함수를 사용한다.

https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_sleep


* A session - 일반 계정


start transaction;

select * from target_ids_job_execution where sleep(1000)=0;


* B session - root


MariaDB [test]> ALTER TABLE target_ids_job_execution  add column xxx char(32) default 'xyz';

행(hang)


* C Session - root

show processlist; 



sleep을 포함한 sql 쿼리가 끝나도 여전히 alter table은 hang 걸려 있다. lock에 잡혀 있다. 



따라서 KILL 6을 실행해 metadata lock에 걸려 있는 쿼리를 종료시킨다.


show processlist를 실행하면 다음과 같은 결과가 나타난다.






Posted by '김용환'
,

jenkins 장비의 플러그인 목록을 형상관리 안하는 경우가 많다.. 플러그인 설정이 있어도 플러그인이 없으면 복구 할 수 없다. 


jenkins 장비의 플러그인 목록을 보려면 http://장비명:8080/script에 다음 커맨드를 실행한다.


Jenkins.instance.pluginManager.plugins.each{

  plugin -> 

    println ("${plugin.getShortName()}: ${plugin.getVersion()}")

}


결과는 다음과 같다.


Git plugin (git): 3.9.1
JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
SCM Sync Configuration Plugin (scm-sync-configuration): 0.0.10
Pipeline: Job (workflow-job): 2.24

..


jenkins master를 제대로 복구할 때, 

플러그인 이름과 버전, jenkins 버전.. 이 매우 중요하다.

Posted by '김용환'
,



centOS 리눅스에서 pip를 설치할 때 단순하게 다음과 같이 실행하면 된다고 하나..



$  yum update


$ yum install epel-release


$ sudo yum install python-pip 




내 환경에서는 계속 에러가 난다.


Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again




그래서 epel과 관련된 인증 이슈인데.. 다음과 같이 실행하면 잘 동작한다.


$ yum clean all


$ yum --disablerepo=“epel” update nss


$ yum remove epel-release --disablerepo=epel


$ yum -y upgrade ca-certificates


$ yum -y upgrade ca-certificates --disablerepo=epel


이제 가상환경과 패키지 설치를 동시에 지원하는 pipenv를 설치한다.


$ sudo -H pip install pipenv --proxy="proxy.google.io:3128"





pip 중요 참고 내용..

sudo pip install pipenv 을 실행할 때 다음과 같은 에러가 발생할 수 있다.


Starting new HTTPS connection (1): pypi.python.org

Incremented Retry for (url='/simple/pip/'): Retry(total=4, connect=None, read=None, redirect=None)

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe8adb61310>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/pip/


이럴 때는 환경변수와 proxy 환경 변수에 영향을 받을 수 있으니..아래와 같이 사용하길 바란다.


$ sudo -H pip install pipenv --proxy="proxy.google.io:3128"

Posted by '김용환'
,

[hadoop] Exit Code 154

hadoop 2019. 6. 4. 17:20

 

아래와 같은 클라이언트에서 hadoop에러가 발생했다.

org.apache.http.conn.HttpHostConnectException: Connection to http://google-hadoop-dn4.dakao.io:40060 refused

 

hadoop ui에 다음과 같이 154 에러가 발생했다. 

Application application_1544089295328_663490 failed 1 times due to AM Container for appattempt_1544089295328_663490_000001 exited with exitCode: 154

 

이 이유는 Job 실행 중간에 노드가 내려가면서 발생한 것이었다.

 

 

컨테이너 (프로세스 트리)가 아직 실행 중일 때 RecoveredContainerLaunch(https://hadoop.apache.org/docs/r2.9.2/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/apidocs/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/RecoveredContainerLaunch.html)이 주기적으로 폴링하여 프로세스가 종료되었는지 확인하고 생성된 종료 코드 파일에서 종료 코드를 얻는다.

 

 

컨테이너에서 종료 코드가 없어서 다시 가져 오기를 하려고 하고. 

다시 실패하면 컨테이너는 LOST (Exit 154)로 알린다.

 

 

 

154번에 대한 에러 코드는 다음과 같다. 

 

https://github.com/apache/hadoop/blob/master/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java#L288

  public enum ExitCode {
    FORCE_KILLED(137),
    TERMINATED(143),
    LOST(154);
    private final int code;

    private ExitCode(int exitCode) {
      this.code = exitCode;
    }

    public int getExitCode() {
      return code;
    }

    @Override
    public String toString() {
      return String.valueOf(code);
    }
  }

 

RecoveryContainerLaunch 소스

 

https://zgrepcode.com/hadoop/apache/3.2.0-rc1/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/recoveredcontainerlaunch.java

Posted by '김용환'
,


https://spark.apache.org/releases/spark-release-2-4-3.html
2.4.3이 얼마전에 출시되었는데. 달랑 지라 처리 하나인줄 알았더니. 이제 스칼라 2.12 버전으로 사용할 수 있는 버전이다.

문서 보면 2.11, 2.12 사용 가능하다고 한다. (하도 많이 바뀌어서 아예 지원 안할 줄 알았는데.)

그외 추가된 내용은 kafka key/value 에 null 처리를 반영했다.
https://issues.apache.org/jira/browse/SPARK-27494
https://github.com/apache/spark/pull/24441/files

Posted by '김용환'
,

일래스틱서치에 6.7, 7.x에 CCR 이라는 기능이 생겼다.

클러스터 복제 기능이다. 

https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-apis.html

 

Cross-cluster replication APIs | Elasticsearch Reference [7.1] | Elastic

 

www.elastic.co

https://www.elastic.co/kr/blog/benchmarking-elasticsearch-cross-cluster-replication

 

Benchmarking Elasticsearch cross-cluster replication

Wondering about the performance of Elasticsearch cross-cluster replication? Here's how we've been benchmarking and stress testing it using Rally.

www.elastic.co

 

클러스간 복제를 진행하려면 그동안 snapshot, restore를 진행했었고 너무 느리고 잘 안되는 부분들이 많았었는데.. 

이제 6.7, 7.0 부터는 쓸만해 질 것 같다.

 

Posted by '김용환'
,

death by amazon 지수와 amazon survivors 라는 지수가 있을 정도로 영향도 높다.

 

https://www.bespokepremium.com/chart-of-the-day/chart-of-the-day-introducing-the-amazon-survivors-index/

 

Chart of the Day: Introducing The "Amazon Survivors" Index | Bespoke Investment Group

Back in February of 2014, we introduced the Bespoke “Death By Amazon” Index (DBA), a portfolio of companies culled from retailer indices that we judged as being extremely exposed to Amazon’s assault on the traditional retailing business model.  The “Death

www.bespokepremium.com

https://www.bespokepremium.com/?s=Death+by+amazon

 

Death by amazon | Bespoke Investment Group

Apr 23, 2019 Our “Death By Amazon” index was created many years ago to provide investors with a list of retailers we view as vulnerable to competition from e-commerce.  In 2016, we also created our “Amazon Survivors” index which is made up of companies tha

www.bespokepremium.com

 

 

회사 목록은 다음과 같다.

 

출처: 

https://books.google.co.kr/books?id=IBOSDwAAQBAJ&pg=PT9&lpg=PT9&dq=%EB%8D%B0%EC%8A%A4+%EB%B0%94%EC%9D%B4+%EC%95%84%EB%A7%88%EC%A1%B4+%EC%BD%94%EC%8A%A4%ED%8A%B8%EC%BD%94+%ED%8E%98%EB%8B%88&source=bl&ots=_FOLkeEvTz&sig=ACfU3U2ql8DWpsWyti266ftkw9cLJd6N8A&hl=ko&sa=X&ved=2ahUKEwipy6mr4s7iAhWHF4gKHTbVBrEQ6AEwB3oECAkQAQ#v=onepage&q=%EB%8D%B0%EC%8A%A4%20%EB%B0%94%EC%9D%B4%20%EC%95%84%EB%A7%88%EC%A1%B4%20%EC%BD%94%EC%8A%A4%ED%8A%B8%EC%BD%94%20%ED%8E%98%EB%8B%88&f=false

 

 

 

출처

https://www.cnbc.com/2017/08/23/these-10-stocks-can-survive-amazons-retail-apocalypse.html

 

Posted by '김용환'
,

ruby 설치 이후 gem 모듈을 설치하는 레시피 예시이다.

- name : Install Ruby Gem (name={{gem_name}}, version={{gem_version}})
  gem : name={{gem_name}}
        version={{gem_version}}
        state=present



 

Posted by '김용환'
,

ansible에서 활용할 수 있는 git clone 레시피이다.

git clone 하려면 기본적으로 권한이 필요한다. public일 때는 이슈는 없지만 private일 때는 rsa 키가 필요하다. 

github 키를 얻는다 (github.com에서 github 키를 얻는 방법은 https://github.com/KennethanCeyer/tutorial-git 참고) 

private 키를 roles/files에 추가한다

- name: github 키를 복사
  sudo: yes
  copy: src=github_key dest={{ item }} mode=0600 group=www owner=www
  with_items:
  - /home/www/.ssh/github_key

 

- name: ansible-webserver 소스 복사
  git:
    repo: git@github.com:knight76/ansible-example.git
    dest: "{{program_path}}/nsible-example"
    force: yes
    clone: yes
    accept_hostkey: yes
    key_file: /home/www/.ssh/github_key
Posted by '김용환'
,

 

netty 3를 netty4로 전환하다가.. 많이 부딪혔는데.. 

https://netty.io/wiki/new-and-noteworthy-in-4.0.html 문서를 참고해야 한다. 

 

Netty.docs: New and noteworthy in 4.0

This document walks you through the list of notable changes and new features in the major Netty release to give you an idea to port your application to the new version. Project structure changes The package name of Netty has been changed from org.jboss.net

netty.io

 

예를 들면

- netty 3의 ChannelBuffer는 netty 4에서 ByteBuf로 변경되었다.

- ChannelBuffers.copiedBuffer는 Unpooled.copiedBuffer로 변경되었다.

(import io.netty.buffer.Unpooled)

- ChannelBuffer는 ByteBuf로 변경되었다.

 

 

 

 

Posted by '김용환'
,