jenkins pipeline에서 체크아웃할 때


무조건 새로운 코드로 받고 싶다면 Additional Behaviours의 Clean befoe checkout을 추가한다. 

Posted by '김용환'
,

sentry의 경우 에러 로그를 한 번에 받다보니 조금 이슈가 생길 수 있다. 


request body 가 1메가를 초과하는 경우 nginx 오류 발생하는 경우가 있다.


    * nginx : 기본설정(1M) 로 일반적인 경우에는 문제가 없으나 예외적으로 필요한 경우가 있어서 설정을 변경할 수 있다.

    => client_max_body_size 5M;



     * PG의 DB 변경
    => send_buffer를 128K에서 5M로 변경, max_connection을 100에서 500으로 변경한다.


'Web service' 카테고리의 다른 글

공용 IP 얻기  (0) 2019.09.14
firefox 쿠키 파싱하기 - lz4json  (0) 2018.10.23
크롬 브라우저의 쿠기 확인하기 - sqlite  (0) 2018.10.20
[jquery] file upload 예제  (0) 2017.05.30
구글 place api : request_denied  (0) 2016.06.28
Posted by '김용환'
,

# confluent kafka connector가 지원하는 connector 플러그인 (5.1.2 기준)

Kafka Connect ActiveMQ Connector

Kafka FileStream Connectors

Kafka Connect HDFS

Kafka Connect JDBC Connector

Confluent Kafka Replicator

Kafka Connect S3

Kafka Connect Elasticsearch Connector

Kafka Connect IBM MQ Connector

Kafka Connect JMS Connector (edited) 

# debezium이 지원하는 db


sqlserver,

postgres

mysql

mongodb (edited) 

Posted by '김용환'
,

debezium 일반적인 설정은 다음과 같다.


{

 “name”: “kc_debezium_connector_shopping_orders”,

 “config”: {

   “connector.class”: “io.debezium.connector.mysql.MySqlConnector”,

   “tasks.max”: “1”,

   “database.hostname”: “mysql”,

   “database.port”: “3306”,

   “database.user”: “debezium”,

   “database.password”: “비밀번호”,

   “database.server.id”: “18405”,

   “database.server.name”: “shopping.alpha-google.com”,

   “database.whitelist”: “shopping”,

   “table.whitelist”: “shopping.demo_orders”,

   “database.history.kafka.bootstrap.servers”: “kafka:29092”,

   “database.history.kafka.topic”: “schema_changes_shopping_orders”

 }

}





<기본설정>


처음에 debezium 사용할 때


kafka connector 에 debezium을 사용할 때

serverName(database.server.name).databaseName.tableName이 합쳐진 카프카 토픽에 DML 정보가 저장된다. (insert, update, delete)


shopping.shopping.demo_orders



참고

https://debezium.io/docs/connectors/mysql/#topic-names




스키마와 관련된 정보는 아래 토픽에 저장된다. (trucate, create table, alter table ..)


 “database.history.kafka.topic”: “schema_changes_shopping_orders”






또한 DML 정보가 저장되는 topic이름은 바꿀 수 있다 .


아래는 table 이름으로 topic 이름을 줄 수 있다.


   “transforms”: “route”,

   “transforms.route.type”: “org.apache.kafka.connect.transforms.RegexRouter”,

   “transforms.route.regex”: “([^.]+)\\.([^.]+)\\.([^.]+)“,

   “transforms.route.replacement”: “$3"



Posted by '김용환'
,



ebay에서 ci/cd로 mesos/jenkins 를 사용했었는데 최근에 drone으로 옮겨 탔다고 한다.



2014년

https://www.ebayinc.com/stories/blogs/tech/delivering-ebays-ci-solution-with-apache-mesos-part-i/

https://www.ebayinc.com/stories/blogs/tech/delivering-ebays-ci-solution-with-apache-mesos-part-ii/



2016년

https://www.ebayinc.com/stories/blogs/tech/scalable-and-nimble-continuous-integration-for-hadoop-projects/


2018년 6월 ebay에서 kubernetes/drone으로 이전했다는 발표.

