디렉토리 생성

sudo mkdir -p /mnt/rhel6

sudo mkdir -p /mnt/rhel7

sudo mkdir -p /mnt/centos6

sudo mkdir -p /mnt/centos7트


 ISO 이미지 마운트

sudo mount -t iso9660 -o loop /data/_ISO_/rhel-server-6.9-x86_64-dvd.iso /mnt/rhel6

sudo mount -t iso9660 -o loop /data/_ISO_/rhel-server-7.3-x86_64-dvd.iso /mnt/rhel7

sudo mount -t iso9660 -o loop /data/_ISO_/CentOS-6.9-x86_64-bin-DVD1.iso /mnt/centos6

sudo mount -t iso9660 -o loop /data/_ISO_/CentOS-7-x86_64-DVD-1611.iso /mnt/centos7


 httpd 일때 설정

Alias /rhel6 "/mnt/rhel6"

<Directory /mnt/rhel6/>

    Options +Indexes

    AllowOverride none

    Require all granted

</Directory>


Alias /rhel7 "/mnt/rhel7"

<Directory /mnt/rhel7/>

    Options +Indexes

    AllowOverride none

    Require all granted

</Directory>


Alias /centos6 "/mnt/centos6"

<Directory /mnt/centos6/>

    Options +Indexes

    AllowOverride none

    Require all granted

</Directory>


Alias /centos7 "/mnt/centos7"

<Directory /mnt/centos7/>

    Options +Indexes

    AllowOverride none

    Require all granted

</Directory>


NGINX 일때 설정

server {

location /rhel7/ {

            alias   D:/data/yum/rhel7/;

autoindex       on;

allow all;

        }

location /rhel6/ {

            alias   D:/data/yum/rhel6/;

autoindex       on;

allow all;

        }

location /centos6/ {

            alias   D:/data/yum/centos6/;

autoindex       on;

allow all;

        }

location /centos7/ {

            alias   D:/data/yum/centos7/;

autoindex       on;

allow all;

        }

}


yum repo 설정

# /etc/yum.repos.d/local-rhel6.repo

[local-rhel6]

name=local-rhel6

baseurl=http://192.168.56.1/rhel6/Server/

enabled=1

gpgcheck=0


# /etc/yum.repos.d/local-rhel7.repo

[local-rhel7]

name=local-rhel7

baseurl=http://192.168.56.1/rhel7/

enabled=1

gpgcheck=0


# /etc/yum.repos.d/local-centos6.repo

[local-centos6]

name=local-centos6

baseurl=http://192.168.56.1/centos6/

enabled=1

gpgcheck=0


# /etc/yum.repos.d/local-centos7.repo

[local-centos7]

name=local-centos7

baseurl=http://192.168.56.1/centos7/

enabled=1

gpgcheck=0



Fedora Linux 에서 동영상 캡쳐 시 별도의 소프트웨어를 설치 하지 않고도, 캡쳐 가능

Ctrl + Alt + Shift + R


VirtualBox 5.0.30

Fedora 23/24/25 모두 해봄 (VirtualBox 4 버전에서 Fedora 25 버전은 잘 안되서 VirtualBox 5 버전으로 업그레이드 함)


1
2
3
4
5
6
7
8
9
10
yum update   
yum install kernel-devel-$(uname -r)
yum install gcc make
 
shutdown -r now
 
cd /var/run/media/root/VBOXADDITIONS_4.3.40_110317/
./VBoxLinuxAdditions.run
 
shutdown -r now

[한/영키 설정]

시스템 설정 -> 키보드 -> 바로가기 -> 자판입력 -> 다음입력 소스로전환 Alt 로 변경(Multi_key) 로 바뀜

   텍스트 입력창 -> Hangul(Fcitx) 선택 확인 및 다음 소스로 번환 Multi_key 확인

혹시나 한/영키 안되면 터미널

sudo setkeycodes 72 122 엔터



[JDK 1.8 설치]

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

java -version



[Eclipse 이슈]

eclipse.ini

--launcher.GTK_version

2

--launcher.appendVmargs -- 이전

런처에 아이콘 물음표라면..

sudo cp 설치/icon.xpm /usr/share/pixmaps/eclipse.xpm



[Unity Tweak Tool]

