본문 바로가기

전체 글

(159)
postgresql get column_name with data_type select column_name,data_type from information_schema.columns where table_name = 'table_name'; stackoverflow.com/a/32369441/10194999
logstash postgres to elasticsearch tl;dr pgsync를 써볼걸 그랬나? https://github.com/toluaina/pg-sync 상황 - postgres에서 elasticsearch로 데이터 동기화 하려고함 - geometry, json, geo_shape 타입 처리 - 언제나 그렇듯 개발서버에서는 문제없는데 운영에서는 제약이 있고, 내가 설치한 것도 아니라 디렉토리 권한 같은 것도 하나하나 확인하며 실행시켜야하죠 해결방법 디렉토리는 내기준 && 수정한 부분 - cd /usr/share/logstash 에다가 data2 폴더 만들어서했음. (필수적인 부분 아님) - vi /etc/logstash/jvm.options ## JVM configuration -Xms12g -Xmx12g (heap size 늘리기위해서) - vi /..
logstash conf example input { jdbc { jdbc_connection_string => "jdbc:postgresql://localhost:5432/atlasdb?useTimezone=true&useLegacyDatetimeCode=false&serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf8" jdbc_user => "atlas" jdbc_password => "atlas" jdbc_validate_connection => true jdbc_driver_library => "/lib/postgres-42-test.jar" jdbc_driver_class => "org.postgresql.Driver" columns_charset => { "r..
logstash postgres to elasticsearch stackoverflow.com/a/61672243/10194999 Missing Converter handling for full class name=org.postgresql.util.PGobject, simple name=PGobject There is a column of geometry type in my postgres table. I checked that the rest of the columns worked fine postgres-> logstash-> elasticsearch. However, I am not sure how to cast the geometry type... stackoverflow.com 결국 해결. geometry는 geojson으로 받아 json으로 한번 더 c..
python 환경 관리 virtualenv : 내가 원하는 모듈만 운용하는 바구니 (https://dgkim5360.tistory.com/entry/python-virtualenv-on-linux-ubuntu-and-windows) virtualenv만 있나? ㄴㄴ 뭐가있지? 검색. https://www.pluralsight.com/tech-blog/managing-python-environments/ Managing Python Environments If you're not careful, your Python environment can quickly become a disaster. We'll walk through the available tools to be more (code) environmentally frie..
postgres ilike 문제 - 너무 느림 The key word ILIKE can be used instead of LIKE to make the match case-insensitive according to the active locale. This is not in the SQL standard but is a PostgreSQL extension. The operator ~~ is equivalent to LIKE, and ~~* corresponds to ILIKE. There are also !~~ and !~~* operators that represent NOT LIKE and NOT ILIKE, respectively. All of these operators are PostgreSQL-specific. 해결..
음.. 내 생각에는 elasticsearch 인덱스에 모든 documents가 있어야 할 것 같아서 그렇게 말했더니, 타입별로 따로 인덱스를 나누어 둬야할 것 같다고 해서. 그렇게 만들었음. 그러고 나서 결국 가변적으로 관리해야하기 때문에 모든 documents가 한 인덱스에 들어있는게 편하게 됨. 이런게 싫음. 내가 생각한게 맞을 수도있는데. 들어주지 않는거.. 첨에 내가 생각했던 대로 만들면 안고쳐도 되는데. 물론. 고치기 싫어하는 것도 좋은 건 아니라고 생각합니다. (그치만 미리 생각했던 부분이라 귀찮게 느껴지네요)
elasticsearch multiple condition curl -X POST "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d' { "query": { "bool" : { "must" : { "term" : { "user" : "kimchy" } }, "filter": { "term" : { "tag" : "tech" } }, "must_not" : { "range" : { "age" : { "gte" : 10, "lte" : 20 } } }, "should" : [ { "term" : { "tag" : "wow" } }, { "term" : { "tag" : "elasticsearch" } } ], "minimum_should_match" : 1, "boost" : 1.0 } }..