프로그램 사용/docker2019. 4. 22. 11:04

docker 기반의 카산드라에 sql 클라이언트 실행하기

$ docker exec -it container_id cqlsh

[링크 : https://medium.com/@michaeljpr/five-minute-guide-getting-started-with-cassandra-on-docker]

 

키스페이스 = table? 이런 개념인진 모르겠지만

테이블에 앞서 키스페이스를 확인하라고 하는걸 보니.. 

Sinse v 6.0 Docs 
Get keyspaces info 
SELECT * FROM system_schema.keyspaces 

Get tables info 
SELECT * FROM system_schema.tables WHERE keyspace_name = 'keyspace name'; 

Get table info 
SELECT * FROM system_schema.columns  
WHERE keyspace_name = 'keyspace_name' AND table_name = 'table_name'; 

 

추천수가 낮은 답변인데 이걸로 하면 일반적인 db에서 말하는 database를 확인가능하고

. 누르고 탭을 누르면 자동완성되니 나름 편하게 확인가능 할 듯

desc keyspaces;

[링크 : https://stackoverflow.com/questions/38696316/how-to-list-all-cassandra-tables]


'프로그램 사용 > docker' 카테고리의 다른 글

docker offline image  (0) 2019.05.16
cassandra 메모리 관리  (0) 2019.05.15
docker-compose up/down 주의사항  (0) 2019.03.24
docker 컨테이너 자동시작  (0) 2019.03.21
docker cassandra selinux  (0) 2019.03.20
Posted by 구차니

Incremental 옵션이 영향을 주는것 같아서 해보는데 일단 귀찮아서...

Incremental no 옵션을 설정한 다음 전체 로그를 붙여서(과거 - 현재 순서로)

붙이니 일단 되는 듯.. -p 옵션을 통해서 여러개로 나누어진 녀석을 처리가능하다는데

해보진 않아서 모르겠네.. 해볼까? (멀 잘못했나.. -p 로그파일 해도 안되네..)

 

6. My logs are HUGE! Can I run The Webalizer on partial logs?Yes!
        . The Webalizer fully supports incremental processing. This allows you to rotate your logs as often as needed without the loss of statistical detail between runs. Use the "Incremental" keyword in your configuration file, or the "-p" command line switch to enable incremental processing. See the
 README file for additional information and precautions on using incremental processing.

[링크 : http://www.webalizer.org/faq.html]

 

The Webalizer is a command line application and is launched from the operating system shell prompt. A typical command is shown below.webalizer -p -F clf -n en.wikipedia.org -o reports logfiles/access_log

This command instructs The Webalizer to analyze the log file access_log, run in the incremental mode (-p), interpret the log as a CLF log file (-F), use the domain name en.wikipedia.org for report links (-n) and produce the output subdirectory of the current directory. Use the -h option to see the complete list of command line options.

[링크 : https://en.wikipedia.org/wiki/Webalizer#Command_line]

 

for obj in $(ls access*); do webalizer -p -F apache -n example.hostname.com -o /path/to/webalizer/ $obj; done

[링크 : https://coderwall.com/p/0eh7iw/run-old-access-logs-through-webalizer]

Posted by 구차니

특정 디렉토리를 제외하려면 그냥 적고

그 안에 특정 파일은 버전관리 하려면

!/path/filename

으로 적어주면 된다.

[링크 : https://stackoverflow.com/questions/987142/make-gitignore-ignore-everything-except-a-few-files]

Posted by 구차니

kvm 에서 작동중에 cpu를 추가하는 방법

반대로 빼는건 좀 복잡한 듯

 

추가하기

# virsh setvcpus UAKVM2 2
# virsh dominfo UAKVM2

 

제거하기

# virsh setvcpus --live --guest UAKVM2 1

 

설정 저장하기
# virsh setvcpus --config UAKVM2 1

[링크 : https://www.unixarena.com/2015/12/linux-kvm-how-to-add-remove-vcpu-to-guest-on-fly.html/]

 

+

2019.04.20

현재 2개인데

줄이는 것 일단 안되는데 착각해서 해보고..

# virsh setvcpus testvm 1
오류:지원되지 않는 설정: failed to find appropriate hotpluggable vcpus to reach the desired target vcpu count

 

늘리는 건 최대 값 설정된게 있는데 그걸 넘어서 안된다고 하네..

# virsh setvcpus testvm 4
오류:잘못된 인수: requested vcpus is greater than max allowable vcpus for the live domain: 4 > 2

 

이것저것 해보는데.. maximum live는 어떻게 올리지? ㅠㅠ

# virsh vcpucount testvm
maximum      config         2
maximum      live           2
current      config         2
current      live           2

# virsh setvcpus testvm 4 --maximum
오류:Option --config is required by option --maximum

# virsh setvcpus testvm 4 --maximum --config

# virsh vcpucount testvm
maximum      config         4
maximum      live           2
current      config         2
current      live           2

 

# virsh setvcpus testvm 4 --live
오류:잘못된 인수: requested vcpus is greater than max allowable vcpus for the live domain: 4 > 2

 

# virsh setvcpus testvm 4 --live --maximum --config
오류:Operation not supported: maximum vcpu count of a live domain can't be modified

 

아래 명령으로 2를 4로 바꾸었는데

# virsh edit testvm

 <vcpu placement='static'>4</vcpu>

 

maximum live는 안올라가네.. 그래서 여전히 설정이 안된다.. ㅠㅠ

# virsh vcpucount testvm 
maximum      config         4
maximum      live           2
current      config         4
current      live           2

 

chcpu로 코어를 끄고 켤 수 있는 듯?

# chcpu

Usage:
 chcpu [options]

Options:
  -h, --help                    print this help
  -e, --enable        enable cpus
  -d, --disable       disable cpus
  -c, --configure     configure cpus
  -g, --deconfigure   deconfigure cpus
  -p, --dispatch          set dispatching mode
  -r, --rescan                  trigger rescan of cpus
  -V, --version                 output version information and exit

[링크 : https://www.ibm.com/.../ldva_t_modifyingCPUNumber.html]

Posted by 구차니

cpu를 가상화해서 특정 프로세스에서 돌아가게 해주는거니

affinity를 통해서 특정 VM에 특정 vcpu를 할당하는게 가능은 하겠다 싶은데

그 이유중에 하나가 HT 코어는 실 코어보다 성능이 떨어지기 때문.

(반대로 서버에서 HT를 쓰지 않거나, 반대로 특정 코어를 지정안하는게 낫지 않나 싶지만

코어 갯수로 라이센스 먹이는 사악한 놈들이 있다고도 하니..)

 

[링크 : https://forums.unraid.net/...-performance-improvements-in-vms-by-adjusting-cpu-pinning-and-assignment/]

'프로그램 사용 > kvm(virt-manager)' 카테고리의 다른 글

VDI GPU passthrough  (0) 2019.04.24
kvm live add cpu  (0) 2019.04.16
virsh domstats 로 가상머신의 cpu 사용율 확인하기  (0) 2019.03.29
kvm snapshot  (0) 2019.03.17
tar 로 압축된 sparse file 풀기  (0) 2019.02.16
Posted by 구차니
프로그램 사용/squid2019. 4. 4. 15:21

음.. parent로 hier_direct를 돌릴순 있는데

그럼 자기 자신 혼자 사용중에는 자신이 parent가 아닌건가?

4.1 How do I join a cache hierarchy?
To place your cache in a hierarchy, use the cache_host directive in squid.conf to specify the parent and sibling nodes.

For example, the following squid.conf file on childcache.example.com configures its cache to retrieve data from one parent cache and two sibling caches:

        #  squid.conf - On the host: childcache.example.com
        #
        #  Format is: hostname  type  http_port  udp_port
        #
        cache_host parentcache.example.com   parent  3128 3130
        cache_host childcache2.example.com   sibling 3128 3130
        cache_host childcache3.example.com   sibling 3128 3130
The cache_host_domain directive allows you to specify that certain caches siblings or parents for certain domains:

        #  squid.conf - On the host: sv.cache.nlanr.net
        #
        #  Format is: hostname  type  http_port  udp_port
        #

        cache_host electraglide.geog.unsw.edu.au parent 3128 3130
        cache_host cache1.nzgate.net.nz          parent 3128 3130
        cache_host pb.cache.nlanr.net   parent 3128 3130
        cache_host it.cache.nlanr.net   parent 3128 3130
        cache_host sd.cache.nlanr.net   parent 3128 3130
        cache_host uc.cache.nlanr.net   sibling 3128 3130
        cache_host bo.cache.nlanr.net   sibling 3128 3130
        cache_host_domain electraglide.geog.unsw.edu.au .au
        cache_host_domain cache1.nzgate.net.nz   .au .aq .fj .nz
        cache_host_domain pb.cache.nlanr.net     .uk .de .fr .no .se .it
        cache_host_domain it.cache.nlanr.net     .uk .de .fr .no .se .it
        cache_host_domain sd.cache.nlanr.net     .mx .za .mu .zm
The configuration above indicates that the cache will use pb.cache.nlanr.net and it.cache.nlanr.net for domains uk, de, fr, no, se and it, sd.cache.nlanr.net for domains mx, za, mu and zm, and cache1.nzgate.net.nz for domains au, aq, fj, and nz.

[링크 : http://www.comfsm.fm/computing/squid/FAQ-4.html]

[링크 : https://www.christianschenk.org/blog/using-a-parent-proxy-with-squid/]

'프로그램 사용 > squid' 카테고리의 다른 글

squid hierarchy와 cache  (0) 2019.04.04
squid storeid... 에러  (0) 2019.04.03
squid storeid  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
Posted by 구차니
프로그램 사용/squid2019. 4. 4. 07:49

관련 문서 정리

흐음.. hier_direct를 못하도록 막으면 통신이 안되고 어떻게 할 방법이 없나..

캐시 구조에서 상위로 돌리도록 하고 상위에서 어떻게 처리가 가능할줄 알았는데..

 

[링크 : http://www.squid-cache.org/Doc/config/nonhierarchical_direct/]

[링크 : https://wiki.squid-cache.org/Features/CacheHierarchy]

[링크 : https://wiki.squid-cache.org/SquidFaq/SquidLogs#Hierarchy_Codes]

[링크 : http://www.squid-cache.org/Doc/config/url_rewrite_program/]

[링크 : https://github.com/rchunping/squid-urlrewrite]

'프로그램 사용 > squid' 카테고리의 다른 글

squid 캐시에 합류하기  (0) 2019.04.04
squid storeid... 에러  (0) 2019.04.03
squid storeid  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
Posted by 구차니

기존에는 standard로 썼는데, standard는 문단 정렬 기능이 먹지 않아서 full로 설정해주어야 적용이 된다.

The following distributions (see comparison table) are available:

  • basic - the Basic preset
  • standard - the Standard preset
  • standard-all - the Standard preset together with all other plugins created by CKSource*
  • full - the Full preset
  • full-all - the Full preset together with all other plugins created by CKSource*

[링크 : https://cdn.ckeditor.com/]

 

옵션을 만들어주는 사이트

기본은 아래와 같이 생성해주는데

CKEDITOR.editorConfig = function( config ) {
config.toolbar = [
{ name: 'document', items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
{ name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
{ name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
'/',
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat' ] },
{ name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
'/',
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
{ name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
{ name: 'about', items: [ 'About' ] }
];
};

 

코드에서 쓰려면 config. 이후를 붙이고 수정하면된다.

<script src="https://cdn.ckeditor.com/4.11.3/full/ckeditor.js"></script>

<script>

CKEDITOR.replace('ckeditor4', {

uploadUrl: '/uploader',

toolbar : [ 
{ name: 'document', items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] }, 
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, 
{ name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] }, 
{ name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] }, 
'/', 
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat' ] }, 
{ name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] }, 
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, 
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] }, 
'/', 
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] }, 
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] }, 
{ name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] }, 
{ name: 'about', items: [ 'About' ] } 
]

});

</script>

[링크 : https://ckeditor.com/latest/samples/toolbarconfigurator/index.html#basic]

'프로그램 사용 > ckeditor(웹에디터)' 카테고리의 다른 글

ckeditor 모드별 모양  (0) 2019.03.08
ckeditor file upload with node.js  (0) 2019.03.07
ckeditor / fckeditor?  (0) 2014.07.16
ckeditor 사용하기  (0) 2013.02.22
fckeditor plugin for squirrelMail  (0) 2011.06.14
Posted by 구차니
프로그램 사용/squid2019. 4. 3. 14:50

storeid를 해보려고 ruby 스크립트까지 해보는데 안되서 급 멘붕..

에러를 천천히 보니 일단은 new_format.rb가 실행이 안되는 듯한데

# systemctl status squid 
● squid.service - Squid caching proxy 
   Loaded: loaded (/usr/lib/systemd/system/squid.service; enabled; vendor preset: disabled) 
   Active: failed (Result: exit-code) since 수 2019-04-03 14:40:47 KST; 5ms ago 
  Process: 20020 ExecStop=/usr/sbin/squid -k shutdown -f $SQUID_CONF (code=exited, status=1/FAILURE) 
  Process: 19848 ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF (code=exited, status=0/SUCCESS) 
  Process: 19842 ExecStartPre=/usr/libexec/squid/cache_swap.sh (code=exited, status=0/SUCCESS) 
 Main PID: 19851 (code=exited, status=1/FAILURE) 

 4월 03 14:40:47 localhost squid[19851]: Squid Parent: (squid-1) process 19990 started 
 4월 03 14:40:47 localhost (squid-1)[19990]: The store_id helpers are crashing too rapidly, need help! 
 4월 03 14:40:47 localhost squid[19851]: Squid Parent: (squid-1) process 19990 exited with status 1 
 4월 03 14:40:47 localhost squid[19851]: Squid Parent: (squid-1) process 19990 will not be restarted due to repeated, frequent failures 
 4월 03 14:40:47 localhost squid[19851]: Exiting due to repeated, frequent failures 
 4월 03 14:40:47 localhost systemd[1]: squid.service: main process exited, code=exited, status=1/FAILURE 
 4월 03 14:40:47 localhost squid[20020]: squid: ERROR: Could not send signal 15 to process 19990: (3) No such process 
 4월 03 14:40:47 localhost systemd[1]: squid.service: control process exited, code=exited status=1 
 4월 03 14:40:47 localhost systemd[1]: Unit squid.service entered failed state. 
 4월 03 14:40:47 localhost systemd[1]: squid.service failed. 

 

퍼미션은 진작에 +x로 줬는데 안되고

If you get this error:

FATAL: The store_id helpers are crashing too rapidly, need help!

check for permssions

[링크 : https://github.com/rudiservo/pfsense_storeid]

 

그냥 해당 스크립트를 실행해보니 에러 발생.. libxml...?

# ruby new_format.rb
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- libxml (LoadError)
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
        from new_format.rb:8:in `'

그래서 검색해서 해당 모듈을 까는데 안깔린다!!!

# gem install -r libxml-ruby 
Fetching: libxml-ruby-3.1.0.gem (100%) 
Building native extensions.  This could take a while... 
ERROR:  Error installing libxml-ruby: 
        ERROR: Failed to build gem native extension. 

    /usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h 


Gem files will remain installed in /usr/local/share/gems/gems/libxml-ruby-3.1.0 for inspection. 
Results logged to /usr/local/share/gems/gems/libxml-ruby-3.1.0/ext/libxml/gem_make.out 

[링크 : https://github.com/xml4r/libxml-ruby]

 

ruby 모듈 하나 설치하려고 먼가 잔뜩 깔게 하다니..

yum install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ruby-devel libxml2 libxml2-devel libxslt libxslt-devel git

[링크 : https://gist.github.com/lovellfelix/8135631]

'프로그램 사용 > squid' 카테고리의 다른 글

squid 캐시에 합류하기  (0) 2019.04.04
squid hierarchy와 cache  (0) 2019.04.04
squid storeid  (0) 2019.04.03
squid storeurl_rewrite  (0) 2019.04.02
lynx proxy  (0) 2019.03.27
Posted by 구차니
프로그램 사용/nginx2019. 4. 3. 14:15

ckeditor에 파일을 올리는데 localhost에서는 잘만 올라가는 놈인데

회사 서버에만 하면 안되서 리눅스 버전이 문제인가 고민을 했지만..

/uploader:1 Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)

일단은 node.js 쪽 설정은 기본으로도 충분히 잘 올라가는 상황이라 아래 내용은 별 의미없어 보이고

혹시나 리눅스용은 먼가 다른가 해서 했지만 안올라가는건 여전한 상황 -_-

[링크 : https://stackoverflow.com/questions/19917401/error-request-entity-too-large]

[링크 : http://meonggae.blogspot.com/2016/11/http-response-code-413.html]

 

 

검색을 하다보니 갑자기 반짝하는 키워드.. 아...

nginx에서 reverse proxy로 쓰고 있었는데 nginx에서도 body 크기가 제한되는데 이걸 풀어줘야 정상작동 한다.

http {
    client_max_body_size 5M;

}

[링크 : https://github.com/expressjs/body-parser/issues/235]

'프로그램 사용 > nginx' 카테고리의 다른 글

nginx - 413 Request Entity Too Large  (0) 2024.06.13
(angluar/react) router와 nginx  (0) 2019.05.31
nginx 502 bad gateway와 audit  (0) 2019.03.20
nginx rever proxy with virtual host(+ subdomain)  (0) 2019.03.07
nginx load balance  (0) 2019.03.05
Posted by 구차니