mysql 에서 mariadb 로 바꾼뒤 신규설치는 모두 mariadb 를 사용하고 있다.

내부 호스팅용으로 서버를 구축하는데, mariadb 를 설치하려 한다.

https://downloads.mariadb.org/mariadb/repositories/#mirror=kaist

를 사용.

기존에 하던 방식대로 하는데, 이번에는 뭔가 이상하다.

# apt-get install mariadb-server
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다      
상태 정보를 읽는 중입니다... 완료
몇몇 패키지를 설치할 수 없습니다. 요청한 상황이 불가능할 수도 있고,
불안정 배포판을 사용해서 일부 필요한 패키지를 아직 만들지 않았거나,
아직 Incoming에서 나오지 않은 경우일 수도 있습니다.
이 상황을 해결하는데 다음 정보가 도움이 될 수도 있습니다:

다음 패키지의 의존성이 맞지 않습니다:
 mariadb-server : 의존: mariadb-server-5.5 (= 5.5.42+maria-1~trusty) 하지만 %s 패키지를 설치하지 않을 것입니다
E: 문제를 바로잡을 수 없습니다. 망가진 고정 패키지가 있습니다.

이런식의 에러가 난다.

# apt-cache policy mariadb-server-5.5
mariadb-server-5.5:
  설치: (없음)
  후보: 5.5.42+maria-1~trusty
  버전 테이블:
     5.5.42+maria-1~trusty 0
        500 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ trusty/main amd64 Packages
     5.5.41-1ubuntu0.14.04.1 0
        500 http://ftp.daumkakao.com/ubuntu/ trusty-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
     5.5.36-1 0
        500 http://ftp.daumkakao.com/ubuntu/ trusty/universe amd64 Packages

기본 패키지와 충돌이 나는 것일까?

그냥 5.5.36 으로 설치하면 괜찮을까?


기본 패키지로 깔아보니 잘 된다. 버전은 다음과 같다.

mysql  Ver 15.1 Distrib 5.5.41-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2



반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

우분투의 기본설정으로 모니터 자동끄기를 사용하고 있었다.

그런데, 어떤 이유인지 모니터를 2개연결하니 작동이 이상해졌다.

그래서 그냥 스크립트로 만들었다.(외국의 스크립트를 내 입맛에 맞게 부분 변경함)


시스템설정 > 키보드 > 단축키 에서 사용자 설정으로 다음 실행파일을 실행시키는 방법으로 한다.

#!/bin/bash
screenOffLockFile=/tmp/screen-off-lock
systemLockFile=/tmp/system-lock

if [ -f $screenOffLockFile ];
then
        rm $screenOffLockFile
        rm $systemLockFile
        notify-send "Screen on." -i /usr/share/icons/gnome/48x48/devices/display.png
else
        touch $screenOffLockFile
        sleep .5
        notify-send "Screen off now." -i /usr/share/icons/gnome/48x48/devices/display.png
        touch $systemLockFile
        sleep 1
        gnome-screensaver-command -l
        while [ -f  $screenOffLockFile ]
        do
                xset dpms force off
                if [ -f $systemLockFile ];
                then
                        sleep 30
                else
                        sleep 10
                fi
        done
        xset dpms force on
fi

난 안쓰는 Pause / Break 키를 단축키로 매핑시켰다. (본인 취향에 따라 )


gnome-screensaver-command -l  => 이 부분은 모니터를 끄면서 잠금모드로 변경하도록 했다.

30초단위로 모니터가 꺼진다.(시간단위도 본인에 맞게 조정)

계속 꺼지게 되므로 켜짐모드로 하려면 단축키를 다시 눌러준다.



반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