Ubuntu Software 에서 Unity Tweak Tool 설치


[우분투 런처 위치 이동 및 사이즈 변경]

Unity Tweak Tool -> Launcher -> Appearance -> Bottom 클릭

     Icons size = 30


[우분투 Workspace 활성화]

Unity Tweak Tool -> Workspace Setting -> Workspace switcher 켬

Ctrl + Alt + ←, → 테스트


[우분투 Font 사이즈 변경]

Unity Tweak Tool -> Fonts -> 1 포인트 씩 내림 및 Window title Font는 8




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<p>#!/bin/sh
 
 
SRC_FILE=/home/ci/sample/tomcat/domains/monitor_agent/sample-agent.jar
 
# Tomcat
WAS_ARR=( "tomcat@was01;user,admin" "tomcat@was02;user,admin" )
 
for WAS_INFO in "${WAS_ARR[@]}"
do
        var=$(echo $WAS_INFO | awk -F";" '{print $1,$2}')
        set -- $var
 
        WAS=$1
        DOMAIN_ARR_STR=$2
        DOMAIN_ARR=$(echo $DOMAIN_ARR_STR | tr "," "\n")
 
        echo "ssh -q $WAS rm -Rf /usr/local/tomcat/domains/monitor_agent/sample-agent.jar"
        ssh -q $WAS rm -Rf /usr/local/tomcat/domains/monitor_agent/sample-agent.jar
 
        echo "scp -q -r $SRC_FILE $WAS:/usr/local/tomcat/domains/monitor_agent/."
        scp -q -r $SRC_FILE $WAS:/usr/local/tomcat/domains/monitor_agent/.
 
        for DOMAIN in $DOMAIN_ARR
        do
                echo "ssh -q $WAS cd '/usr/local/tomcat/domains/'$DOMAIN';' ./deploy.sh restart wait update 3"
                ssh -q $WAS cd '/usr/local/tomcat/domains/'$DOMAIN';' ./deploy.sh restart wait update 3
        done
 
done
</p>


VIP - 192.168.0.151


1번 서버 - 192.168.0.152

2번 서버 - 192.168.0.153


wget http://www.haproxy.org/download/1.5/src/haproxy-1.5.17.tar.gz

tar xvzf haproxy-1.5.17.tar.gz



uname -r


yum install wget gcc gcc-c++ autoconf automake make openssl openssl-devel pcre-devel zlib


make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1

make install


cp examples/haproxy.init /etc/init.d/haproxy

cp examples/examples.cfg /etc/haproxy/haproxy.cfg


chmod 755 /etc/init.d/haproxy



service haproxy start (or /etc/init.d/haproxy start)




defaults

    mode                    http

    log                     global

    #option                  httplog

    option                  dontlognull

    option http-server-close

    #option forwardfor       except 127.0.0.0/8

    option                  redispatch

    retries                 3

    timeout http-request    10s

    timeout queue           1m

    timeout connect         10s

    timeout client          1m

    timeout server          1m

    timeout http-keep-alive 10s

    timeout check           10s

    maxconn                 3000


# id

# 101 ~ 200 = HTTP

# 201 ~ 300 = TCP

# 501 ~ 600 = TEST



frontend searchWas

        bind 192.168.0.151:80

        option  httplog

        default_backend searchWas


backend searchWas

        id      101

        stats   enable

        stats   hide-version

        balance roundrobin

        # For Sticky Session

        appsession JSESSIONID len 30 timeout 3h request-learn prefix

        option  httplog

        option  httpchk GET /info.jsp

        option  http-server-close

        option  forwardfor

server search01 192.168.0.101:8080 check inter 2000 fastinter 500 downinter 5000 rise 3 fall 1

server search02 192.168.0.102:8080 check inter 2000 fastinter 500 downinter 5000 rise 3 fall 1


listen aqmp_real 192.168.0.151:5672

        id              201

        mode            tcp

        balance         roundrobin

        timeout client  3h

        timeout server  3h

        option          clitcpka

        server mq11 192.168.0.101:5672 check inter 5s rise 2 fall 3

        server mq21 192.168.0.101:5672 check inter 5s rise 2 fall 3


