map을 생성할 때는 make를 사용한다. 


그리고 map의 값에 여러 매개 변수가 있을 때 구분자를 , 를 사용하는데, 끝에도 사용해야 에러가 발생하지 않는다. 


package main

import "fmt"

type Member struct {
name, dept string
a int
}

var m map[string]string
var members map[int]Member

func main() {
m = make(map[string]string)
m["key1"] = "value1"
m["key2"] = "value2"

fmt.Println(m["key1"])
fmt.Println(m["key2"])

members = make(map[int]Member)
members[1] = Member{
"samuel", "personal", 1,
}
members[2] = Member{
"jacks", "development", 2,
}

fmt.Println(members[1])
fmt.Println(members[2])
}

결과


value1

value2

{samuel personal 1}

{jacks development 2}





map 생성할 때 make를 사용하지 않고 일반 언어처럼 바로 생성할 수도 있다. 



var member2 = map[int]Member {
1 : {"hardy", "development", 1},
2 : {"jenny", "personal", 2},
}

fmt.Println(member2)


결과


map[1:{hardy development 1} 2:{jenny personal 2}]





2개를 리턴받을 수 있는데, 앞 매개변수는 값, 뒷 매개변수는 결과를 나타난다.


a, result := m["key2"]
fmt.Println(a, result)

b, result := members[2]
fmt.Println(b, result)

결과는 다음과 같다.


value2 true

{jacks development 2} true






map의 키,값, 키만, 값만 얻는 예제이다. 


fmt.Println("==1 (key value)")
for key, value := range members {
fmt.Println("Key:", key, "Value:", value)
}

fmt.Println("==2 (only key)")
for value := range members {
fmt.Println("value:", value)
}

fmt.Println("==3 (only value)")
for _, value := range members {
fmt.Println("value:", value)
}



결과는 다음과 같다. 


==1 (key value)

Key: 1 Value: {samuel personal 1}

Key: 2 Value: {jacks development 2}

==2 (only key)

value: 1

value: 2

==3 (only value)

value: {samuel personal 1}

value: {jacks development 2}





변경과 삭제는 다음과 같다.



m["key1"] = "newValue1"
fmt.Println(m["key1"])

delete(m, "key1")
fmt.Println(m["key1"])







Posted by '김용환'
,



https://golang.org/doc/faq#unused_variables_and_imports


Can I stop these complaints about my unused variable/import?

The presence of an unused variable may indicate a bug, while unused imports just slow down compilation, an effect that can become substantial as a program accumulates code and programmers over time. For these reasons, Go refuses to compile programs with unused variables or imports, trading short-term convenience for long-term build speed and program clarity.

Still, when developing code, it's common to create these situations temporarily and it can be annoying to have to edit them out before the program will compile.

Some have asked for a compiler option to turn those checks off or at least reduce them to warnings. Such an option has not been added, though, because compiler options should not affect the semantics of the language and because the Go compiler does not report warnings, only errors that prevent compilation.

There are two reasons for having no warnings. First, if it's worth complaining about, it's worth fixing in the code. (And if it's not worth fixing, it's not worth mentioning.) Second, having the compiler generate warnings encourages the implementation to warn about weak cases that can make compilation noisy, masking real errors that should be fixed.

It's easy to address the situation, though. Use the blank identifier to let unused things persist while you're developing.

import "unused"

// This declaration marks the import as used by referencing an
// item from the package.
var _ = unused.Item  // TODO: Delete before committing!

func main() {
    debugData := debug.Profile()
    _ = debugData // Used only during debugging.
    ....
} 
Nowadays, most Go programmers use a tool, goimports, which automatically rewrites a Go source file to have the correct imports, eliminating the unused imports issue in practice. This program is easily connected to most editors to run automatically when a Go source file is written.


 
import (
"fmt"
)


import "fmt"


./Test.go:3: imported and not used: "fmt"




아래와 같이 해야 에러가 발생하지 않는다. 



import (
_ "fmt"
)

func main() {

}






func main() {
i := 0
_ = i
}


Posted by '김용환'
,



By applying policy-based reinforcement learning with a query

