2015년 2월 24일 화요일

Ubuntu 에서 데몬 관리

RedHat 계열은 ntsysv

Ubuntu 는 rcconf 설치해서

$ sudo apt-get install rcconf

devstack 및 trove 설치하기

1. physical machine or VM 에 ubuntu 12.04 or 14.04 가 설치 되어있다고 가정함

2. Ubuntu upgrade
최신 패키지로 업그레이드함
필요시 재부팅

sudo apt-get update

sudo apt-get upgrade

sudo shutdown -ry 0

3. proxy 환경 설정
사내 등에서 proxy 서버가 있는 환경인 경우 proxy 인증서(xxx.crt) 를 다운받아서 아래 위치에 복사함
/usr/share/ca-certificates/extra/xxx.crt
인증서 복사 후 아래 명령어로 인증서를 시스템에 등록함
sudo dpkg-reconfigure ca-certificates (yes, xxx.crt 선택)

Proxy 세팅을 위해 /etc/environment 파일에 아래 내용을 추가합니다. Virtual box 는 10.0.0.0/8 subnet 을
기본으로 사용함

ubuntu@ubuntu:~$ sudo vi /etc/environment
...
http_proxy="http://a.b.c.d:8080/"
https_proxy="https://a.b.c.d:8080/"
no_proxy="localhost,127.0.0.1,127.0.0.0/8,127.0.1.1,10.0.0.0/8"

4. devstack 설치

4.1 git, pip 설치/설정
Python Package 관리 도구인 PIP 와 형상관리도구 Git 을 설치합니다.

ubuntu@ubuntu:~$ sudo apt-get install git python-pip
ubuntu@ubuntu:~$ sudo vi ~/.pip/pip.conf

[global]
cert = /usr/share/ca-certificates/extra/xxx.crt

4.2 devstack download
$ git clone http://github.com/openstack-dev/devstack
$ cd ~/devstack
$ git checkout stable/juno

4.3 local.conf 편집

[[local|localrc]]

# Credentials
DATABASE_PASSWORD=openstack
ADMIN_PASSWORD=openstack
SERVICE_PASSWORD=openstack
SERVICE_TOKEN=openstack
RABBIT_PASSWORD=openstack

# Services
ENABLED_SERVICES=rabbit,mysql,key
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
#ENABLED_SERVICES+=,n-net
#ENABLED_SERVICES+=,neutron,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
#ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
ENABLED_SERVICES+=,g-api,g-reg
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
#ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
#ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
ENABLED_SERVICES+=,horizon

# Images
# Use this image when creating test instances
IMAGE_URLS+=",http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img"
# Use this image when working with Orchestration (Heat)
#IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2"

# Branches
KEYSTONE_BRANCH=master
NOVA_BRANCH=master
NEUTRON_BRANCH=master
SWIFT_BRANCH=master
GLANCE_BRANCH=master
CINDER_BRANCH=master
HEAT_BRANCH=master
TROVE_BRANCH=master
HORIZON_BRANCH=master

# Swift Configuration
SWIFT_REPLICAS=1
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5

# Enable Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs

4.4 stack.sh 실행
ubuntu@ubuntu:~/devstack$ ./stack.sh

screen -x stack 을 통해 각 데몬들이 정상인지 확인
웹브라우저를 통해 Horizon 에 접속해서 테스트 가능

5. Troubleshooting
5.1 아래 에러 나는 경우
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip in /usr/local/lib/python2.7/dist-packages

pip.conf 파일에 아래 라인 추가/변경
index-url = http://pypi.gocept.com/simple/

5.2 아래 에러
No such file or directory: '/usr/lib/python2.7/dist-packages/setuptools.egg-info'

-> 아래 링크 참조해서 다음과 같이 조치
http://stackoverflow.com/questions/28441674/error-while-installing-icehouse-openstack-using-devstack

sudo rm /usr/lib/python2.7/dist-packages/setuptools.egg-info sudo apt-get install --reinstall python-setuptools






2015년 2월 16일 월요일

windows curl 에서 no proxy 하는 법

windows 환경에서 curl 을 사용하는데, 사내 proxy 안 거치고 바로 접속해야 하는 경우, 예를 들어 local VM 등

_curlrc 파일에 아래와 같은 라인 추가
noproxy=192.168.21.140

2015년 2월 13일 금요일

Debugging OpenStack Nova(Juno) on Ubuntu 12.04 LTS

