vi /etc/apache2/sites-available/000-default.conf CustomLog ${APACHE_LOG_DIR}/access.log combined RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on
docker run -p 80:9000 -d --name yona -e MARIADB_ROOT_PASSWORD=project-admin123 mariadb:10.3
apt update apt install -y git vim wget openjdk-8-jdk unzip
mysql -u root -p create user 'yona'@'localhost' IDENTIFIED BY 'project-yona123'; create database yona DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin ; GRANT ALL ON yona. to 'yona'@'localhost'; GRANT ALL ON yona. to 'yona'@'127.0.0.1'; GRANT ALL PRIVILEGES ON . TO 'yona'@'localhost' WITH GRANT OPTION; FLUSH privileges;
# ab -n 1000 -c 10 http://doc.skill.or.kr/
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking doc.skill.or.kr (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: cloudflare
Server Hostname: doc.skill.or.kr
Server Port: 80
Document Path: /
Document Length: 0 bytes
Concurrency Level: 10
Time taken for tests: 2.515 seconds
Complete requests: 1000
Failed requests: 351
(Connect: 0, Receive: 0, Length: 351, Exceptions: 0)
Non-2xx responses: 1000
Total transferred: 277068 bytes
HTML transferred: 5616 bytes
Requests per second: 397.66 [#/sec] (mean)
Time per request: 25.147 [ms] (mean)
Time per request: 2.515 [ms] (mean, across all concurrent requests)
Transfer rate: 107.60 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 5 8 1.6 8 18
Processing: 9 17 5.5 15 55
Waiting: 9 16 5.4 15 54
Total: 16 25 5.5 23 62
Percentage of the requests served within a certain time (ms)
50% 23
66% 26
75% 27
80% 28
90% 31
95% 35
98% 40
99% 43
100% 62 (longest request)
Apache Bench 옵션
# ab
ab: wrong number of arguments
Usage: ab [options] [http[s]://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make at a time
-t timelimit Seconds to max. to spend on benchmarking
This implies -n 50000
-s timeout Seconds to max. wait for each response
Default is 30 seconds
-b windowsize Size of TCP send/receive buffer, in bytes
-B address Address to bind to when making outgoing connections
-p postfile File containing data to POST. Remember also to set -T
-u putfile File containing data to PUT. Remember also to set -T
-T content-type Content-type header to use for POST/PUT data, eg.
'application/x-www-form-urlencoded'
Default is 'text/plain'
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. 'Apache=1234'. (repeatable)
-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-q Do not show progress when doing more than 150 requests
-l Accept variable document length (use this for dynamic pages)
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-r Don't exit on socket receive errors.
-m method Method name
-h Display usage information (this message)
-I Disable TLS Server Name Indication (SNI) extension
-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)
-f protocol Specify SSL/TLS protocol
(SSL2, TLS1, TLS1.1, TLS1.2 or ALL)
-E certfile Specify optional client certificate chain and private key
kubectl create namespace test
kubectl create deployment nginx --image nginx --namespace test kubectl create deployment httpd --image httpd --namespace test
# test namespace create
$ kubectl create namespace test
namespace/test created
# test namespace nginx deployment create
$ kubectl create deployment nginx --image nginx --namespace test
deployment.apps/nginx created
# nginx deployment 외부에서 접속 가능한 네트워크 생성 (LoadBalancer Service:80, IP:133.186.153.62)
$ kubectl expose deployment nginx --port 80 --target-port 80 --type LoadBalancer --namespace test --load-balancer-ip 133.186.153.62
service/nginx exposed
# nginx LoadBalancer service 확인
# 웹 브라우저에서 해당 EXTERNAL -IP 접속
ubuntu@kube-manager:~$ kubectl get service --namespace test
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx LoadBalancer 10.254.249.48 133.186.153.62 80:30905/TCP 6m28s
#Start a Server instance as follows:
docker run -d -e 'CUBRID_COMPONENTS=SERVER' --name server-container-name cubrid:tag
#And Start a Broker instance as follows:
docker run -d -e 'CUBRID_COMPONENTS=BROKER' -e 'CUBRID_DB_HOST=cubrid_server' -e 'CUBRID_DB=dbname' --name broker-container-name --link cubrid_server:server-container-name cubrid:tag
#Create a isolated network for HA
docker network create --driver bridge cubrid_ha_net
#Start a Master instance (with Broker) as follows:
docker run -d --net=cubrid_ha_net -e 'CUBRID_COMPONENTS=HA' -e 'CUBRID_DB_HOST=master:slave' -e 'CUBRID_DATABASE=db' --hostname master --name master cubridkr/cubrid:10.2.0.8797
#Start a Slave instance (with Broker) as follows:
docker run -d --net=cubrid_ha_net -e 'CUBRID_COMPONENTS=HA' -e 'CUBRID_DB_HOST=master:slave' -e 'CUBRID_DATABASE=db' --hostname slave --name slave cubridkr/cubrid:10.2.0.8797
#The following command runs a cubrid command inside an existing master container instance:
docker exec -it master
su cubrid
cubrid hb status
CUBRID HA 시작 및 확인
# CUBRID HA 시작(마스터 노드)
[master]$ cubrid heartbeat start
# CUBRID HA 시작(슬레이브 노드)
[slave]$ cubrid heartbeat start
# CUBRID HA 상태 확인(각 노드)
[master]$ cubrid heartbeat status
[slave]$ cubrid heartbeat status
# CUBRID HA 상태 확인(각 노드)
[master]$ cubrid changemode db@localhost
The server 'db@localhost''s current HA running mode is active.
[slave]$ cubrid changemode db@localhost
The server 'db@localhost''s current HA running mode is standby.
CUBRID HA 동작 여부 확인
# 마스터 노트
[master]$ csql -u dba db@localhost -c "create table abc(a int, b int, c int, primary key(a));"
[master]$ csql -u dba db@localhost -c "insert into abc values (1,1,1);"
# 슬래이브 노
[slave]$ csql -u dba db@localhost -l -c "select * from abc;"
=== <Result of SELECT Command in Line 1> ===
<00001> a: 1
b: 1
c: 1
브로커 설정, 시작 및 확인
[master]$ cubrid broker start
@ cubrid broker start
++ cubrid broker start: success
[master]$ cubrid broker status
@ cubrid broker status
% testdb_RWbroker
---------------------------------------------------------
ID PID QPS LQS PSIZE STATUS
---------------------------------------------------------
1 9532 0 0 48120 IDLE