listen stats 0.0.0.0:40000       #Listen on all IP's on port 9000

    mode http

    balance

    timeout client 5000

    timeout connect 4000

    timeout server 30000


    #This is the virtual URL to access the stats page

    stats uri /haproxy_stats


    #Authentication realm. This can be set to anything. Escape space characters with a backslash.

    stats realm HAProxy\ Statistics


    #The user/pass you want to use. Change this password!

    #stats auth admin:admin


    #This allows you to take down and bring up back end servers.

    #This will produce an error on older versions of HAProxy.

    stats admin if TRUE


yum install keepalived



service rsyslog restart

service keepalived restart

service haproxy restart










[/etc/rsyslog.d/haproxy.conf]

local2.*    /var/log/haproxy.log





1번 서버 [/etc/keepalived/keepalived.conf]

! Configuration File for keepalived

global_defs {

        router_id HAProxy1

}


vrrp_script haproxy {

        script "killall -0 haproxy"

        interval 2

        weight 2

}



vrrp_instance VI_1 {

        debug 2

        virtual_router_id 50

        advert_int 1

        priority 101

        state MASTER

        interface eth0

        virtual_ipaddress {

                192.168.0.151 dev eth0

        }


        track_script {

                haproxy

        }


        notify_master "/etc/keepalived/master.sh"

        notify_backup "/etc/keepalived/backup.sh"

}


2번 서버 [/etc/keepalived/keepalived.conf]

! Configuration File for keepalived


global_defs {

        router_id HAProxy2

}


vrrp_script haproxy {

        script "killall -0 haproxy"

        interval 2

        weight 2

}



vrrp_instance VI_1 {

        debug 2

        virtual_router_id 50

        advert_int 1

        priority 100

        state BACKUP

        interface eth0

        virtual_ipaddress {

                192.168.0.151 dev eth0

        }


        track_script {

                haproxy

        }

}




[/etc/rsyslog.conf]


----------------------------


$ModLoad imudp

$UDPServerRun 514


----------------------------




[/etc/sysctl.conf]


----------------------------


# For keepalived - vrrp

net.ipv4.ip_nonlocal_bind=1


----------------------------





yum install rubygems

gem update

gem update --system


gem install haproxyctl


haproxyctl "enable server wasSearch/search01"

haproxyctl "disable server wasSearch/search01"


curl -d "s=search01&action=maint&b=#101" http://192.168.0.151:8080/haproxy_stats

curl -d "s=search01&action=ready&b=#101" http://192.168.0.151:8080/haproxy_stats


[참조] http://bryan.wiki/243

[참조] https://www.percona.com/blog/2014/10/03/haproxy-give-me-some-logs-on-centos-6-5/

apache 2.2.31

mod_jk 1.2.41

  • Activation
    • Active
    • Disabled
    • Stopped

배포 시  Activation 을 Disabled 시켰는데 이미 접속한 사용자들에 대해서는(쿠키?) 계속 들어와서 Stopped 바꾸니 WAS까지 들어온 요청은 처리 하되 그 이후 모든 요청은 막아줌


무중단 배포 시 WAS 중지 전 jkstatus 에서 Stopped 변경 후 약 3초간의 시간을 주고, 소스 배포 후 재기동 시킨 후 다시 Active 시킨다.

Stopped 후 3초, 5초 후 WAS 재기동 테스트 해보았다.


Servlet 처리 시간이 5초 케이스 만들어서  부하 준 상황에서 이중화 구조로 순차 재기동하니 502 에러 발생!!


더 안 전하게 하려면 Stopped 후 대기 시간을 늘리던가

아니면 WAS의 Running Thread 의 갯수를 명확히 파악 할 수있다면 Running Thread 갯수가 0일때까지 대기 후 WAS를 재기동하면 완벽 하겠군요.

웹서버는 직접적으로 관리를 하지 않아 설치 해볼일이 없었는데 테스트 시 필요해서 설치 해봤다.


[환경 2.4.x 케이스] 하단에 2.2.x 케이스도 있음

CentOS release 6.4 (Final) 64Bit

httpd-2.4.18

apr-1.5.2

apr-util-1.5.4

pcre-8.37

tomcat-connectors-1.2.41

tomcat 8.0.30



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
mkdir download
cd download/
wget http://apache.mirror.cdnetworks.com//httpd/httpd-2.4.18.tar.gz
tar xvzf httpd-2.4.18.tar.gz
 
