https://jekyllrb-ko.github.io/ 를 참고..



먼저 jekull을 설치한다.



git clone ...

cd ...

gem install jekyll

jekyll serve --host 0.0.0.0


index.md 페이지는 http://localhost:4000/index으로 접근할 수 있다.

op.md 페이지는 http://localhost:4000/op로 접근할 수 있다. 






Posted by '김용환'
,

fluentd 공부

Cloud 2017. 8. 16. 16:22


기존에 ruby 2.1.0이 설치되어 있고, fluentd 0.14를 사용해서 fluentd를 테스트해본다.



설치 방법은 다음과 같다. 


$ gem install fluentd -v "~> 0.12.0" --no-ri --no-rdoc

Fetching: string-scrub-0.0.5.gem (100%)

Building native extensions.  This could take a while...

Successfully installed string-scrub-0.0.5

Fetching: fluentd-0.12.39.gem (100%)

Successfully installed fluentd-0.14.20

2 gems installed



버전을 확인한다. 


$ fluentd --version

fluentd 0.14.20




설정 파일을 생성하고 fluentd를 실행한다. 설정 파일과 플러그인 파일을 읽는 로그를 확인할 수 있다.


$ fluentd --setup ./fluent

Installed ./fluent/fluent.conf.



$ fluentd -c ./fluent/fluent.conf -vv

2017-08-16 16:18:25 +0900 [info]: fluent/log.rb:316:call: parsing config file is succeeded path="./fluent/fluent.conf"

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered output plugin 'stdout'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered buffer plugin 'memory'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered formatter plugin 'stdout'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered formatter plugin 'json'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered output plugin 'forward'

2017-08-16 16:18:25 +0900 [info]: fluent/log.rb:316:call: adding forwarding server '192.168.0.12:24224' host="192.168.0.12" port=24224 weight=60 plugin_id="object:3ff3daa51474"

2017-08-16 16:18:25 +0900 [info]: [forward_output] adding forwarding server '192.168.0.11:24224' host="192.168.0.11" port=24224 weight=60 plugin_id="forward_output"

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered input plugin 'forward'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered parser plugin 'in_http'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered input plugin 'http'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered parser plugin 'msgpack'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered parser plugin 'json'

2017-08-16 16:18:25 +0900 [info]: [http_input] Oj is not installed, and failing back to Yajl for json parser

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered input plugin 'monitor_agent'

2017-08-16 16:18:25 +0900 [trace]: fluent/log.rb:275:call: registered input plugin 'debug_agent'

2017-08-16 16:18:25 +0900 [info]: fluent/log.rb:316:call: using configuration file: <ROOT>

  <source>

    @type forward

    @id forward_input

  </source>

  <source>

    @type http

    @id http_input

    port 8888

  </source>

  <source>

    @type monitor_agent

    @id monitor_agent_input

    port 24220

  </source>

  <source>

    @type debug_agent

    @id debug_agent_input

    bind "127.0.0.1"

    port 24230

  </source>

  <match debug.**>

    @type stdout

    @id stdout_output

  </match>

  <match system.**>

    @type forward

    @id forward_output

    <server>

      host "192.168.0.11"

    </server>

    <secondary>

      <server>

        host "192.168.0.12"

      </server>

    </secondary>

  </match>

</ROOT>

2017-08-16 16:18:25 +0900 [info]: fluent/log.rb:316:call: starting fluentd-0.14.20 pid=11375

2017-08-16 16:18:25 +0900 [info]: fluent/log.rb:316:call: spawn command to main:  cmdline=["/Users/samuel.kim/.story-spec/opt/ruby/bin/ruby", "-Eascii-8bit:ascii-8bit", "/Users/samuel.kim/.story-spec/opt/ruby/bin/fluentd", "-c", "./fluent/fluent.conf", "-vv", "--under-supervisor"]

2017-08-16 16:18:26 +0900 [info]: fluent/log.rb:316:call: gem 'fluentd' version '0.14.20'