아래 에러 발생
kwholee@ubuntu:/opt/stack/nova$ ./run_tests.sh
Running `tools/with_venv.sh python -m nova.openstack.common.lockutils python setup.py testr --testr-args='--subunit --concurrency 0 '`
/opt/stack/nova/.venv/bin/python: No module named six
Traceback (most recent call last):
File "tools/colorizer.py", line 44, in <module>
import subunit
ImportError: No module named subunit
cat: .testrepository/next-stream: No such file or directory
다시 처음부터 아래와 같이
아래 링크 참고
http://git.openstack.org/cgit/openstack/nova/tree/doc/source/devref/development.environment.rst
  sudo apt-get install python-dev libssl-dev python-pip git-core libxml2-dev libxslt-dev pkg-config libffi-dev libpq-dev libmysqlclient-dev libvirt-dev graphviz libsqlite3-dev
python tools/install_venv.py
-> 아래 에러 발생
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: ordinal not in range(128)
sudo apt-get build-dep python-mysqldb
sudo apt-get install python-software-properties
sudo add-apt-repository cloud-archive:juno
sudo apt-get install libvirt-dev

-> ubuntu 14.04 LTS 에서 Juno 을 설치하면 왠지 해결 될 것 같음
* run_test.sh 했더니 아래 에러 발생
아래 에러 발생
kwholee@ubuntu:/opt/stack/nova$ ./run_tests.sh
Running `tools/with_venv.sh python -m nova.openstack.common.lockutils python setup.py testr --testr-args='--subunit --concurrency 0 '`
/opt/stack/nova/.venv/bin/python: No module named six
Traceback (most recent call last):
File "tools/colorizer.py", line 44, in <module>
import subunit
ImportError: No module named subunit
cat: .testrepository/next-stream: No such file or directory
다시 처음부터 아래와 같이
아래 링크 참고
http://git.openstack.org/cgit/openstack/nova/tree/doc/source/devref/development.environment.rst
  sudo apt-get install python-dev libssl-dev python-pip git-core libxml2-dev libxslt-dev pkg-config libffi-dev libpq-dev libmysqlclient-dev libvirt-dev graphviz libsqlite3-dev
python tools/install_venv.py
-> 아래 에러 발생
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: ordinal not in range(128)
sudo apt-get build-dep python-mysqldb
sudo apt-get install python-software-properties
sudo add-apt-repository cloud-archive:juno
sudo apt-get install libvirt-dev