wget http://mirror.apache-kr.org/apr/apr-1.5.2.tar.gz
tar xvzf apr-1.5.2.tar.gz
 
wget http://mirror.apache-kr.org/apr/apr-util-1.5.4.tar.gz
tar xvzf apr-util-1.5.4.tar.gz
 
mv apr-1.5.2 httpd-2.4.18/srclib/apr
mv apr-util-1.5.4 httpd-2.4.18/srclib/apr-util
 
wget http://sourceforge.net/projects/pcre/files/pcre/8.37/pcre-8.37.tar.gz/download
tar xvzf pcre-8.37.tar.gz
cd pcre-8.37
./configure --enable-unicode-properties=yes
make && make install
 
./configure \
--prefix=/usr/local/tomcat/apache-2.4.18 \
--enable-so \
--enable-rewrite \
--enable-proxy \
--enable-ssl \
--enable-mods-shared=all \
--enable-modules=shared \
--enable-mpms-shared=all \
--with-included-apr \
--with-included-apr-util
make && make install
/usr/local/tomcat/apache-2.4.18/bin/httpd -V
chown root:sys /usr/local/tomcat/apache-2.4.18/bin/httpd
chmod +s /usr/local/tomcat/apache-2.4.18/bin/httpd
/usr/local/tomcat/apache-2.4.18/httpd.conf
    ServerName localhost // 주석 해제 및 설정 
    LoadModule slotmem_shm_module modules/mod_slotmem_shm.so // 주석 해제
 
 
/usr/local/tomcat/apache-2.4.18/bin/httpd -k start
/usr/local/tomcat/apache-2.4.18/bin/httpd -k stop
 
wget http://apache.tt.co.kr/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.41-src.tar.gz
tar xvzf tomcat-connectors-1.2.41-src.tar.gz
cd tomcat-connectors-1.2.41-src/native
./configure --with-apxs=/usr/local/tomcat/apache-2.4.18/bin/apxs
make && make install
ls -l /usr/local/tomcat/apache-2.4.18/modules/mod_jk.so
 
cp 톰켓롬/bin/tomcat-native.tar.gz .
tar xvzf tomcat-native.tar.gz
cd tomcat-native-1.1.33-src/jni/native
 
./configure --with-apr=/usr/local/tomcat/apache-2.4.18/bin/apr-1-config --prefix=/usr/local/tomcat/apache-tomcat-8.0.30
make && make install
 
톰캣 설정
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
export LD_LIBRARY_PATH
 
 
Include conf/extra/mod_jk.conf 
 
vi /usr/local/tomcat/apache-2.4.18/conf/httpd.conf
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf                    // 주석 해제   
    # Various default settings
    Include conf/extra/httpd-default.conf                   // 주석 해제
    Include conf/extra/mod_jk.conf 
 
     
vi vi /usr/local/tomcat/apache-2.4.18/conf/extra/mod_jk.conf   
    # -----------------------------------------
    #       DAK TEST Apache Httpd WebServer
    #
    #       contact : ddakker@ddakker.com
    # -----------------------------------------
 
    # Load mod_jk module
    # Update this path to match your modules location
    LoadModule jk_module          modules/mod_jk.so
 
    # Where to find workers.properties
    # Update this path to match your conf directory location (put workers.properties next to httpd.conf)
    JkWorkersFile conf/extra/workers.properties
 
    # Where to put jk logs
    # Update this path to match your logs directory location (put mod_jk.log next to access_log)
    JkLogFile     "|logs/mod_jk.log logs/mod_jk.log_%m%d%Y"
 
    JkShmFile     logs/mod_jk.shm
 
    # Set the jk log level [debug/error/info]
    JkLogLevel    info
 
    # Select the log format
    JkLogStampFormat "[%Y-%m-%d %H:%M:%S] "
    # JkOptions indicate to send SSL KEY SIZE,
    JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories +ForwardURICompatUnparsed
 
    # JkRequestLogFormat set the request format
    JkRequestLogFormat     "%w %V %T %R %s %U"
 
    # Send everything for context /examples to worker named worker1 (ajp13)
    JkMount  /jkstatus* jkstatus
 
    <location /jkstatus>
        JkMount jkstatus
        Order Deny,Allow
        Allow from 127.0.0.1
        Allow from 192
        Deny from all
    </location>
 