execution environment to WikiSQL, our model Seq2SQL outperforms attentional

sequence to sequence models, improving execution accuracy from 35.9% to 60.3%

and logical form accuracy from 23.4% to 49.2%.



http://m.zdnet.co.kr/news_view.asp?article_id=20170831082744#imadnews

https://www.salesforce.com/blog/2017/08/salesforce-research-ai-talk-to-data

https://github.com/salesforce/WikiSQL

https://einstein.ai/static/images/layouts/research/seq2sql/seq2sql.pdf




Posted by '김용환'
,





맥에서 virtualbox(5.1.6)를 설치해서 오픈 스택을 구성하기 위해 ubuntu OS(16.04-64)를 설치하던 중에 


virtualbox에서 guest OS 설치할 때 호스트 전용 어댑터를 못찾을 수 있다.






VirtuBox-일반설정-네트워크-호스트 전용 네트워크 를 보면, 비어 있다.


창 오른쪽에 +네트워크카드를 선택하면 vboxnet0을 생성할 수 있다. 


-네트워크카드를 선택하면 선택한 네트워크 카드를 삭제할 수 있다.


곤봉 아이콘을 선택하면 어댑터/DHCP 정보가 나타난다. 

어댑터의 IP는 192.168.56.1/255.255.255.0으로 나타나고, DHCP 서버는 192.168.56.100이고 서버마스크는 255.255.255.0이며 주소의 한계는 192.168.56.101~192.168.56.254로 나타난다. (잘 기억하자!)




VirtuBox-일반설정-네트워크-NAT 네트워크 를 보면, 비어 있다.

호스트 전용 네트워크처럼 하나의 네트워크 카드를 추가한다. NatNetwork를 설정한다. 나중에 도움이 될 수 있다. 







vboxnet0을 생성한 후, guestOS를 셋팅한다.



guest OS- 설정-네트워크-어댑터1에서 

호스트 전용 어댑터로 설정하고 이름은 이전에 설정한 vobxnet0로 연결할 수 있다. 무작위 모드는 모두 허용으로 한다.

추후 enp0s3이고 내부용 네트워크이다.  



guest OS- 설정-네트워크-어댑터2에서

브리지 어댑터로 설정하고 en0:WI-FI(AirPort)로 설정하고 무작위 모드는 모두 허용으로 한다.

추후 enp0s8이고 외부용 네트워크이다.

(환경에 따라 사실 잘 동작되지 않을 수 있고, 언젠가는 되겠지 하며 접근해보았다. 안되도 openstack에는 영향이 없다.)




어댑터2가 동작되지 않을 수 있는 환경을 대비해 

guest OS- 설정-네트워크-어댑터3에서 NAT 어댑터를 설정한다. 






이제, guest OS(ubuntu)를 실행시켜 설치한다.







네트워크를 작업한다. enp0s8은 사설 네트워크에서는 잘 동작할 수 있지만, 특정 상황에서는 잘 동작되지 않을 수 있다. 이 때는 enp0s9 (이전에 설정한 NAT 네트워크의 도움을 받으면서 진행할 수 있다)


$ sudo vi /etc/network/interfaces