-> ubuntu 14.04 LTS 에서 Juno 을 설치하면 왠지 해결 될 것 같음
* run_tests.sh 했더니 아래 에러 발생
-> neutron 사용하는 옵션으로 devstack 설치하면 해결될 것 같음
======================================================================
FAIL: nova.tests.network.test_neutronv2.TestNeutronv2.test_get_port_vnic_info_3
----------------------------------------------------------------------
Traceback (most recent call last):
_StringException: Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/network/test_neutronv2.py", line 2615, in test_get_port_vnic_info_3
self._test_get_port_vnic_info()
File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "/opt/stack/nova/nova/tests/network/test_neutronv2.py", line 2607, in _test_get_port_vnic_info
fields=['binding:vnic_type', 'network_id'])
File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/mock.py", line 845, in assert_called_once_with
raise AssertionError(msg)
AssertionError: Expected to be called once. Called 2 times.
Traceback (most recent call last):
_StringException: Empty attachments:
pythonlogging:''
stderr
stdout
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/network/test_neutronv2.py", line 2615, in test_get_port_vnic_info_3
self._test_get_port_vnic_info()
File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "/opt/stack/nova/nova/tests/network/test_neutronv2.py", line 2607, in _test_get_port_vnic_info
fields=['binding:vnic_type', 'network_id'])
File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/mock.py", line 845, in assert_called_once_with
raise AssertionError(msg)
AssertionError: Expected to be called once. Called 2 times.
Traceback (most recent call last):
_StringException: Empty attachments:
pythonlogging:''
stderr
stdout
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/network/test_neutronv2.py", line 2615, in test_get_port_vnic_info_3
self._test_get_port_vnic_info()
File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "/opt/stack/nova/nova/tests/network/test_neutronv2.py", line 2607, in _test_get_port_vnic_info
fields=['binding:vnic_type', 'network_id'])
File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/mock.py", line 845, in assert_called_once_with
raise AssertionError(msg)
AssertionError: Expected to be called once. Called 2 times.
======================================================================
FAIL: nova.tests.test_wsgi.TestWSGIServerWithSSL.test_app_using_ipv6_and_ssl
----------------------------------------------------------------------
Traceback (most recent call last):
_StringException: pythonlogging:'': {{{
2014-11-30 23:13:57,234 INFO [nova.wsgi] fake_ssl listening on ::1:38386
2014-11-30 23:13:57,280 INFO [nova.fake_ssl.wsgi.server] (7689) wsgi starting up on https://::1:38386/
}}}
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/test_wsgi.py", line 259, in test_app_using_ipv6_and_ssl
response = urllib2.urlopen('https://[::1]:%d/' % server.port)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError:
Traceback (most recent call last):
_StringException: Empty attachments:
stderr
stdout
pythonlogging:'': {{{
2014-11-30 23:13:57,234 INFO [nova.wsgi] fake_ssl listening on ::1:38386
2014-11-30 23:13:57,280 INFO [nova.fake_ssl.wsgi.server] (7689) wsgi starting up on https://::1:38386/
}}}
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/test_wsgi.py", line 259, in test_app_using_ipv6_and_ssl
response = urllib2.urlopen('https://[::1]:%d/' % server.port)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError:
Traceback (most recent call last):
_StringException: Empty attachments:
stderr
stdout
pythonlogging:'': {{{
2014-11-30 23:13:57,234 INFO [nova.wsgi] fake_ssl listening on ::1:38386
2014-11-30 23:13:57,280 INFO [nova.fake_ssl.wsgi.server] (7689) wsgi starting up on https://::1:38386/
}}}
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/test_wsgi.py", line 259, in test_app_using_ipv6_and_ssl
response = urllib2.urlopen('https://[::1]:%d/' % server.port)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError:
Ran 12641 tests in 3539.590s
FAILED (failures=2)
* neutron enable devstack 설치해도 아래와 같은 에러 발생
======================================================================
FAIL: nova.tests.test_wsgi.TestWSGIServerWithSSL.test_app_using_ipv6_and_ssl
----------------------------------------------------------------------
Traceback (most recent call last):
_StringException: pythonlogging:'': {{{
2014-12-01 03:30:53,176 INFO [nova.wsgi] fake_ssl listening on ::1:50641
2014-12-01 03:30:53,227 INFO [nova.fake_ssl.wsgi.server] (35022) wsgi starting up on https://::1:50641/
}}}
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/test_wsgi.py", line 259, in test_app_using_ipv6_and_ssl
response = urllib2.urlopen('https://[::1]:%d/' % server.port)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError:
Traceback (most recent call last):
_StringException: Empty attachments:
stderr
stdout
pythonlogging:'': {{{
2014-12-01 03:30:53,176 INFO [nova.wsgi] fake_ssl listening on ::1:50641
2014-12-01 03:30:53,227 INFO [nova.fake_ssl.wsgi.server] (35022) wsgi starting up on https://::1:50641/
}}}
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/test_wsgi.py", line 259, in test_app_using_ipv6_and_ssl
response = urllib2.urlopen('https://[::1]:%d/' % server.port)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError:
Traceback (most recent call last):
_StringException: Empty attachments:
stderr
stdout
pythonlogging:'': {{{
2014-12-01 03:30:53,176 INFO [nova.wsgi] fake_ssl listening on ::1:50641
2014-12-01 03:30:53,227 INFO [nova.fake_ssl.wsgi.server] (35022) wsgi starting up on https://::1:50641/
}}}
Traceback (most recent call last):
File "/opt/stack/nova/nova/tests/test_wsgi.py", line 259, in test_app_using_ipv6_and_ssl
response = urllib2.urlopen('https://[::1]:%d/' % server.port)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError:
Ran 12643 tests in 3752.841s
FAILED (failures=1)
----------------------------------------------------------------------
* 14.04 에서 devstack juno 버전으로 아래 에러 발생

VMware 에 CoreOS 설치하기

아래 링크 참고
https://github.com/marineam/coreos-docs/blob/master/vmware/index.md

wget http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_vmware_insecure.zip
unzip coreos_production_vmware_insecure.zip
cd coreos_production_vmware_insecure
open coreos_production_vmware_insecure.vmx

14.04 에서 nova run_tests.sh 성공한 경우