2017-08-16 16:18:26 +0900 [info]: fluent/log.rb:316:call: gem 'fluentd' version '0.12.39'

2017-08-16 16:18:26 +0900 [info]: fluent/log.rb:316:call: adding match pattern="debug.**" type="stdout"

2017-08-16 16:18:26 +0900 [trace]: #0 fluent/log.rb:275:call: registered output plugin 'stdout'

2017-08-16 16:18:26 +0900 [trace]: #0 fluent/log.rb:275:call: registered buffer plugin 'memory'

2017-08-16 16:18:26 +0900 [trace]: #0 fluent/log.rb:275:call: registered formatter plugin 'stdout'

2017-08-16 16:18:26 +0900 [trace]: #0 fluent/log.rb:275:call: registered formatter plugin 'json'

2017-08-16 16:18:26 +0900 [info]: fluent/log.rb:316:call: adding match pattern="system.**" type="forward"

2017-08-16 16:18:26 +0900 [trace]: #0 fluent/log.rb:275:call: registered output plugin 'forward'

2017-08-16 16:18:26 +0900 [info]: #0 fluent/log.rb:316:call: adding forwarding server '192.168.0.12:24224' host="192.168.0.12" port=24224 weight=60 plugin_id="object:3fe29618a3b8"

2017-08-16 16:18:26 +0900 [info]: #0 [forward_output] adding forwarding server '192.168.0.11:24224' host="192.168.0.11" port=24224 weight=60 plugin_id="forward_output"

2017-08-16 16:18:26 +0900 [info]: fluent/log.rb:316:call: adding source type="forward"

2017-08-16 16:18:26 +0900 [trace]: #0 fluent/log.rb:275:call: registered input plugin 'forward'

2017-08-16 16:18:26 +0900 [info]: fluent/log.rb:316:call: adding source type="http"

2017-08-16 16:18:26 +0900 [trace]: #0 fluent/log.rb:275:call: registered parser plugin 'in_http'




로그는 fluent/fluent.conf에 있다. 로그의 내용과 동일하다. 


$ cat fluent/fluent.conf

# In v1 configuration, type and id are @ prefix parameters.

# @type and @id are recommended. type and id are still available for backward compatibility


## built-in TCP input

## $ echo <json> | fluent-cat <tag>

<source>

  @type forward

  @id forward_input

</source>


## built-in UNIX socket input

#<source>

#  @type unix

#</source>


# HTTP input

# http://localhost:8888/<tag>?json=<json>

<source>

  @type http

  @id http_input


  port 8888

</source>


## File input

## read apache logs with tag=apache.access

#<source>

#  @type tail

#  format apache

#  path /var/log/httpd-access.log

#  tag apache.access

#</source>


# Listen HTTP for monitoring

# http://localhost:24220/api/plugins

# http://localhost:24220/api/plugins?type=TYPE

# http://localhost:24220/api/plugins?tag=MYTAG

<source>

  @type monitor_agent

  @id monitor_agent_input


  port 24220

</source>


# Listen DRb for debug

<source>

  @type debug_agent

  @id debug_agent_input


  bind 127.0.0.1

  port 24230

</source>


## match tag=apache.access and write to file

#<match apache.access>

#  @type file

#  path /var/log/fluent/access

#</match>


## match tag=debug.** and dump to console

<match debug.**>

  @type stdout

  @id stdout_output

</match>


# match tag=system.** and forward to another fluent server

<match system.**>

  @type forward

  @id forward_output


  <server>

    host 192.168.0.11

  </server>

  <secondary>

    <server>

      host 192.168.0.12

    </server>

  </secondary>

</match>


## match tag=myapp.** and forward and write to file

#<match myapp.**>

#  @type copy

#  <store>

#    @type forward

#    buffer_type file

#    buffer_path /var/log/fluent/myapp-forward

#    retry_limit 50

#    flush_interval 10s

#    <server>

#      host 192.168.0.13

