This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
현재: ProLinux 8.6 | |
/dev/sdc 가 공유볼륨이라는 사실은 | |
1. DB1 에서 dd if=/dev/urandom of=/dev/sdc bs=4K count=1 날림. | |
2. DB1, DB2 에서 hexdump /dev/sdc -C 로 같은 값이 나오는지 확인. | |
3. 공유볼륨 확인 완료. | |
모든 노드에 대해 | |
1. dnf install lvm2-lockd gfs2-utils dlm-lib -y | |
2. /etc/hosts 에 10.0.2.22 GFS-DB1 / 10.0.2.21 GFS-DB2 추가 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 관련한 모든 rpm 들 설치 (with dependencies) | |
dnf download --resolve --alldeps <package_name_1> ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is really dangerous command. | |
# Please be CAREFUL | |
TARGET_OSD_ID="$1" # 6 | |
TARGET_HOST_NAME=$(ceph orch ps --daemon_type osd --format json| jq -r '.[] | select(.daemon_id == '\""$TARGET_OSD_ID"\"') | .hostname') | |
TARGET_DAEMON_NAME=$(ceph orch ps --daemon_type osd --format json | jq -r '.[] | select(.daemon_id == '\""$TARGET_OSD_ID"\"') | .daemon_name') | |
TARGET_OSD_DEV_PATH=$(ceph device ls-by-host "${TARGET_HOST_NAME}" --format json | jq -r '.[] | select(.daemons[] | contains('\""${TARGET_DAEMON_NAME}"\"')) | .location[] | .dev') | |
# ceph orch ls --service_type osd --format json | jq -c '.[] | select(.spec.data_devices.paths != null) | select(.spec.data_devices.paths[] | contains('\"${TARGET_OSD_DEV_PATH}\"')) | select(.placement.hosts != null) | select(.placement.hosts[] | contains('\"${TARGET_HOST_NAME}\"'))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
version=$(git rev-parse HEAD | cut -c1-8) | |
version="0.1.7-nightly-$version" | |
sed -i "/EXTCTRL_VERSION = \"/c\ EXTCTRL_VERSION = \"$version\";" ./main.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ceph orch apply -i add_osd.yaml | |
service_type: osd | |
service_id: osd_localhost | |
placement: | |
hosts: | |
- node1 | |
data_devices: | |
paths: | |
- /dev/sdb | |
- /dev/sdc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function snakecase_to_camelCase() { | |
local ret | |
ret=$(echo $1 | sed -E 's/_(.)/\U\1/g') | |
echo "$ret" | |
} | |
SomeString="snakecase_looks_very_bad" | |
camelCase=$(snakecase_to_camelCase "$SomeString") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function camelcase_to_snakecase() { | |
local ret | |
ret=$(echo "$1" | sed -r 's/([A-Z])/_\L\1/g' | sed 's/^_//') | |
echo "$ret" | |
} | |
SomeString="helloWorldMyFriend" | |
snake_case=$(camelcase_to_snakecase "${SomeString}") | |
echo $snake_case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function all_uppercase() { | |
local ret=${1^^} # Make input parameter Upper case. Should be declared in local variable. | |
echo "$ret" # This is like return. | |
} | |
SomeString="HelloWorld" | |
UpperCase=$(all_uppercase "${SomeString}") | |
echo $UpperCase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TYPE SUBUSER AS OBJECT ( | |
ID VARCHAR2(200), | |
PERMISSIONS VARCHAR2(12) | |
); | |
CREATE TYPE SUBUSERS AS VARRAY(1000) OF SUBUSER; -- Nested Table type. | |
CREATE TABLE USER ( | |
UID VARCHAR2(50), | |
SUBUSERS_COLUMN SUBUSERS -- An Instance of Nested Table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################### | |
# Information | |
# Host 1 (node1): 172.22.4.101 - admin | |
# host 2 (node2): 172.22.4.102 | |
# host 3 (node3): 172.22.4.103 | |
# host 4 (node4): 172.22.4.104 | |
# host 5 (node5): 172.22.4.105 | |
########################### |
NewerOlder