nova.tests.volume.encryptors.test_nop.NoOpEncryptorTestCase
test_detach_volume OK 0.13
nova.tests.volume.test_cinder.CinderApiTestCase
test_begin_detaching OK 0.01
test_check_attach OK 0.03
test_check_attach_availability_zone_differs OK 0.01
test_check_attach_volume_status_error OK 0.01
test_check_detach OK 0.01
test_create_failed OK 0.01
test_create_force OK 0.01
test_create_over_quota_failed OK 0.01
test_create_snapshot OK 0.01
test_delete_snapshot OK 0.01
test_delete_volume_metadata OK 0.01
test_get_all OK 0.01
test_get_all_snapshots OK 0.01
test_get_failed OK 0.01
test_get_snapshot_failed OK 0.01
test_get_volume_metadata OK 0.02
test_get_volume_metadata_value OK 0.02
test_terminate_connection OK 0.01
test_update OK 0.01
test_update_snapshot_status OK 0.01
test_update_volume_metadata_delete OK 0.01
nova.tests.volume.encryptors.test_luks.LuksEncryptorTestCase
test__close_volume OK 0.12
test__open_volume OK 0.10
Slowest 10 tests took 322.69 secs:
nova.tests.integrated.test_servers.ServersTestV3
test_create_multiple_servers 21.93
nova.tests.integrated.v3.test_multiple_create.MultipleCreateJsonTest
test_multiple_create 23.64
test_multiple_create_without_reservation_id 23.10
nova.tests.integrated.v3.test_server_metadata.ServersMetadataJsonTest
test_metadata_delete 21.41
nova.tests.integrated.v3.test_servers.ServersActionsJsonTest
test_server_confirm_resize 24.37
test_server_rebuild 29.47
test_server_resize 21.64
nova.tests.integrated.v3.test_servers.ServersSampleJsonTest
test_servers_post 66.88
nova.tests.integrated.v3.test_servers_ips.ServersIpsJsonTest
test_get_by_network 65.46
nova.tests.integrated.v3.test_shelve.ShelveJsonTest
test_unshelve 24.81
Ran 12659 tests in 6059.529s
OK
Running flake8 …
kwholee@ubuntu14:/opt/stack/nova$

devstack local.conf sample

[[local|localrc]]
# Credentials
DATABASE_PASSWORD=openstack
ADMIN_PASSWORD=openstack
SERVICE_PASSWORD=openstack
SERVICE_TOKEN=openstack
RABBIT_PASSWORD=openstack
# Services
ENABLED_SERVICES=rabbit,mysql,key
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
ENABLED_SERVICES+=,n-net
#ENABLED_SERVICES+=,neutron,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
#ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
ENABLED_SERVICES+=,g-api,g-reg
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
#ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
#ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
ENABLED_SERVICES+=,horizon
# Images
# Use this image when creating test instances
IMAGE_URLS+=",http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img"
# Use this image when working with Orchestration (Heat)
#IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2"
# Branches
KEYSTONE_BRANCH=stable/juno
NOVA_BRANCH=stable/juno
NEUTRON_BRANCH=stable/juno
SWIFT_BRANCH=stable/juno
GLANCE_BRANCH=stable/juno
CINDER_BRANCH=stable/juno
HEAT_BRANCH=stable/juno
TROVE_BRANCH=stable/juno
HORIZON_BRANCH=stable/juno
# Swift Configuration
SWIFT_REPLICAS=1
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
# Enable Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs

sample vimrc

execute pathogen#infect()
syntax on " ... Syntax. .. ..... ...
set nocompatible " VI ..... .... ... .... ..(VIM..)
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" " required!
Bundle 'gmarik/vundle'
" " My bundles here:
Bundle 'davidhalter/jedi-vim'
filetype plugin indent on " 파일 종류에 따른 구문강조
set autoindent " 자동 들여쓰기
set cindent " C 프로그래밍용 자동 들여쓰기
set smartindent " 스마트한 들여쓰기
set bs=2
set tabstop=4 " .... 4.. ... ....
set shiftwidth=4 " .... ... .... . 4... ..
set visualbell " Alert .. .. ..... ......
set laststatus=2 " .... 2. ....
set statusline=%h%F%m%r%=[%l:%c(%p%%)] " ..... ...
set hlsearch " / ? .. ... .. .... ..... ....
set background=dark
colorscheme solarized
set backspace=eol,start,indent " 줄의 끝, 시작, 들여쓰기에서 백스페이스시 이전줄로
"set noexpandtab
set expandtab
set tags=./tags,./TAGS,tags,TAGS,/usr/share/pyshared/nova/tags
set tags+=/usr/lib/python2.7/dist-packages/tags
set tags+=/usr/lib/python2.7/tags
set nu
let Tlist_Ctags_Cmd="/usr/bin/ctags"
let Tlist_inc_Winwidth=0
let Tlist_Exit_OnlyWindow=1
let Tlist_Display_Tag_Scope = 1
let Tlist_Display_Prototype = 1
let Tlist_Use_Right_Window = 1
let Tlist_Sort_Type = "name"
let Tlist_WinWidth = 60
map :Tlist
nnoremap
nnoremap