vi /usr/local/tomcat/apache-2.4.18/conf/extra/workers.properties
    # -----------------------------------------
    #       DAK TEST Apache Httpd WebServer
    #
    #       contact : ddakker@naver.com
    # -----------------------------------------
 
    worker.list=jkstatus,testcluster
 
    # Templates
    worker.template.type=ajp13
    worker.template.maintain=60
    worker.template.lbfactor=1
    worker.template.ping_mode=A
    worker.template.ping_timeout=2000
    worker.template.prepost_timeout=2000
    worker.template.socket_timeout=300
    worker.template.socket_connect_timeout=2000
    worker.template.socket_keepalive=true
    worker.template.connection_pool_timeout=300
    worker.template.connect_timeout=10000
    worker.template.recovery_options=7
     
     
     
    worker.testcluster11.reference=worker.template
    worker.testcluster11.host=192.168.0.2
    worker.testcluster11.port=9401
     
    worker.testcluster21.reference=worker.template
    worker.testcluster21.host=192.168.0.3
    worker.testcluster21.port=9401
     
     
    # -------- LB ------------
     
     
    worker.testcluster.type=lb
    worker.testcluster.method=Session
    worker.testcluster.sticky_session=True
    worker.testcluster.balance_workers=testcluster11,testcluster21
     
     
     
    worker.jkstatus.type=status
     
vi httpd-vhosts.conf
    NameVirtualHost *:80
 
 
    # Vhost - Tomcat Service
    Include conf/extra/vhost-tomcat.conf
 