#    </server>

#  </store>

#  <store>

#    @type file

#    path /var/log/fluent/myapp

#  </store>

#</match>


## match fluent's internal events

#<match fluent.**>

#  @type null

#</match>


## match not matched logs and write to file

#<match **>

#  @type file

#  path /var/log/fluent/else

#  compress gz

#</match>




fluent-cat를 이용해 동작 여부를 확인한다.



$ echo '{"json":"message"}' | fluent-cat debug.test



$ fluentd -c ./fluent/fluent.conf -vv

...

2017-08-16 19:52:03.309664000 +0900 debug.test: {"json":"message"}





fluent/fluent.conf 파일을 참조해서 실제로 동작하는지 테스트해본다.


 debug와 system 태그로 시작될 때에만 콘솔에 출력된다.


# HTTP input

# http://localhost:8888/<tag>?json=<json>

<source>

  @type http

  @id http_input


  port 8888

</source>
..

## match tag=debug.** and dump to console

<match debug.**>

  @type stdout

  @id stdout_output

</match>


# match tag=system.** and forward to another fluent server

<match system.**>

  @type forward

  @id forward_output


  <server>

    host 192.168.0.11

  </server>

  <secondary>

    <server>

      host 192.168.0.12

    </server>

  </secondary>

</match>




http로 사용한다.



$ curl -v http://localhost:8888/debug.test -F 'json={"hello":"world"}'

*   Trying 127.0.0.1...