VM 에 리눅스 설치 후 putty 접속 환경 설정

vi /etc/network/interfaces
: 고정 IP 로 수정
auto eth0
iface eth0 inet static
address 192.168.21.140
netmask 255.255.255.0
gateway 192.168.21.2
dns-nameservers 168.126.63.1
vi /etc/sudoers
user1    ALL=(ALL)   NOPASSWD: ALL
: root 권한 부여 등 수정
sudo sed -i s/kr.archive.ubuntu.com/ftp.jaist.ac.jp/g /etc/apt/sources.list
또는
sudo sed -i s/us.archive.ubuntu.com/ftp.jaist.ac.jp/g /etc/apt/sources.list
* 프락시 환경인 경우 설정
: xxx.crt 같은 인증서 파일을 아래 위치에 업로드
/usr/share/ca-certificates/extra/sds.crt
sudo dpkg-reconfigure ca-certificates (yes, xxx.crt 선택)
/etc/environment 편집
ubuntu@ubuntu:~$ sudo vi /etc/environment
...
http_proxy="http://70.10.15.10:8080/"
https_proxy="https://70.10.15.10:8080/"
no_proxy="localhost,127.0.0.1,127.0.0.0/8,127.0.1.1,10.0.0.0/8"
namaserver 수정
vi /etc/resolve.conf

네트워크 재시작

sudo service networking restart
Ubuntu Upgrade
최신 패키지로 업그레이드 합니다. 필요시 재부팅합니다.
ubuntu@ubuntu:~$ sudo apt-get update
ubuntu@ubuntu:~$ sudo apt-get upgrade
ubuntu@ubuntu:~$ sudo shutdown -ry 0
ssh server 설치:
sudo apt-get install openssh-server
sudo apt-get install vim
sudo apt-get install curl wget
sudo apt-get install git python-pip
(sudo apt-get update 해서 cannot initiate 같은 에러 나는 경우 sudo -E apt-get upate  를 한다.
또는 /etc/apt/apt.conf 파일에 아래 내용 기입
Acquire::http::proxy "http://somecorpdom:8080/";
Acquire::https::proxy "https://somecorpdom:8080/";
)
ubuntu@ubuntu:~$ sudo vi ~/.pip/pip.conf
[global]
cert = /usr/share/ca-certificates/extra/xxx.crt
* devstack download
ubuntu@ubuntu:~$ git clone http://github.com/openstack-dev/devstack
ubuntu@ubuntu:~$ cd ~/devstack
ubuntu@ubuntu:~/devstack$ git checkout stable/juno

Install PyCharm and JDK on Ubuntu 12.04

  • Download the sun jdk 8 tar file from here
  • Extract the tar file:
    $ tar -xvzf jdk1.8.0_25.tar.gz
  • Move extracted folder to this location:
    $ sudo mv jdk1.8.0_25 /usr/lib/jvm/
    • Install new java source in system: 
    $ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_25/bin/javac 1 
    $ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_25/bin/java 1 
    $ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0_25/bin/javaws 1
    • Choose default java:
    $ sudo update-alternatives --config javac 
    $ sudo update-alternatives --config java 
    $ sudo update-alternatives --config javaws
    • java version test:
    $ java -version
    • Verify the symlinks all point to the new java location:
    $ ls -la /etc/alternatives/java*
    • Enable Java plugin for Mozilla Firefox (even for Chrome)
    #for 64-Bit jdk 
    $ sudo ln -s /usr/lib/jvm/jdk1.8.0_25/jre/\
    lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins 
    #for 32-Bit jdk 
    $ sudo ln -s /usr/lib/jvm/jdk1.7.0_04/jre/\
    lib/i386/libnpjp2.so /usr/lib/mozilla/plugins
    • JAVA_HOME configuration:
    Some tools require JAVA_HOME variable. You can set JAVA_HOME in Ubuntu so simple: Edit the file .bashrc under your home directory and add the following lines: (if .bashrc is hidden click in Nautilus Menu View > Show Hidden Files)
    export JAVA_HOME=/path/your/jdk 
    export PATH=$JAVA_HOME/bin:$PATH
    
    Install pycharm on ubuntu 12.04:
    
    $ tar -xvzf pycharm-2.6.2.tar.gz 
    $ cd /pycharm-2.6.2/bin/ 
    $ ./pycharm.sh &
     