vi vhost-tomcat.conf
    <virtualhost *:80>
        DocumentRoot "/data/webroot/test-cluster/webapp"
 
        ServerName testcluster.ddakker.pe.kr
        ServerAlias cluster.ddakker.pe.kr
 
        #ErrorLog "|/usr/sbin/cronolog /usr/local/tomcat/apache2/logs/cluster.ddakker.pe.kr-error_log.%m%d%Y"
        #CustomLog "|/usr/sbin/cronolog/usr/local/tomcat/apache2/logs/cluster.ddakker.pe.kr-access_log.%m%d%Y" combined
        DirectoryIndex /index.html /index.jsp
 
        JkUnMount   /*.js   testcluster
        JkUnMount   /*.css  testcluster
        JkUnMount   /*.jpg  testcluster
        JkUnMount   /*.png  testcluster
        JkUnMount   /*.gif  testcluster
        JkUnMount   /*.htm  testcluster
        JkUnMount   /*.html testcluster
        JkUnMount   /*.ico  testcluster
        JkUnMount   /*.eot  testcluster
        JkUnMount   /*.woff testcluster
        JkMount     /*      testcluster
        JkMount  /jkstatus* jkstatus
 
        <directory "/data/webroot/test-cluster/webapp">
                        Options FollowSymLinks
                AllowOverride None
                <ifversion < 2.3>
                    Order allow,deny
                    Allow from all
                </ifversion>
                <ifversion >= 2.3>
                    Require all granted
                </ifversion>
        </directory>
    </VirtualHost>
 
    




[환경 2.2.x 케이스]

CentOS release 6.4 (Final) 64Bit

httpd-2.2.31

tomcat-connectors-1.2.41



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
wget http://apache.mirror.cdnetworks.com/httpd/httpd-2.2.31.tar.gz
tar xvzf httpd-2.2.31.tar.gz
cd httpd-2.2.31
./configure --prefix=/usr/local/tomcat/apache2
make
make install
 
chown root:sys /usr/local/tomcat/apache2/bin/httpd
chmod +s /usr/local/tomcat/apache2/bin/httpd
 
/usr/local/tomcat/apache2/bin/httpd -k start
/usr/local/tomcat/apache2/bin/httpd -k stop
 
wget http://apache.tt.co.kr/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.41-src.tar.gz
tar xvzf tomcat-connectors-1.2.41-src.tar.gz
cd tomcat-connectors-1.2.41-src/native
./configure --with-apxs=/usr/local/tomcat/apache2/bin/apxs
make
make install
 
ls -l /usr/local/tomcat/apache2/modules/mod_jk.so
cd /usr/local/tomcat/apache2/conf
vi httpd.conf
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
     
    # Various default settings
    Include conf/extra/httpd-default.conf
     
    Include conf/extra/mod_jk.conf 
 
vi /extra/mod_jk.conf  
    # -----------------------------------------
    #       DAK TEST Apache Httpd WebServer
    #
    #       contact : ddakker@ddakker.com
    # -----------------------------------------
 
    #LoadModule jk_module modules/mod_jk.so
    #<ifmodule jk_module="">
    #   JkWorkersFile    conf/extra/workers.properties
    #   JkLogFile        logs/mod_jk.log
    #   JkLogLevel       info
    #</ifmodule>
    # Load mod_jk module
    # Update this path to match your modules location
    LoadModule jk_module          modules/mod_jk.so
 
    # Where to find workers.properties
    # Update this path to match your conf directory location (put workers.properties next to httpd.conf)
    JkWorkersFile conf/extra/workers.properties
 
    # Where to put jk logs
    # Update this path to match your logs directory location (put mod_jk.log next to access_log)
    JkLogFile     "|logs/mod_jk.log logs/mod_jk.log_%m%d%Y"
 
    JkShmFile     logs/mod_jk.shm
 
    # Set the jk log level [debug/error/info]
    JkLogLevel    info
 
    # Select the log format
    JkLogStampFormat "[%Y-%m-%d %H:%M:%S] "
    # JkOptions indicate to send SSL KEY SIZE,
    JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories +ForwardURICompatUnparsed
 
    # JkRequestLogFormat set the request format
    JkRequestLogFormat     "%w %V %T %R %s %U"
 
    # Send everything for context /examples to worker named worker1 (ajp13)
    JkMount  /jkstatus* jkstatus
 
    <location /jkstatus>
        JkMount jkstatus
        Order Deny,Allow
        Allow from 127.0.0.1
        Allow from 192
        Deny from all
    </location>
     
vi extra/workers.properties
    # -----------------------------------------
    #       DAK TEST Apache Httpd WebServer
    #
    #       contact : ddakker@naver.com
    # -----------------------------------------
 
    worker.list=jkstatus,testcluster
 
    # Templates
    worker.template.type=ajp13
    worker.template.maintain=60
    worker.template.lbfactor=1
    worker.template.ping_mode=A
    worker.template.ping_timeout=2000
    worker.template.prepost_timeout=2000
    worker.template.socket_timeout=300
    worker.template.socket_connect_timeout=2000
    worker.template.socket_keepalive=true
    worker.template.connection_pool_timeout=300
    worker.template.connect_timeout=10000
    worker.template.recovery_options=7
     
     
     
    worker.testcluster11.reference=worker.template
    worker.testcluster11.host=192.168.0.2
    worker.testcluster11.port=9401
     
    worker.testcluster21.reference=worker.template
    worker.testcluster21.host=192.168.0.3
    worker.testcluster21.port=9401
     
     
    # -------- LB ------------
     
     
    worker.testcluster.type=lb
    worker.testcluster.method=Session
    worker.testcluster.sticky_session=True
    worker.testcluster.balance_workers=testcluster11,testcluster21
     
     
     
    worker.jkstatus.type=status
     
vi httpd-vhosts.conf
    NameVirtualHost *:80
 
 
    # Vhost - Tomcat Service
    Include conf/extra/vhost-tomcat.conf
 
vi vhost-tomcat.conf
    <virtualhost *:80>
        DocumentRoot "/data/webroot/test-cluster/webapp"
 
        ServerName testcluster.ddakker.pe.kr
        ServerAlias cluster.ddakker.pe.kr
 
        #ErrorLog "|/usr/sbin/cronolog /usr/local/tomcat/apache2/logs/cluster.ddakker.pe.kr-error_log.%m%d%Y"
        #CustomLog "|/usr/sbin/cronolog/usr/local/tomcat/apache2/logs/cluster.ddakker.pe.kr-access_log.%m%d%Y" combined
        DirectoryIndex /index.html /index.jsp
 
        JkUnMount   /*.js   testcluster
        JkUnMount   /*.css  testcluster
        JkUnMount   /*.jpg  testcluster
        JkUnMount   /*.png  testcluster
        JkUnMount   /*.gif  testcluster
        JkUnMount   /*.htm  testcluster
        JkUnMount   /*.html testcluster
        JkUnMount   /*.ico  testcluster
        JkUnMount   /*.eot  testcluster
        JkUnMount   /*.woff testcluster
        JkMount     /*      testcluster
        JkMount  /jkstatus* jkstatus
 
        <directory "/data/webroot/test-cluster/webapp">
                        Options FollowSymLinks
                AllowOverride None
                <ifversion < 2.3>
                    Order allow,deny
                    Allow from all
                </ifversion>
                <ifversion >= 2.3>
                    Require all granted
                </ifversion>
        </directory>
 
    </virtualhost>
 
vi /usr/local/tomcat/webroot/test-cluster/webapp/index.html
    <h1>index.html</h1><h1>
vi /usr/local/tomcat/webroot/test-cluster/webapp/info.jsp
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@page import="java.net.InetAddress"%>
    <%
            String serverIP = "";
            try{
                    serverIP = InetAddress.getLocalHost().getHostAddress();
                    serverIP = serverIP.substring(serverIP.lastIndexOf(".")+1);
            }catch(Exception e){}
 
            String info = request.getServerName() + ", " + serverIP + ", " + System.getProperty("jvmRoute");
 
            out.print(info);
            //System.out.println(info);
    %>
     
vi /etc/hosts
    127.0.0.1   localhost   testcluster.ddakker.pe.kr
     
wget http://testcluster.ddakker.pe.kr/index.html
wget http://testcluster.ddakker.pe.kr/info.jsp
wget http://testcluster.ddakker.pe.kr/jkstatus
</h1>



[tomcat & tomcat-native 만 설치]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
wget http://mirror.apache-kr.org/apr/apr-1.5.2.tar.gz
tar xvzf apr-1.5.2.tar.gz
./configure
make & make install
 
wget http://mirror.apache-kr.org/apr/apr-util-1.5.4.tar.gz
tar xvzf apr-util-1.5.4.tar.gz
./configure --with-apr=/usr/local/apr
make & make install
 
tar xvzf tomcat-native.tar.gz
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make && make install
 
LD_LIBRARY_PATH=/usr/local/apr/lib
export LD_LIBRARY_PATH

Redis Cluster 셈플링 좀 하다보니 Cluster 기능이 Ruby 기반으로 작동하고 있네..


Ruby 를 안 해본 입장에서 설치 좀 해보려니 좀 삽질..


[환경]

CentoOs 5.9 64Bit


해당 환경에서 yum으로 설치해보니 ruby 1.8.5가 설치되는 것 같고, Gem이 포함되지 않은 버전이여서 Gem도 수동으로 설치하고.. 안되서 버전 이것저것 삽질을 하다가 RVM 발견..


아주 간단하게 설치..


[RVM 설치] http://rvm.io/

설명대로 설치

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ \curl -sSL https://get.rvm.io | bash -s stable

[RUBY 설치]

$ rvm install 2.2.0

Gem 포함 설치


* Redis Cluster 구동해보려 하니 ruby 관련 redis가 필요하단다.


[RUBY Redis Lib 설치]

$ gem install redis


* /usr/bin/env: ruby: No such file or directory .. 없단다..

ruby 실행 파일을 /usr/bin/ruby 에 심볼릭 링크 걸어 해결

ln -s /usr/local/rvm/rubies/default/bin/ruby /usr/bin/ruby


Redis Cluster 실행 성공!!

VMWare 기반 Mint 해상도 설정 리스트에 존재 하지 않는 사이즈로 변경하기



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ cvt 1920 1080 엔터
 
--------------------------------------------------------------------------------------------------------
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
--------------------------------------------------------------------------------------------------------
 
위에 나온 정보 입력
$ xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$ xrandr
--------------------------------------------------------------------------------------------------------
Screen 0: minimum 1 x 1, current 800 x 600, maximum 8192 x 8192
Virtual1 connected 800x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   800x600        60.0*+   60.3
생략
--------------------------------------------------------------------------------------------------------
$ xrandr --addmode Virtual1 "1920x1080_60.00"
 
# Virtuals1 부분은 xrandr 명령어 처보면 확인 가능 VGA, DVI, HDMI 등??

+ Recent posts