source /etc/network/interfaces.d/*

auto lo  

iface lo inet loopback


auto enp0s3  

iface enp0s3 inet dhcp


auto enp0s8  

iface enp0s8 inet static  

address 192.168.56.101

netmask 255.255.255.0  

network 192.168.56.0  



네트워킹 데몬을 초기화한다.


$ sudo systemctl restart networking



역시 enp0s8은 잘 동작하지 않는다. 하지만 어차피 내부는 동작하니까. 그대로 진행해 본다. 





enps0s3과 enps0s8은 각각 다음과 같이 정해졌다.

$ ifconfig

..

enp0s3  inet addr:192.168.56.102

..




호스트 OS(맥)에서 게스트 OS(우분투)가 정상적인지 ping 을 실행해 본다.


$ ping 192.168.56.1

$ ping 192.168.56.102




우분투에서 ssh server를 설치 / 실행한다.

(The following packages have unmet dependencies: 에러가 나오면 update를 실행하면 된다)


$ sudo apt-get update


$ sudo apt-get install openssh-server 


$ sudo systemctl enable ssh


$ sudo systemctl start ssh






호스트 OS(맥)에서 게스트 OS(우분투) 22번 포트로 접근한다.


$ ssh -l samuel 192.168.56.102

The authenticity of host '192.168.56.102 (192.168.56.102)' can't be established.

ECDSA key fingerprint is SHA256:QZzP8QStApL95hXVI1C8+KLDCeJqfYyynJcMDQf0tzw.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.56.102' (ECDSA) to the list of known hosts.

samuel@192.168.56.102's password:

Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.10.0-28-generic x86_64)


 * Documentation:  https://help.ubuntu.com

 * Management:     https://landscape.canonical.com

 * Support:        https://ubuntu.com/advantage


93 packages can be updated.

58 updates are security updates.



The programs included with the Ubuntu system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.


Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by

applicable law.


samuel@samuel-VirtualBox:~$




git을 설치한다.



$ sudo su


$ sudo apt-get install git




stack이라는 사용자 계정을 만든다. useradd 써도 된다. 


$ git clone https://git.openstack.org/openstack-dev/devstack


$ devstack/tools/create-stack-user.sh


$ echo "stack ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers




stack 계정으로 접근해서 devstack를 체크아웃받고 local.conf 파일을 수정하고 stack.sh를 실행한다. 



$ su stack 


$ cd /home/stack


$ apt-get update


$ git clone https://git.openstack.org/openstack-dev/devstack


$ cd devstack/


$ cp samples/local.conf local.conf


$ vi local.conf

HOST_IP=127.0.0.1

ADMIN_PASSWORD=openstack

MYSQL_PASSWORD=openstack

RABBIT_PASSWORD=openstack

SERVICE_PASSWORD=openstack


$ ./stack.sh



2017.9.5 일자 master 버전으로는 문제가 없이 동작한다. 




=========================

DevStack Component Timing

=========================

Total runtime    1292


run_process       33

test_with_retry    3

apt-get-update     8

pip_install      247

osc              191

wait_for_service  30

git_timed        233

dbsync            19

apt-get           91

=========================




This is your host IP address: 127.0.0.1

This is your host IPv6 address: ::1

Horizon is now available at http://127.0.0.1/dashboard

Keystone is serving at http://127.0.0.1/identity/

The default users are: admin and demo

The password: openstack


WARNING:

Using lib/neutron-legacy is deprecated, and it will be removed in the future



Services are running under systemd unit files.

For more information see:

https://docs.openstack.org/devstack/latest/systemd.html


DevStack Version: pike

Change: 037d70a75c55035445a9533191e52a759e697348 Merge "Replace http with https for doc links in devstack's document" 2017-09-04 04:49:19 +0000

OS Version: Ubuntu 16.04 xenial






대시보드를 실행해본다. 


http://192.168.56.102/dashboard





로그에 나와 있듯이 admin/openstack으로 접근한다.




로그인 하면 다음 화면이 나온다.






내부에 무엇이 바뀌었나 봤더니.. 네트워크 디바이스가 추가되었다. 


$ip addr



5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000

6: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

7: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

8: br-int: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

9: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000

10: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    


open swtich 가상 네트워크를 살펴본다. 


$ sudo ovs-vsctl show

46131da2-9a7a-4daf-8930-be13fa42b951

    Manager "ptcp:6640:127.0.0.1"

        is_connected: true

    Bridge br-int

        Controller "tcp:127.0.0.1:6633"

            is_connected: true

        fail_mode: secure

        Port "qg-a29d6f1e-73"

            tag: 2

            Interface "qg-a29d6f1e-73"

                type: internal

        Port "tap65add5ed-61"

            tag: 1

            Interface "tap65add5ed-61"

                type: internal

        Port "qr-5732dad9-2d"

            tag: 1

            Interface "qr-5732dad9-2d"

                type: internal

        Port int-br-ex

            Interface int-br-ex

                type: patch

                options: {peer=phy-br-ex}

        Port patch-tun

            Interface patch-tun

                type: patch

                options: {peer=patch-int}

        Port "qr-000ed957-83"

            tag: 1

            Interface "qr-000ed957-83"

                type: internal

        Port br-int

            Interface br-int

                type: internal

    Bridge br-tun

        Controller "tcp:127.0.0.1:6633"

            is_connected: true

        fail_mode: secure

        Port br-tun

            Interface br-tun

                type: internal

        Port patch-int

            Interface patch-int

                type: patch

                options: {peer=patch-tun}

    Bridge br-ex

        Controller "tcp:127.0.0.1:6633"

            is_connected: true

        fail_mode: secure

        Port phy-br-ex

            Interface phy-br-ex

                type: patch

                options: {peer=int-br-ex}

        Port br-ex

            Interface br-ex

                type: internal

    ovs_version: "2.6.1"



가상 라우터와 가상 dhcp를 확인한다. 


$ sudo ip netns show

qrouter-fbbc5c05-4373-4dfa-8ac8-e2d34442496c

qdhcp-59013e3c-0a59-4e18-8e5a-2a463dbeae1a



가상 라우터와 가상 hdcp id로 환경을 살펴본다.


가상 라우터에 할당된 네트워크와 ip를 확인할 수 있다.


$ sudo ip netns exec qrouter-fbbc5c05-4373-4dfa-8ac8-e2d34442496c ifconfig

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


qg-a29d6f1e-73 Link encap:Ethernet  HWaddr fa:16:3e:54:5f:05

          inet addr:172.24.4.5  Bcast:172.24.4.255  Mask:255.255.255.0

          inet6 addr: 2001:db8::1/64 Scope:Global

          inet6 addr: fe80::f816:3eff:fe54:5f05/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:51 errors:0 dropped:0 overruns:0 frame:0

          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:8457 (8.4 KB)  TX bytes:2418 (2.4 KB)


qr-000ed957-83 Link encap:Ethernet  HWaddr fa:16:3e:d6:08:52

          inet addr:10.0.0.1  Bcast:10.0.0.63  Mask:255.255.255.192

          inet6 addr: fe80::f816:3eff:fed6:852/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1

          RX packets:26 errors:0 dropped:0 overruns:0 frame:0

          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2736 (2.7 KB)  TX bytes:998 (998.0 B)


qr-5732dad9-2d Link encap:Ethernet  HWaddr fa:16:3e:c1:d3:1b

          inet6 addr: fe80::f816:3eff:fec1:d31b/64 Scope:Link

          inet6 addr: fd6c:40e8:796f::1/64 Scope:Global

          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1

          RX packets:5 errors:0 dropped:0 overruns:0 frame:0

          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:477 (477.0 B)  TX bytes:3972 (3.9 KB)




가상 dhcp는 10.0.0.2로 매핑되어 있다.



$ sudo ip netns exec qdhcp-59013e3c-0a59-4e18-8e5a-2a463dbeae1a ifconfig

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


tap65add5ed-61 Link encap:Ethernet  HWaddr fa:16:3e:d6:06:c5

          inet addr:10.0.0.2  Bcast:10.0.0.63  Mask:255.255.255.192

          inet6 addr: fe80::f816:3eff:fed6:6c5/64 Scope:Link

          inet6 addr: fd6c:40e8:796f:0:f816:3eff:fed6:6c5/64 Scope:Global

          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1

          RX packets:37 errors:0 dropped:0 overruns:0 frame:0

          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:3504 (3.5 KB)  TX bytes:802 (802.0 B)




http://192.168.56.102/dashboard/admin/networks/에서 private, public 영역을 보면서 서브넷 환경을 알 수 있다.








http://192.168.56.102/dashboard/admin/routers/에 접근하면. 라우터 정보도 볼 수 있다.



http://192.168.56.102/dashboard/project/instances/에서 인스턴스를 생성한다.




그리고 실제 네트워크 토폴리지(http://192.168.56.102/dashboard/project/network_topology/)를 살펴본다.








인스턴스를 생성한 다음


floating IP를 설정하고 새로 생성한 






생성한 인스턴스에 floating ip가 만들어진지 확인했다.








참조


http://docs.openstack.org/developer/devstack/

'Cloud' 카테고리의 다른 글

[openstack] ceph DR (disaster recovery)  (0) 2017.10.12
Apache NIFI  (0) 2017.09.12
[openstack] Rally + Tempest  (0) 2017.09.02
[etcd] etcd 설치와 간단 예제  (0) 2017.08.23
fluent-plugin-extract_query_params  (0) 2017.08.23
Posted by '김용환'
,



rsa 키가 아니라 .netrc를 사용하더라도  github의 아이디와 패스워드 없이 접근할 수 있다. 



$ cat .netrc

machine github.com

login x11



암호화되지 않는 형태도 지원한다. 


$ cat .netrc

machine github.com

login daniel

password qwerty




참조 

https://ec.haxx.se/usingcurl-netrc.html

https://gist.github.com/technoweenie/1072829

http://shoken.hatenablog.com/entry/20120629/p1

http://qiita.com/azusanakano/items/8dc1d7e384b00239d4d9

Posted by '김용환'
,





카산드라의 저장 경로는 4 단계로 구성된다.


1. 커밋로그에 데이터를 추가한다.

2. 멤테이블에 데이터를 저장한다.

3. 멤테이블에서 데이터를 플러시한다.

4. 불변 SSTables에 데이터를 저장한다.



카산드라의 저장 경로의 1번째 컴포넌트는 커밋 로그이다. 저장이 추가되는 추가 전용 로그 구조이다. 커밋로그는 특정 크기로 사전 할당 된 다양한 세그먼트 파일로 설정된다. 세그먼트 파일이 가득 차면 저장이 다음 세그먼트에 저장된다. 세그먼트 내의 모든 저장이 각각의 멤테이블에서 플러시될 때, 세그먼트의 이름이 바뀌고 재활용된다. 재활용된 세그먼트를 다시 사용할 준비가 되었다. 시스템 재시작할 때 모든 멤테이블은 지워진다.


커밋로그 세그먼트가 리플레이된 다음 멤테이블이 디스크에 플러시된다. 그 다음에 커밋로그 세그먼트는 재사용을 위해 재활용된다. 이는 시스템 장애이 발생할 때에 내구성을 제공한다. 키스페이스를 생성할 때 영구 저장을 false로 설정하여 커밋로그 기능을 비활성화할 수 있지만. 성능이 저하될 수 있어서 권장하지 않는다.


커밋 로그에 데이터를 추가하는 것 외에도 카산드라는 멤테이블이라 불리는 인메모리 구조에 데이터를 저장한다. 멤테이블이 특정 임계 값 크기에 도달하면 디스크에 플러시된다. 일부 멤테이블 관련 설정 매개 변수를 조정할 수 있다. 멤테이블 할당 타입을 지정해 힙(heap) 또는 오프-힙(off-heap) 메모리를 사용할 수 있다. 멤테이블에 할당될 힙 또는 오프-힙 메모리 크기를 지정할 수 있다. 


멤테이블 플러시는 멘테이블의 전체 크기 값과 클린업(cleanup) 임계 값을 기반으로 일어난다. 커밋로그 크기를 설정 매개 변수로 지정할 수도 있다. 멤테이블 플러시는 커밋 로그 크기를 기반으로 발생한다. 기본적으로 플러시는 이전에 설명한 대로 설정 가능한 특정 임계 값을 기반으로 자동으로 발생한다. 그러나 nodetool 유틸리티를 사용해 수동으로 플러시를 동작시킬 수도 있다.


플러시 임계 값에 도달하면 멤테이블은 SSTables(Sorted String Tables)라는 불변 파일에 플러시된다. 멤테이블은 토큰 값으로 정렬되고 순차적으로 디스크에 저장된다. SSTable은 변경 불가능하기 때문에 동일한 파티션 키에 변경이 일어나면 특정 레코드는 여러 SSTable에 분산될 수 있다. 카산드라는 SSTable로 플러시할 때 파티션 인덱스, 파티션 요약, 블룸 필터와 같은 여러 구조를 생성한다. 해당 구조는 읽기 속도를 높이고 디스크 검색을 줄이는 데 도움을 준다.




멤테이블의 플러시 전략은  https://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsMemtableThruput.html 에 소개되어 있다.  멤테이블의 전체 크기 값은  (https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__commitlog_total_space_in_mb) 과 클린업 임계 값(https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__memtable_cleanup_threshold)을 기반으로 한다.

commitlog_total_space_in_mb 
(Default: 32MB for 32-bit JVMs, 8192MB for 64-bit JVMs)note Total space used for commit logs. If the total space used by all commit logs goes above this value, Cassandra rounds up to the next nearest segment multiple and flushes memtables to disk for the oldest commitlog segments, removing those log segments from the commit log. This reduces the amount of data to replay on start-up, and prevents infrequently-updated tables from keeping commitlog segments indefinitely. If thecommitlog_total_space_in_mb is small, the result is more flush activity on less-active tables.

Related information: Configuring memtable thresholds



memtable_cleanup_threshold 
(Default: 1/(memtable_flush_writers + 1))note. Ratio used for automatic memtable flush. Cassandra adds memtable_heap_space_in_mb to memtable_offheap_space_in_mb and multiplies the total bymemtable_cleanup_threshold to get a space amount in MB. When the total amount of memory used by all non-flushing memtables exceeds this amount, Cassandra flushes the largest memtable to disk.

For example, consider a node where the total of memtable_heap_space_in_mb andmemtable_offheap_space_in_mb is 1000, and memtable_cleanup_threshold is 0.50. The memtable_cleanup amount is 500MB. This node has two memtables: Memtable A (150MB) and Memtable B (350MB). When either memtable increases, the total space they use exceeds 500MB and Cassandra flushes the Memtable B to disk.

A larger value for memtable_cleanup_threshold means larger flushes, less frequent flushes and potentially less compaction activity, but also less concurrent flush activity, which can make it difficult to keep your disks saturated under heavy write load.

This section documents the formula used to calculate the ratio based on the number of memtable_flush_writers. The default value in cassandra.yaml is 0.11, which works if the node has many disks or if you set the node's memtable_flush_writers to 8. As another example, if the node uses a single SSD, the value for memttable_cleanup_threshold computes to 0.33, based on the minimum memtable_flush_writers value of 2.


Posted by '김용환'
,



오픈스택의 Rally + Tempest 는 성능 테스팅 툴이다.




https://www.slideshare.net/sliderakrup/rally-baa-s-os-meetup-31864829


Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul. from Rahul Krishna Upadhyaya




실행 방법


https://www.rdoproject.org/blog/2016/10/how-to-run-rally-on-packstack/




Posted by '김용환'
,



백업용으로 git에 큰 파일(압축 파일)을 올릴 때 git 관리자의 정책으로 인해 업로드 실패가 발생할 수 있다. 


용량을 50m 단위로 줄여서 압축하려면 -s 옵션을 추가한다. 기본 값은 m이고, 나머지는 g, k 이렇게 사용하면 된다.


$ zip -r -s 50 launch.zip launch/  --out launch-sp



Posted by '김용환'
,

[git] git reset hard

etc tools 2017. 9. 1. 19:15


잘못 commit을 했지만 git 서버의 커밋된 버전을 이동하려면 다음과 같은 명령을 사용할 수 있다. 


먼저 로그 내용과 short hash 내용을 얻는다. 


$ git log --pretty=oneline --abbrev-commit

ab2cb94 XXFactoryBean 생성

12312414 ...




특정 commit으로 이동하려면 다음과 같이 사용할 수 있다.


git reset --hard ab2cb94




뒤 커밋으로 하나 이동하려면 다음 커맨드를 사용한다.


git reset --hard HEAD



3번째 뒤 커밋으로 이동하려면 다음 커맨드를 사용한다.


git reset --hard HEAD~3


git reset --hard HEAD^^^





Posted by '김용환'
,

go 컨퍼런스 자료

go lang 2017. 9. 1. 14:14



2017년 go 컨퍼런스 자료


https://github.com/gophercon



gophercon 2017 자료



https://github.com/gophercon/2017-talks

Posted by '김용환'
,