* Connected to localhost (127.0.0.1) port 8888 (#0)

> POST /debug.http HTTP/1.1

> Host: localhost:8888

> User-Agent: curl/7.43.0

> Accept: */*

> Content-Length: 156

> Expect: 100-continue

> Content-Type: multipart/form-data; boundary=------------------------5bc2e845e167b296

>

< HTTP/1.1 100 Continue

< HTTP/1.1 200 OK

< Content-Type: text/plain

< Connection: Keep-Alive

< Content-Length: 0

<

* Connection #0 to host localhost left intact





fluent 로그에 전달한 json이 출력된다.


2017-08-16 19:55:47.099363000 +0900 debug.test: {"hello":"world"}




그러나 매개 변수가 json 규격에 잘 맞지 않으면 로그가 발생하지 않는다. 내부적으로 파싱하고 있는 듯 하다. 쌍따옴표를 없애면 파싱 구문만 제외하고 나온다




curl  -d 'json=afdafd'  http://localhost:8888/debug.test

(결과 안나옴)


curl  -d 'json={"hello":"world}'  http://localhost:8888/debug.test

(결과 : 2017-08-16 19:59:21.074761000 +0900 debug.test: "hello")

...





curl  -d 'json={"hello":"world}'  http://localhost:8888/debug1.test

(결과 : 

2017-08-16 20:00:39 +0900 [warn]: #0 fluent/log.rb:336:call: no patterns matched tag="debug1.test" )




fluent-logger를 설치하면 pry를 통해 fluentd에 전달할 수 있다. 


$ gem i fluent-logger --no-ri --no-rdoc

Fetching: fluent-logger-0.7.1.gem (100%)

Successfully installed fluent-logger-0.7.1

1 gem installed

$ pry

[1] pry(main)> require 'fluent-logger'

=> true

[2] pry(main)> Fluent::Logger::FluentLogger.open(nil, :host => 'localhost', :port => 24224)

=> #<Fluent::Logger::FluentLogger:0x007fc0892dbad0

 @buffer_overflow_handler=nil,

 @con=#<TCPSocket:fd 10>,

 @connect_error_history=[],

 @factory=#<MessagePack::Factory:0x007fc0892db918>,

 @host="localhost",

 @last_error={},

 @limit=8388608,

 @log_reconnect_error_threshold=13,

 @logged_reconnect_error=false,

 @logger=

  #<Logger:0x007fc0892db670

   @default_formatter=#<Logger::Formatter:0x007fc0892db648 @datetime_format=nil>,

   @formatter=nil,

   @level=1,

   @logdev=

    #<Logger::LogDevice:0x007fc0892db5a8

     @dev=#<IO:<STDERR>>,

     @filename=nil,

     @mutex=#<Logger::LogDevice::LogDeviceMutex:0x007fc0892db580 @mon_count=0, @mon_mutex=#<Mutex:0x007fc0892db530>, @mon_owner=nil>,

     @shift_age=nil,

     @shift_size=nil>,

   @progname=nil>,

 @mon=#<Monitor:0x007fc0892db760 @mon_count=0, @mon_mutex=#<Mutex:0x007fc0892db710>, @mon_owner=nil>,

 @nanosecond_precision=nil,

 @packer=#<MessagePack::Packer:0x007fc0892db8f0>,

 @pending=nil,

 @port=24224,

 @socket_path=nil,

 @tag_prefix=nil>

[3] pry(main)> Fluent::Logger.post("debug.test", { "id" => "1", "name" => "samuel" })

=> true



잘 나온다.


$ fluentd -c ./fluent/fluent.conf -vv

...


2017-08-16 20:03:59.000000000 +0900 debug.test: {"id":"1","name":"samuel"}




설정 파일 문법

https://docs.fluentd.org/articles/config-file#v1-format



tail log 문법

https://docs.fluentd.org/articles/in_tail



한글 착한 문서


http://blog.seulgi.kim/2014/04/fluentd-pluggable-log-collector.html

https://docs.google.com/presentation/d/1e6PXtPS_eQn7vY5hDhHlDVpCk1U6eKARoRqInoDiUkw/edit#slide=id.g271a4ef8f_018




과거에는 fluentd가 nanosecond 이슈가 있었다고 하나, 0.14부터는 nanosecond를 잘 보여주고 있다. 




https://www.fluentd.org/blog/fluentd-v0.14.9-has-been-released



time_as_integer true


out_forward

Since this version, time_as_integer parameter is now false. It means v0.14.9's out_forward can't forward data to v0.12's in_forward by default. You need to set time_as_integer true explicitly. We have already mentioned this point in v0.14.0 release, so we hope this change doesn't break your v0.14 to v0.12 forwarding.



'Cloud' 카테고리의 다른 글

[펌] fluentd 성능  (0) 2017.08.21
[td-agent] td-agent 설치 및 테스트  (0) 2017.08.18
[펌] 한국 오픈 스택 2017 자료 올라옴  (0) 2017.08.16
[펌] fluentd 사용 사례  (0) 2017.08.15
처음 본 오픈스택 Neutron  (0) 2017.07.24
Posted by '김용환'
,


한국 오픈 스택 2017 자료 올라옴


http://event.openstack.or.kr/2017/program.html




'Cloud' 카테고리의 다른 글

[td-agent] td-agent 설치 및 테스트  (0) 2017.08.18
fluentd 공부  (0) 2017.08.16
[펌] fluentd 사용 사례  (0) 2017.08.15
처음 본 오픈스택 Neutron  (0) 2017.07.24
처음 본 오픈스택 Swift  (0) 2017.07.24
Posted by '김용환'
,

[펌] fluentd 사용 사례

Cloud 2017. 8. 15. 10:37



카카오 

http://tech.kakao.com/2016/08/25/kemi/





라인에서 fludentd, hadoop를 사용한 사례


https://engineering.linecorp.com/en/blog/detail/83



https://promcon.io/2016-berlin/talks/hadoop-fluentd-cluster-monitoring-with-prometheus-and-grafana/



https://www.fluentd.org/casestudy/line





RDRC 2014 발표 자료 -fluentd

https://www.slideshare.net/tagomoris/fluentd-data-streams-in-ruby-world-rdrc2014



fluentd와 norikira 소개

https://engineering.linecorp.com/en/blog/detail/47



Log Aggregator 비교 - Scribe, Flume, Fluentd, logstash

http://blog.seulgi.kim/2014/04/log-aggregator-scribe-flume-fluentd.html



Fluentd vs. Logstash for OpenStack Log Management

https://www.slideshare.net/tagomoris/monitoring-with-fluentd



norikra - schema less fluentd sql engine 

http://tagomoris.hatenablog.com/entry/2017/07/28/123613

http://norikra.github.io/




https://www.slideshare.net/td-nttcom/fluentd-vs-logstash-for-openstack-log-management

'Cloud' 카테고리의 다른 글

fluentd 공부  (0) 2017.08.16
[펌] 한국 오픈 스택 2017 자료 올라옴  (0) 2017.08.16
처음 본 오픈스택 Neutron  (0) 2017.07.24
처음 본 오픈스택 Swift  (0) 2017.07.24
처음 본 오픈 스택 Glance  (0) 2017.07.21
Posted by '김용환'
,

페이스북 메시전에 광고가 들어갔다.


http://www.bloter.net/archives/284896


http://news1.kr/articles/?3046983



 


Posted by '김용환'
,

[cassandra3]

cassandra 2017. 8. 15. 00:59



카산드라 테이블의 컬럼을 삭제할 때 보조 인덱스(secondary)가 걸려 있다면 삭제할 수 없다. 


> ALTER TABLE "users" DROP "year";


InvalidRequest: Error from server: code=2200 [Invalid query] message="Cannot drop column year because it has dependent secondary indexes (users_idx)"



먼저 보조 인덱스를 삭제한 후 테이블의 컬럼을 삭제한다. 정상 종료..


> DROP INDEX "users_idx";

> ALTER TABLE "users" DROP "year";


Posted by '김용환'
,


How Facebook’s News Feed Sorting Algorithm Works

https://www.howtogeek.com/290919/how-facebooks-news-feed-sorting-algorithm-works/



How Facebook News Feed Works

https://techcrunch.com/2016/09/06/ultimate-guide-to-the-news-feed/






Posted by '김용환'
,




카카오 뱅크 내부 DB는 오라클 DB, Mysql+Percona(오라클의 RAC 대용)를 사용하고 언어는 Java로 사용한다. 


출처 

https://byline.network/2017/08/8-2/



데뷰 발표 자료.


[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다. from NAVER D2


Posted by '김용환'
,


cql 컬렉션(map, set, list)에는 기능도 많다. 자바로 개발되었던 이유로 cql을 사용해 탄력적으로 개발할 수 있다.



ALTER TABLE "user_status_updates"

ADD "starred_by_users" SET<text>;


ALTER TABLE "user_status_updates"

ADD "shared_by" LIST<text>;


ALTER TABLE "users"

ADD social_identities MAP<text,bigint>;



UPDATE 예제는 다음과 같다. UPDATE문은 INSERT문과 기반이 같은 upsert 이기 때문에 insert도 되고 update도 된다. 


CQL 컬렉션의 가장 강력한 기능은 컬렉션에 개별 값을 저장할 수 있다.



UPDATE images SET tags = tags + { 'cute', 'cuddly' } WHERE name = 'cat.jpg';

UPDATE images SET tags = tags - { 'lame' } WHERE name = 'cat.jpg';



UPDATE plays SET players = 5, scores = scores + [ 14, 21 ] WHERE id = '123-afde';

UPDATE plays SET players = 5, scores = [ 12 ] + scores WHERE id = '123-afde';



UPDATE users SET favs['author'] = 'Ed Poe' WHERE id = 'jsmith'

UPDATE users SET favs = favs +  { 'movie' : 'Cassablanca' } WHERE id = 'jsmith'



주의 할점은 list의 삭제와 변경은 성능 이슈가 있지만, map과 set의 삭제와 변경은 list에 비해 성능 이슈가 덜하다.




또한 컬렉션 컬럼에 인덱스를 사용할 수 있다. 그러나 성능 이슈가 있을 수 있는 대용량 트래픽에서는 사용하지 않는 것이 좋다. 


map 컬렉션 컬럼에 보조 인덱스를 생성하면, map의 키와 map의 값 모두 인덱스가 생성된다. 따라서 맵의 키만 인덱스 생성을 원한다면 KEYS라는 오퍼레이터를 사용한다.


CREATE INDEX ON "users" (KEYS("social_identities"));




검색은 다음과 같이 진행한다. 


SELECT "username", "social_identities"

FROM users

WHERE "social_identities" CONTAINS KEY 'facebook';




CQL에서는 컬렉션 컬럼을 부분적으로 읽을 수 없다. 컬렉션에서 데이터를 검색하는 유일한 방법은 컬렉션 전체를 읽는 것이다. 따라서 성능 이슈가 있는 곳에 사용할 때는 주의 깊게 사용해야 한다.


용량 제한이 있는데 컬렉션은 64KB를 넘지 않는 데이터를 포함할 수 있다. 하나의 컬렉션에 64KB 이상의 데이터를 추가할 수 없지만 컬렉션을 읽으려 하면 64KB까지만 데이터를 읽기 때문에 결과가 잘려 데이터 손실이 발생한다.

따라서 제한 없이 커질 수 있을 예정의 데이터는 컬렉션 컬럼에 적합하지 않다. 만약 계속 데이터가 커진다면 64KB 크기를 넘지 않는 여러 개의 컬렉션으로 쪼개야 한다.



카산드라 컬렉션의 다른 한계는 WHERE...IN 절을 사용해 여러 로우를 선택할 때 컬렉션을 읽을 수 없다는 점이다. 다음 쿼리는 에러가 발생한다.


SELECT * FROM "user_status_updates"

WHERE "username" = 'alice'

AND "id" IN (

 1234

);




테이블에 컬렉션 컬럼이 존재하면 WHERE...IN을 사용할 때는 컬렉션이 아닌 컬럼만 명시적으로 선택해야 한다.



튜플도 지원한다.


CREATE TABLE cycling.route (race_id int, race_name text, point_id int, lat_long tuple<text, tuple<float,float>>, PRIMARY KEY (race_id, point_id));





컬럼을 사용하는 주요 포인트가 있다. 


보조 인덱스는 단일 컬럼에만 적용할 수 있다. 예를 들어 education_history 컬럼이 각각 name과 year 컬럼으로 분리되어 있다면 해당 컬럼들의 주어진 값 조합으로 레코드를 효율적으로 검색할 수있는 인덱스를 생성할 수 없다. 튜플을 사용해 두 값을 단일 컬럼에 위치시키고 해당 컬럼에 인덱스를 추가해서 여러 컬럼에 인덱스를 추가한 것과 동일한 효과를 얻을 수 있다.

(카산드라의 보조 인덱스 단점을 컬렉션으로 해결할 수 있는 특징이 있다.)




튜플의 확장 개념인 사용자 정의 타입( udt)를 지원하기도 한다. 이름을 더 추가한다.



cqlsh> CREATE TYPE cycling.basic_info (

  birthday timestamp,

  nationality text,

  weight text,

  height text

);



CREATE TABLE cycling.cyclist_stats ( id uuid PRIMARY KEY, lastname text, basics FROZEN<basic_info>);  




대부분의 상황에서 사용자 정의 타입은 이름이 포함된 필드와 부분 선택의 추가 이점을 제공하기 때문에 튜플보다 더 나은 선택이 될 것이다.






구분

리스트

튜플

사용자 정의 타입

크기

유연

유연

유연

고정

고정

개별 변경

가능

가능

가능

불가능

불가능

부분 선택

불가능

불가능

불가능

불가능

가능

이름-값 쌍

불가능

불가능

가능

불가능

가능

여러 타입

불가능

불가능

키와 값

가능

가능

인덱스

개별 엘리먼트

개별 엘리먼트

개별 엘리먼트

전체 값

전체 값

기본 키 사용 여부

불가능

불가능

불가능

가능

가능



참고


http://www.datastax.com/documentation/cql/3.3/cql/cql_reference/delete_r.html


http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlUpdate.html


http://docs.datastax.com/en/cql/3.1/cql/cql_using/use_collections_c.html


http://cassandra.apache.org/doc/old/CQL-3.0.html#collections


https://docs.datastax.com/en/cql/3.1/cql/cql_reference/tupleType.html


https://docs.datastax.com/en/cql/latest/cql/cql_using/useCreateUDT.html

Posted by '김용환'
,

Mac OS에서 카산드라를 실행했다가 비정상 종료가 되면 가끔 다음 에러가 발생할 때가 있다. 


재시작을 한다 한들 결과를 똑같다.



INFO  [main] 2017-08-11 23:18:05,341 CommitLog.java:157 - Replaying ./bin/../data/commitlog/CommitLog-6-1502171952033.log, ./bin/../data/commitlog/CommitLog-6-1502171952034.log, ./bin/../data/commitlog/CommitLog-6-1502422474087.log, ./bin/../data/commitlog/CommitLog-6-1502422474088.log, ./bin/../data/commitlog/CommitLog-6-1502422504239.log, ./bin/../data/commitlog/CommitLog-6-1502422504240.log, ./bin/../data/commitlog/CommitLog-6-1502452966387.log, ./bin/../data/commitlog/CommitLog-6-1502452966388.log, ./bin/../data/commitlog/CommitLog-6-1502457013860.log, ./bin/../data/commitlog/CommitLog-6-1502457013861.log, ./bin/../data/commitlog/CommitLog-6-1502457041056.log, ./bin/../data/commitlog/CommitLog-6-1502457041057.log

ERROR [main] 2017-08-11 23:18:05,622 JVMStabilityInspector.java:82 - Exiting due to error while processing commit log during initialization.

org.apache.cassandra.db.commitlog.CommitLogReadHandler$CommitLogReadException: Unexpected error deserializing mutation; saved to /var/folders/ch/zbmq4sk149gcz172ylw54m140000gp/T/mutation410555022742916493dat.  This may be caused by replaying a mutation against a table with the same name but incompatible schema.  Exception follows: java.io.IOError: java.io.IOException: Corrupt empty row found in unfiltered partition


at org.apache.cassandra.db.commitlog.CommitLogReader.readMutation(CommitLogReader.java:409) [apache-cassandra-3.10.jar:3.10]

at org.apache.cassandra.db.commitlog.CommitLogReader.readSection(CommitLogReader.java:342) [apache-cassandra-3.10.jar:3.10]

at org.apache.cassandra.db.commitlog.CommitLogReader.readCommitLogSegment(CommitLogReader.java:201) [apache-cassandra-3.10.jar:3.10]

at org.apache.cassandra.db.commitlog.CommitLogReader.readAllFiles(CommitLogReader.java:84) [apache-cassandra-3.10.jar:3.10]

at org.apache.cassandra.db.commitlog.CommitLogReplayer.replayFiles(CommitLogReplayer.java:140) [apache-cassandra-3.10.jar:3.10]




commit 로그를 replay하다가 에러가 발생한 이유인데, commit log가 바이너리라서 읽기도 애매하긴 하다. 정확한 문제를 찾기도 전에 어려워질 수 있다. commit 로그를 백업 디렉토리에 move시켜 놓고 다시 재시작하면 정상적으로 동작한다. 


mkdir -p ~/dev/backup/

mv data/commitlog ~/dev/backup/

./bin/cassandra



'cassandra' 카테고리의 다른 글

[cassandra3]  (0) 2017.08.15
[cassandra3] 컬렉션과 사용자 정의 타입(udt)  (0) 2017.08.12
[cassandra] node local의 의미  (0) 2017.08.10
[cassandra3] select now()  (0) 2017.08.09
[cassandra3] schema 백업(backup)/복구(restore)하기  (0) 2017.08.08
Posted by '김용환'
,