https://blog.drone.io/interview-with-punit-agrawal-devops-at-ebay/


droneUI

https://hackernoon.com/build-your-own-ci-cd-pipeline-with-drone-e43d7190989b


참고

ebay 아키텍처

https://rnd.ebay.co.il/cwsd.php?Z3AuPTQ0Pg/NTQ/R0w-TEAocWx6bChfZmB-bmB2f3VmbXN2PGRhdA.pdf



Posted by '김용환'
,

ebay ci/cd 아키텍처

scribbling 2019. 3. 21. 11:15


ebay 아키텍처

https://rnd.ebay.co.il/cwsd.php?Z3AuPTQ0Pg/NTQ/R0w-TEAocWx6bChfZmB-bmB2f3VmbXN2PGRhdA.pdf



ebay cI 아키텍처에 대한 좋은 설명이 있다.




# 로컬 개발 환경

Requirements

• Developer should be able to run the services on his development machine

• There should be isolation between development environments – no shared resources

• Developers shall use the same dependencies (DB version, etc.)

• How

• Running dependencies locally using Docker (databases, services, etc.)

• Use docker-compose files with preconfigured settings (e.g. DB credentials, etc.)

• Custom CLI tool to ease developers’ daily work (automate common tasks)

• Development environment related files are managed in a dedicated git repository


# CI pipeline

How

• Detailed notifications over email and Slack (where / who / what / …)

• Verbose output during the build

• Pull request validation + GitHub integration (trigger validation job, update the pull request, etc.)

• Use Jenkins Multibranch Pipeline jobs

- Pipeline as code (job configuration should be part of the codebase)

- Auto detects branches (new and deleted)

- Triggered on push (using GitHub webhook)

- Use Jenkins Shared Pipeline Libraries for code reuse (https://github.com/ebay/Jenkins-Pipeline-Utils »)

- Spin-up dependencies using Docker (Jenkins is running on Kubernetes…)


# key


Automate as much as possible

• Keep isolation (developers, environments, build runs, etc.)

• Define test boundaries

• Local Development Environment

• Should be easy and quick to setup, maintain and run

• Should be aligned across all developers

• CI

• Should provide quick feedback on all branches

• Should help protecting important branches

• CD

• Should give high confidence

• Should be auditable

Posted by '김용환'
,

도커만 봤을 때는.. 메모리 설정 안 해도 된다. 일반적인 도커 메모리 설정은 unlimited이다.


$ cat /sys/fs/cgroup/memory/system.slice/docker.service/memory.stat

hierarchical_memory_limit 9223372036854771712

hierarchical_memsw_limit 9223372036854771712


그런데, 왜 도커 메모리로 인해 도커가 죽는 일이 발생하기도 한다. 


바로 그것은 도커 메모리가 이슈가 아니라 도커 컨테이너의 애플리케이션이 이슈인 경우가 있다.



예를 들면,



다만, 일래스틱서치는 mmapfs를 사용하기에 vm 메모리 설정을 해야 한다. mmap은 매핑된 파일의 크기와 동일한 프로세스에서 사용 가능한 가상 메모리 주소 공간의 일부를 사용하는 형태이다(루씬의 MMapDirectory를 사용) 


그래서 운영체제 캐시 없이 바로 루신 인덱스에서 파일을 읽으면 빠르기 때문인데요. 이게 도커에 미치는 영향이다.



참고 자료


https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html


http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html


http://jprante.github.io/lessons/2012/07/26/Mmap-with-Lucene.html

Posted by '김용환'
,

kubernetes에 sidecar proxy라는 개념이 있다.

pod에는 일반적으로 하나의 container(image)를 띄우는데

함께 부가적으로 도커 이미지를 띄우는 경우를 말한다.



일반적으로 사용하는 tomcat app 앞에 apache나 nginx를 두고 싶을 때,

kibana 앞에 ldap 인증 부분(go, python)을 두는 앱서버를 두고 싶을때 사용되는 개념이다.


https://medium.com/@lukas.eichler/securing-pods-with-sidecar-proxies-d84f8d34be3e

Posted by '김용환'
,