vagrant cloud 를 사용하려고 한다.( 기존 http://www.vagrantbox.es 를 사용하고 있었다.)

vagrantbox 에는 그리 많지 않아서 vagrant cloud (https://vagrantcloud.com) 를 사용하려 한다.


vagrant cloud 를 사용하려면 1.5 버전 이상에서 사용가능한 듯 하다.

우분투 14.04 기본패키지는 1.4.3 버전이다.( 다음처럼 에러가 난다.)

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The box 'hfm4/centos7' could not be found.



# 최신 버전으로 업그레이드 한다.

우분투 패키지를 다운받아서 설치했다.( http://www.vagrantup.com/downloads.html )

deb 파일이라 다운로드 하면 자동으로 우분투소프트웨어센터로 설치된다.

업그레이드 하면 된다.

버전을 확인해본다.

$ vagrant -v
Vagrant 1.6.3


vagrant cloud 에서 이미지를 찾아서 설치/가동 해본다.

가입은 쉽다. 가입후 에 Discover 메뉴에서 찾고자 하는 box 를 검색해본다.(가입안해도 될려나?)
그냥 box init 용도로만 사용하려면 가입은 안해도 되나보다.


원하는 box 를 찾았으면 vagrant init  명령을 내린다.

vagrant init hfm4/centos7

위 명령을 하면 Vagrantfile 이 생긴다.
이 파일을 기준으로 vagrant up 시 이미지등을 생성하고, 자동실행하게 된다.


# vagrant up

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hfm4/centos7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'hfm4/centos7'
    default: URL: https://vagrantcloud.com/hfm4/centos7
==> default: Adding box 'hfm4/centos7' (v1.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/hfm4/centos7/version/1/provider/virtualbox.box
    default: Progress: 10% (Rate: 1239k/s, Estimated time remaining: 0:09:02)

위와 같이 진행이 된다.


위와 같이 진행하다가 다음과 같은 에러가 나온다.

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant


다음처럼 guest plugin 을 설치한다.

$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0)'!

정상적으로 되면

vagrant ssh

로 접속해본다. vagrant 속에서 다음 명령을 해준다.

sudo ln -s /opt/VBoxGuestAdditions-4.3.12/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

4.3.12 => 버전은 차이가 있을 것이다.

뭔가 계속 에러가 난다. box 패키징이 잘 못된것인가?


다른 박스로 해봤다.( https://vagrantcloud.com/chef/centos-6.5 )

다른 박스로 해보니 정상적이다.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'chef/centos-6.5' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
GuestAdditions 4.3.12 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /user/develop/vagrant/chef-centos-6.5
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.


vagrant cloud 쪽의 box 들이 모두 검증된 것은 아닌것 같다.
각자 취사 선택해서 사용해야 겠다.




반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

ubuntu 14.04 의 byobu (screen) 가 ctrl-a 이 안 먹는다.

byobu 를 실행시키고 ctrl-a 를 눌렀을때

다음처럼 화면이 나올때 1/2 아무거나 입력해도 안되고 같은 화면만 나오는 문제가 있다.

직접 콘솔상에서 byobu-ctrl-a 를 해보면.

$ byobu-ctrl-a
failed to connect to server

Configure Byobu's ctrl-a behavior...

When you press ctrl-a in Byobu, do you want it to operate in:
    (1) Screen mode (GNU Screen's default escape sequence)
    (2) Emacs mode  (go to beginning of line)

Note that:
  - F12 also operates as an escape in Byobu
  - You can press F9 and choose your escape character
  - You can run 'byobu-ctrl-a' at any time to change your selection

Select [1 or 2]: 1

/usr/bin/byobu-ctrl-a: 151: /usr/bin/byobu-ctrl-a: Syntax error: Unterminated quoted string


위처럼 에러가 발생한다.

직접 byobu-ctrl-a 를 수정한다.

115                 case "$BYOBU_BACKEND" in
116                         screen)
117                                 $BYOBU_SED -i -e "/^register x /d" -e "/^bindkey \"^\"/d" -e "/^escape /d" "$keybindings"
118                                 echo "escape \"^${KEY}${key}\"" >> "$keybindings"
119                                 echo "register x \"^${KEY}\"" >> "$keybindings"
120                                 echo "bindkey \"^${KEY}\" >> "$keybindings"
121                                 $BYOBU_BACKEND -X at 0 source "$BYOBU_CONFIG_DIR/profile"
122                         ;;

120 라인부분을 보면  " => 가 빠져있다.

120                                 echo "bindkey \"^${KEY}\" >> "$keybindings"

120                                 echo "bindkey \"^${KEY}\"" >> "$keybindings"


수정 후 저장하고 다시 해보면 정상동작한다.

저 스크립트는 최종적으로. .byobu/keybindings.tmux 파일에 설정이 저장된다.

$ cat .byobu/keybindings.tmux
unbind-key -n C-a
set -g prefix ^A
set -g prefix2 ^A
bind a send-prefix

에러가 나서 계속 같은 화면이 나왔던 것이다.





반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

docker 를 설치해본다.

우분투 14.04 에서는 간편하다. 이미 우분투 공식패키지로 등록이 되어 있다.

apt-get install docker.io


그러나 공식패키지는 버전업이 느리다.

# docker.io --version

Docker version 0.9.1, build 3600720


빠르게 버전업하는 패키지는 공식사이트의 배포버전을 사용하면 좋다.

echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list

apt-get update

apt-get install lxc-docker

한번에 끝내기

curl -s https://get.docker.io/ubuntu/ | sudo sh

위 스크립트를 받아서 실행하는 방법이다.

Docker version 1.0.1, build 990021a

최신버전으로 설치된다.


간단한 테스트.

# docker run ubuntu:14.04 /bin/echo 'Hello World'

다음과 같은 명령을 내리면.. 로컬이미지를 찾고,
없으면 저장소에서 찾아서 설치한 후 echo 'Hello World' 를 실행하게 된다.

Unable to find image 'ubuntu:14.04' locally
Pulling repository ubuntu
e54ca5efa2e9: Download complete
511136ea3c5a: Download complete
d7ac5e4f1812: Download complete
2f4b4d6a4a06: Download complete
83ff768040a0: Download complete
6c37f792ddac: Download complete
Hello World


하위 버전은 다음을 참조.

http://docs.docker.io.s3-website-us-west-2.amazonaws.com/installation/ubuntulinux/



반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,