Ubuntu 12.04 Server 에 최소 GUI 설치

sudo apt-get update

sudo apt-get upgrade

아래와 같이 하면, ubuntu-desktop 패키지 설치시에 쓸데 없는 패키지(OpenOffice 등)들을 제외하고 꼭필요한 것만 깐다

sudo apt-get install --no-install-recommends ubuntu-desktop

windows 에서 python 2.x 와 3.x 동시 설치 사용하기

1.  http://www.python.org 에서 2, 3 버전 다운로드

2. python 3.x 설치 후 2.x 설치 (저는 2 설치하고 3 설치했더니 에러나네요)

3. 각 버전 설치하면서 그냥 디폴트로 설치합니다. 특히 python.exe 있는 폴더를 경로에 추가하지 않습니다.

4. 모두 설치하면 py.exe 가 예를 들어 C:\Windows\py.exe 로 있을 겁니다. 이건 3 버전 설치하면 나오는 건데 py --help 라고 치시면 설명 나오지만 python launcher 라고 보시면 됩니다.

py.exe 실행하면 2.x 버전 실행되고, py -3 이라고 하면 3.x 버전 실행됩니다.

참고로 환경변수에 PYTHONPATH  같은 것이 없어야 합니다. 있으면 py -3 등을 할 때 에러 발생할 수 있습니다.

py.exe 가 환경까지 알아서 잘 세팅해주는 것 같습니다.

proxy 환경에서 docker build 하는 경우

회사 내부 등의 이유로 어쩔 수 없이 proxy 를 사용하는 경우 아래 3가지를 해준다
(참고로 필자는 Ubuntu 14.04 사용)

1. /etc/environment 파일에 proxy 정보 추가
    예)  http_proxy="http://a.b.c.d:8080/"
  4 https_proxy="http://a.b.c.d:8080/"
  5 no_proxy="localhost,127.0.0.1,127.0.0.0/8,127.0.1.1,10.0.0.0/8,192.168.0.0/16"

2. /etc/default/docker.io 파일에 proxy 정보 추가
예)
# If you need Docker to use an HTTP proxy, it can also be specified here.
 export http_proxy="http://a.b.c.d:8080/"
 export no_proxy=192.168.21.140

3. Dockerfile 에 proxy 정보 추가
예)
   ENV http_proxy http://a.b.c.d:8080/
   ENV https_proxy http://a.b.c.d:8080/

docker rmi 해서 에러 나는 경우

아래와 같은 에러 나는 경우
$ sudo docker rmi d49a93d17d98
Error response from daemon: Conflict, cannot delete d49a93d17d98 because the container 5ac6d69b4255 is using it, use -f to force
2015/02/13 09:11:22 Error: failed to remove one or more images
$ sudo docker  rmi -f d49a93d17d98
Error response from daemon: No such id: d49a93d17d9855ecb9b5fc19c9d6b1da644f02832c2e7a3f8d30e4c038db2955
2015/02/13 09:11:35 Error: failed to remove one or more images
$ sudo docker  rmi -f d49a93d17d98
Error response from daemon: No such image: d49a93d17d98
2015/02/13 09:11:41 Error: failed to remove one or more images


아래 링크 참고

http://stackoverflow.com/questions/24733160/docker-rmi-cannot-remove-images-with-no-such-id

2015년 2월 12일 목요일

vagrant up 실행시 에러 나는 경우 처리

아래와 같은 에러 나는 경우:

vagrant up
The provider 'virtualbox' that was requested to back the machine
'core-01' is reporting that it isn't usable on this system. The
reason is shown below:

Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.

->

(This PC -> Advanced System Settings -> Environmental Variables -> Search for VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH)

이렇게 바꾸면 된다

Git Client 사용중 curl_multi_timeout 및 libcurl.dll 에러

아래와 같이 한다

본인의 git 설치 환경은 다음과 같다
OS: window 7 64bit

1. C:\Program Files (x86)\Git 에 간다
2. bin\libcurl.dll 을 복사한다
3. libexec\git-core 폴더에 가면 git.exe 가 보이는데, 이 폴더에 paste 한다.