오늘은 다이버에게 발생 할 수 있는 질환 중 가장 많이 알려져 있는 감압병에 대해 알아보겠습니다.
감압병은 직업적으로 깊은 수심에서 장시간 잠수를 반복해서 하는 커머셜다이버에게 흔히 발생되며, 우리 같은 레크레이션 다이버에게는 잘 생기지 않는 질환입니다. 하지만 부주의 하면 레크레이션 다이버에게도 생길 수 있기 때문에 이번 시간에 감압병에 대해 잘 듣고 이해하신다면 감압병에 걸리지 않고 즐겁고 안전하게 다이빙을 하실 수 있을 것 입니다.
그러면 지금부터 감압병의 정의와 발생원인, 증세, 응급처치, 치료, 예방법 순으로 알아보도록 하겠습니다.
2. 본론
정의 : 감압병이란 잠수중 체내에 흡수된 질소가 호흡을 통해 충분히 배출되지 못하고 체내에서 기포를 형성하여 병증을 유발하는 것을 말합니다.
원인 : 감압병의 원인은 헨리의법칙으로 설명이 되는데 깊은 수심에서 오랜 잠수 후 급상승 하거나 감압이 필요한 잠수 후 감압 없이 상승, 비행기 탐승대기 시간을 지키지 않거나 감압병을 촉진시키는 요인에 노출 되었을 때 발생 할 수 있습니다. 잠수를 하면 주변에 높아진 압력에 의해 몸속으로 보다 많은 질소가 녹아들어가게 되는데 녹아들어간 질소는 서서히 상승하면 호흡을 통해 정상적으로 체외로 배출되게 됩니다. 하지만 깊은 수심에서 오랜 잠수 후 적절한 감압절차 없이 상승하거나 급상승하면 체내에 과다하게 녹아들어간 질소가 체외로 배출되기전에 인체속에서 질소 기포를 형성하여 혈관을 막거나 신경세포를 눌러 병증을 일으키게 됩니다.
증세 : 감압병의 증세는 경증과 중증으로 구분됩니다. 경증으로는 피부의 발진, 관절통 등이 있으며, 중증으로는 호흡곤란, 반신, 전신마비, 의식불명이 발생하기도 합니다
응급처치 : 다이버가 감압병 증상을 보이면 환자를 눕히고 산소호흡을 시키면서, 육로나 해로를 통해 가까운 재압치료시설이 있는 병원으로 이송합니다. 국내 재압치료시설은 진해, 부산, 통영, 여수, 거제, 제주, 서귀포, 강릉 등에 있습니다. 재압치료는 환자를 높은 압력을 가할 수 있는 커다란 압력실에 넣고 압력을 가해서 기포로 형성되었던 질소가 다시 혈액속으로 녹아 들어갔다가 호흡을 통해 배출될 수 있도록 하여 치료 합니다. 재압치료에 대해 주의할 점은 위급하다고 현장의 수중에서 재압을 가하는 것은 저체온증 등 다른 위급 상황이 될 수 있으므로 절대로 시도하지 말아야 합니다.
예방 : 감압병을 예방하려면 감압이 필요한 잠수 금지, 상승 중 5m 수심에서 3~5분간 안전정지하며 상승속도는 분당 9m, 초당 15cm를 지켜야 합니다, 또한 잠수 후에는 비행기 탐승 대기시간을 준수 하여야 합니다. 비행기 탑승 대기시간은 무감압 잠수 1회시 12시간, 2회 이상 잠수시 18시간, 감압이 필요한 잠수를 하거나 3일이상 연속 잠수를 했을 경우 24시간 이상 휴식 후 비행기에 탑승하여야 합니다. 감압이 필요한 잠수를 하지 않기 위해서는 잠수전 잠수표를 사용하여 무감압 잠수를 계획하고, 감압병을 촉진하는 질병, 탈수, 음주, 추위, 비만, 고령 등에 해당시 잠수를 포기하거나 훨씬 더 보수적인 잠수를 계획하고 진행해야 합니다.
3. 결론
이상에서 알아본 바와 같이 감압병은 무서운 질병이지만, 감압이 필요한 깊은 수심에서 장시간 다이빙 금지, 상승속도 준수, 안전정지 준수, 비행기 탑승 대기시간 준수 등을 통해 쉽게 예방됩니다. 상승속도는 분당 9m 초당 15cm를 유지하고, 다이빙을 종료하고 수면위로 상승 할 때는 항상 5m에서 3~5분간 안전정지를 해야 하며, 잠수 후 비행기를 타는 등 기압이 낮은 환경에 노출되지 않도록 주의 해야 한다는 것을 잊지 않으신다면 감압병에 대해 안전하고 즐거운 다이빙을 하실 수 있을 것 입니다.
이상으로 감압명에 대해 배워봤습니다. 이해되지 않는 부분이나 더 아시고 싶은 내용이 있으면 말씀해 주시기 바랍니다.
그러면 여러분께서는 감압병에 대해 이해하신 것으로 알고 다음시간에는 공기색전증에 대해 알아보도록 하겠습니다.
여러분 ‘색전(塞栓)’이라는 말을 들어 보셨습니까? 색전이라는 단어는 막힐색(塞),마개전(栓) 입니다. 의학에서 말하는 색전은 응고된 혈액이나 이물질에 의해 혈관이 막히는 증상을 말 합니다.
막는 물질의 종류에 따라 혈전색전증, 콜레스테롤색전증, 지방색전증 등종류에 따라 세세하게 나누기도 합니다.
이중에 우리가 알아야 할 다이빙과 연관되어 있는 증상은 혈액속의 공기에 의해 발생하는 공기색전증 입니다. 공기색전증은 다이빙 관련 질병 중에서도 가장 응급을 요하고 상황에 따라 다이버에게 치명적인 손상을 입힐 수 있기 때문에 다이버라면 공기색전증에 대해 반드시 알고 있어야 하고 그것을 예방하기 위해서 어떻게 해야 하는지 숙지 해야 합니다.
이제 저와 함께 공기색전증의 정의와 원인, 증세, 응급처치, 치료 방법, 예방법에 대해 알아 보고 숙지하신다면 보다 안전한 다이빙을 할 수 있을 것 입니다.
2. 본론
정의 : 공기색전증은 공기 기포들로 인해 뇌동맥이 막혀 혈액흐름이 차단되는 것을 말합니다.
원인 : 공기색전증의 원인은 스쿠버 다이빙 중 호흡을 참고 수면으로 상승하는 것 입니다. 수중에서 호흡하다가 상승하게 되면 보일의 법칙에 의해 폐 속에 있던 공기가 팽창하게 됩니다. 정상호흡 중에는 팽창된 공기가 입을 통해 밖으로 배출 되지만, 숨을 참고 상승하게 되면 과팽창된 공기가, 기포상태로 폐포나 실핏줄을 뚫고 혈관으로 유입되어, 심장의 펌프질에 의해 뇌동맥 속으로 들어가면서 모여서 뇌로 통하는 혈액의 공급을 중단 시키게 됩니다.
증세 : 공기색전증의 증상은 수면으로 상승 중 또는 상승 직후 현기증, 시야가 흐려짐, 마비, 의식불명, 가슴의 통증 호흡곤란, 입가에 피거품 등과 같은 증상이 나타가게 되며, 수면 도착 전에 기절 할 수도 있습니다.
스크립트등 운영에 적용을 위해 운영과 최대한 동일한 환경으로 맞춘 후 작업 하려고 합니다.
작업 후 추가 mariadb datadir이 최초 설치 했을때는 /var/lib/mysql 로 지정되어 있습니다. 운영환경에서는 데이터 크기 문제로 별도의 물리적 파티션에 지정하여 사용하였기 때문에 /data/mysql 로 지정되어 있습니다. 백업 및 복원 스크립트 작성을 염두에 두고 동일한 경로로 지정하기 위해 datadir을 /data/mysql로 변경하면서 몇가지 작업이 추가 되었습니다. 아래 작업 내용에서는 /data/mysql 디렉토리를 미리 생성하고 소유자 권한을 mysql:mysql로 수정하는 등 작업을 했지만 백업 데이터를 풀어 놓고 다시 작업해야 했습니다.
운영 환경
MariaDB 데이터 디렉토리 : /data/mysql (복원 할 때 생성해야 함)
MariaDB 로그 디렉토리 : /data/mysql-logs
[root@DEVSVR01 data]# systemctl status mariadb
● mariadb.service - MariaDB 10.4.27 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: inactive (dead)
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
[root@DEVSVR01 data]#
[root@DEVSVR01 data]#
[root@DEVSVR01 data]# systemctl start mariadb
[root@DEVSVR01 data]# systemctl status mariadb
● mariadb.service - MariaDB 10.4.27 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Fri 2022-12-02 11:08:48 KST; 7s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 62859 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 62815 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 62813 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 62826 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─62826 /usr/sbin/mysqld
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] InnoDB: 10.4.27 started; log sequence number 60943; transaction id 20
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Plugin 'FEEDBACK' is disabled.
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] InnoDB: Buffer pool(s) load completed at 221202 11:08:48
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Server socket created on IP: '::'.
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Reading of all Master_info entries succeeded
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Added new Master_info '' to hash table
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] /usr/sbin/mysqld: ready for connections.
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: Version: '10.4.27-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
Dec 02 11:08:48 DEVSVR01 systemd[1]: Started MariaDB 10.4.27 database server.
[root@DEVSVR01 data]#
maradb 를 처음 설치하고 아무런 조치를 하지 않으면 root 권한으로 비밀번호 입력 하지 않고 접속이 가능합니다.
백업 복원 후 가상머신을 제거 할 것 이기 때문에 별다른 조치를 하지 않고 바로 진행했습니다.
MariaDB 실행 및 접속
[root@DEVSVR01 data]# systemctl status mariadb
● mariadb.service - MariaDB 10.4.27 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: inactive (dead)
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
[root@DEVSVR01 data]#
[root@DEVSVR01 data]#
[root@DEVSVR01 data]# systemctl start mariadb
[root@DEVSVR01 data]# systemctl status mariadb
● mariadb.service - MariaDB 10.4.27 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Fri 2022-12-02 11:08:48 KST; 7s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 62859 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 62815 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 62813 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 62826 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─62826 /usr/sbin/mysqld
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] InnoDB: 10.4.27 started; log sequence number 60943; transaction id 20
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Plugin 'FEEDBACK' is disabled.
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] InnoDB: Buffer pool(s) load completed at 221202 11:08:48
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Server socket created on IP: '::'.
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Reading of all Master_info entries succeeded
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] Added new Master_info '' to hash table
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: 2022-12-02 11:08:48 0 [Note] /usr/sbin/mysqld: ready for connections.
Dec 02 11:08:48 DEVSVR01 mysqld[62826]: Version: '10.4.27-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
Dec 02 11:08:48 DEVSVR01 systemd[1]: Started MariaDB 10.4.27 database server.
[root@DEVSVR01 data]# mysql -uroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.4.27-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
MariaDB [(none)]> show global variables like 'datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+
1 row in set (0.000 sec)
MariaDB [(none)]>
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| fb_ebmp |
| information_schema |
| lcs |
| mysql |
| oneshot_sms |
| performance_schema |
| server_audit |
+--------------------+
7 rows in set (0.031 sec)
MariaDB [(none)]> quit
Bye
[root@DEVSVR01 data]#
기본 설정된 datadir은 /var/lib/mysql 입니다.
2. mariabackup 설치
데이터 복원을 위해 새로 설치한 CentOS 가상 머신에 mariabackup 을 설치 해야 합니다.
[root@DEVSVR01 ~]# yum install MariaDB-backup
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* epel: mirror-jp.misakamikoto.network
* extras: mirror.kakao.com
* updates: mirror.navercorp.com
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-backup.x86_64 0:10.4.27-1.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================
Installing:
MariaDB-backup x86_64 10.4.27-1.el7.centos mariadb 6.6 M
Transaction Summary
=================================================================================================================================================================================
Install 1 Package
Total download size: 6.6 M
Installed size: 27 M
Is this ok [y/d/N]: y
Downloading packages:
MariaDB-backup-10.4.27-1.el7.centos.x86_64.rpm | 6.6 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : MariaDB-backup-10.4.27-1.el7.centos.x86_64 1/1
Verifying : MariaDB-backup-10.4.27-1.el7.centos.x86_64 1/1
Installed:
MariaDB-backup.x86_64 0:10.4.27-1.el7.centos
Complete!
이전 게시물에서 mariadb.repo에 버전을 지정했기 때문에 해당 버전에 맞는 mariabackup 이 설치 되었습니다.
3. 백업 데이터 복원
미리 운영 DB 에서 백업 받은 풀 데이터를 다운받아 두었습니다.
[root@DEVSVR01 ~]# cd /usr/download
[root@DEVSVR01 download]# ls -al
total 11994704
drwxr-xr-x. 3 root root 79 Dec 2 09:02 .
drwxr-xr-x. 14 root root 171 Dec 2 09:02 ..
drwx------. 8 root root 4096 Nov 27 04:43 PROD_full_20221127040001
-rw-r--r--. 1 root root 12282569817 Dec 1 20:12 PROD_full_20221127040001.tar.gz
[root@DEVSVR01 download]# cd PROD_full_20221127040001
[root@DEVSVR01 PROD_full_20221127040001]# ls -al
total 418276
drwx------. 8 root root 4096 Nov 27 04:43 .
drwxr-xr-x. 3 root root 79 Dec 2 09:02 ..
-rw-r-----. 1 root root 442368 Nov 27 04:43 aria_log.00000001
-rw-r-----. 1 root root 52 Nov 27 04:43 aria_log_control
-rw-r-----. 1 root root 391 Nov 27 04:43 backup-my.cnf
drwx------. 2 root root 12288 Nov 27 04:43 XXXXX
-rw-r-----. 1 root root 213909504 Nov 27 04:43 ibdata1
-rw-r-----. 1 root root 213909504 Nov 27 04:00 ibdata2
-rw-r-----. 1 root root 0 Nov 27 04:43 ib_logfile0
drwx------. 2 root root 4096 Nov 27 04:43 lcs
drwx------. 2 root root 4096 Nov 27 04:43 mysql
drwx------. 2 root root 4096 Nov 27 04:43 xxxxxxxxx
drwx------. 2 root root 20 Nov 27 04:43 performance_schema
drwx------. 2 root root 256 Nov 27 04:43 xxxxxxxxx
-rw-r-----. 1 root root 40 Nov 27 04:43 xtrabackup_binlog_info
-rw-r-----. 1 root root 85 Nov 27 04:43 xtrabackup_checkpoints
-rw-r-----. 1 root root 634 Nov 27 04:43 xtrabackup_info
[root@DEVSVR01 PROD_full_20221127040001]#
미리 만들어 놓은 datadir 때문에 복원을 하면서 에러가 발생합니다. /data/mysql를 삭제 한 후 다시 진행 했습니다.
[root@DEVSVR01 download]# which mariabackup
/usr/bin/mariabackup
[root@DEVSVR01 download]# mariabackup --copy-back --target-dir=/usr/download/PROD_full_20221127040001 --datadir=/var/lib/mysql --user root
mariabackup based on MariaDB server 10.4.27-MariaDB Linux (x86_64)
[00] 2022-12-02 12:13:55 Original data directory /var/lib/mysql is not empty!
[root@DEVSVR01 download]# mariabackup --copy-back --target-dir=/usr/download/PROD_full_20221127040001 --datadir=/data/mysql --user root
mariabackup based on MariaDB server 10.4.27-MariaDB Linux (x86_64)
[00] 2022-12-02 12:14:24 Original data directory /data/mysql is not empty!
[root@DEVSVR01 download]# rm -rf /data/mysql
[root@DEVSVR01 download]# mariabackup --copy-back --target-dir=/usr/download/PROD_full_20221127040001 --datadir=/data/mysql --user root
mariabackup based on MariaDB server 10.4.27-MariaDB Linux (x86_64)
[01] 2022-12-02 12:14:34 Copying ibdata1 to /data/mysql/ibdata1
... 생략...
[01] 2022-12-02 13:24:10 Copying ./aria_log_control to /data/mysql/aria_log_control
[01] 2022-12-02 13:24:10 ...done
[01] 2022-12-02 13:24:10 Copying ./aria_log.00000001 to /data/mysql/aria_log.00000001
[01] 2022-12-02 13:24:10 ...done
[01] 2022-12-02 13:24:10 Copying ./xtrabackup_info to /data/mysql/xtrabackup_info
[01] 2022-12-02 13:24:11 ...done
[00] 2022-12-02 13:24:11 completed OK!
[root@DEVSVR01 download]#
복원된 데이터를 확인하고 root 계정으로 생성된 데이터를 mysql:mysql 로 오너쉽을 변경합니다.
(서비스와 연관된 디렉토리 명은 xxxx로 마스킹 했습니다.)
[root@DEVSVR01 download]# ls -al /data
total 0
drwxr-xr-x. 4 root root 37 Dec 2 12:14 .
dr-xr-xr-x. 18 root root 236 Nov 30 18:46 ..
drwx------. 8 root root 212 Dec 2 13:24 mysql
drwxr-xr-x. 3 mysql mysql 18 Dec 2 11:57 mysql-logs
[root@DEVSVR01 download]# ls -al /data/mysql
total 418260
drwx------. 8 root root 212 Dec 2 13:24 .
drwxr-xr-x. 4 root root 37 Dec 2 12:14 ..
-rw-r-----. 1 root root 442368 Dec 2 13:24 aria_log.00000001
-rw-r-----. 1 root root 52 Dec 2 13:24 aria_log_control
drwx------. 2 root root 12288 Dec 2 12:59 xxxxx
-rw-r-----. 1 root root 213909504 Dec 2 12:14 ibdata1
-rw-r-----. 1 root root 213909504 Dec 2 12:14 ibdata2
drwx------. 2 root root 4096 Dec 2 12:59 xxxx
drwx------. 2 root root 4096 Dec 2 12:57 mysql
drwx------. 2 root root 4096 Dec 2 12:59 xxxxxx
drwx------. 2 root root 20 Dec 2 13:24 performance_schema
drwx------. 2 root root 256 Dec 2 13:24 xxxxxx
-rw-r-----. 1 root root 634 Dec 2 13:24 xtrabackup_info
[root@DEVSVR01 download]# chown -R mysql:mysql /data/mysql
[root@DEVSVR01 download]# ls -al /data/mysql
total 418260
drwx------. 8 mysql mysql 212 Dec 2 13:24 .
drwxr-xr-x. 4 root root 37 Dec 2 12:14 ..
-rw-r-----. 1 mysql mysql 442368 Dec 2 13:24 aria_log.00000001
-rw-r-----. 1 mysql mysql 52 Dec 2 13:24 aria_log_control
drwx------. 2 mysql mysql 12288 Dec 2 12:59 xxxx
-rw-r-----. 1 mysql mysql 213909504 Dec 2 12:14 ibdata1
-rw-r-----. 1 mysql mysql 213909504 Dec 2 12:14 ibdata2
drwx------. 2 mysql mysql 4096 Dec 2 12:59 xxxxx
drwx------. 2 mysql mysql 4096 Dec 2 12:57 mysql
drwx------. 2 mysql mysql 4096 Dec 2 12:59 xxxxxx
drwx------. 2 mysql mysql 20 Dec 2 13:24 performance_schema
drwx------. 2 mysql mysql 256 Dec 2 13:24 xxxxxx
-rw-r-----. 1 mysql mysql 634 Dec 2 13:24 xtrabackup_info
[root@DEVSVR01 download]#
/etc/my.cnf 를 수정해서 운영환경과 동일하게 맞추겠습니다.
[root@DEVSVR01 lib]# vi /etc/my.cnf
#
# This group is read both by the client and the server
# use it for options that affect everything
#
[mysqld]
# DB의 데이터가 생성될 기본 경로
datadir=/data/mysql
# 소켓파일 경로(로컬서버 접속에 사용), 리모트 서버에는 ip와 port를 이용해서 TCP/IP 프로토콜로 접근
socket=/data/mysql/mysql.sock
# 타입존 설정
default-time-zone='+9:00'
## General LOG
general_log=1
log_output='FILE'
general_log_file=/data/mysql-logs/logs/mysql_history.log
## Slow LOG
slow_query_log=1
slow_query_log_file=/data/mysql-logs/logs/mysql_slow.log
long_query_time=10
## Error LOG
log-error=/data/mysql-logs/logs/mysql_error.log
## Binary LOG
log-bin=/data/mysql-logs/logs/mysql_binary
binlog_cache_size=2M
max_binlog_size=50M
expire_logs_days=2
[client-server]
#
# include *.cnf from the config directory
#
!includedir /etc/my.cnf.d
~
~
~
~
~
[mysqld] 부분을 추가 하고 몇가지 설정을 추가 했습니다.
중요한 것은 위에서 복사한 경로를 지정 하는 datadir = /data/mysql 입니다. (저장 공간등의 이슈가 없으면 설치시 지정된 디렉토리 그대로 진행해도 관계 없습니다.)
3. 복원된 데이터로 mariadb 실행
[root@DEVSVR01 download]# systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@DEVSVR01 download]#
[root@DEVSVR01 download]# journalctl -xe
... 생략 ...
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [Note] /usr/sbin/mysqld (mysqld 10.4.27-MariaDB-log) starting as process 2831 ...
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [Warning] Can't create test file /data/mysql/DEVSVR01.lower-test
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: /usr/sbin/mysqld: Can't create file '/data/mysql-logs/logs/mysql_error.log' (errno: 13 "Permission denied")
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] mysqld: File '/data/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/data/mysql/aria_log_control'
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] Plugin 'Aria' init function returned error.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [Note] InnoDB: Using Linux native AIO
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] Plugin 'InnoDB' init function returned error.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [Note] Plugin 'FEEDBACK' is disabled.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] Failed to initialize plugins.
Dec 02 15:11:47 DEVSVR01 mysqld[2831]: 2022-12-02 15:11:47 0 [ERROR] Aborting
Dec 02 15:11:47 DEVSVR01 systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Dec 02 15:11:47 DEVSVR01 systemd[1]: Failed to start MariaDB 10.4.27 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
Dec 02 15:11:47 DEVSVR01 systemd[1]: Unit mariadb.service entered failed state.
Dec 02 15:11:47 DEVSVR01 systemd[1]: mariadb.service failed.
Dec 02 15:11:47 DEVSVR01 polkitd[582]: Unregistered Authentication Agent for unix-process:2782:16916940 (system bus name :1.134, object path /org/freedesktop/PolicyKit1/Authenti
[root@DEVSVR01 download]#
퍼미션 문제로 정상 실행이 안됩니다.
journalctl -xe 명령으로 원인을 찾아 보면
/usr/sbin/mysqld: Can't create file '/data/mysql-logs/logs/mysql_error.log' (errno: 13 "Permission denied") Dec 02 [ERROR] mysqld: File '/data/mysql/aria_log_control' not found (Errcode: 13 "Permission denied") Dec 02 15:11:47 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/data/mysql/aria_log_control'
mysql_error.log,
aria_log_control 등의 파일에 퍼미션이 없어서 실행이 안된다고 나옵니다.
[root@DEVSVR01 download]# ls -al /data/
total 0
drwxr-xr-x. 4 root root 37 Dec 2 12:14 .
dr-xr-xr-x. 18 root root 236 Nov 30 18:46 ..
drwx------. 8 mysql mysql 212 Dec 2 13:24 mysql
drwxr-xr-x. 3 mysql mysql 18 Dec 2 11:57 mysql-logs
[root@DEVSVR01 download]# chmod 755 /data/mysql
[root@DEVSVR01 download]# ls -al /data/
total 0
drwxr-xr-x. 4 root root 37 Dec 2 12:14 .
dr-xr-xr-x. 18 root root 236 Nov 30 18:46 ..
drwxr-xr-x. 8 mysql mysql 212 Dec 2 13:24 mysql
drwxr-xr-x. 3 mysql mysql 18 Dec 2 11:57 mysql-logs
[root@DEVSVR01 download]# ls -al /data/mysql
total 418260
drwxr-xr-x. 8 mysql mysql 212 Dec 2 13:24 .
drwxr-xr-x. 4 root root 37 Dec 2 12:14 ..
-rw-r-----. 1 mysql mysql 442368 Dec 2 13:24 aria_log.00000001
-rw-r-----. 1 mysql mysql 52 Dec 2 13:24 aria_log_control
drwx------. 2 mysql mysql 12288 Dec 2 12:59 xxxxxxx
-rw-r-----. 1 mysql mysql 213909504 Dec 2 12:14 ibdata1
-rw-r-----. 1 mysql mysql 213909504 Dec 2 12:14 ibdata2
drwx------. 2 mysql mysql 4096 Dec 2 12:59 xxxxxxx
drwx------. 2 mysql mysql 4096 Dec 2 12:57 mysql
drwx------. 2 mysql mysql 4096 Dec 2 12:59 xxxxxxx
drwx------. 2 mysql mysql 20 Dec 2 13:24 performance_schema
drwx------. 2 mysql mysql 256 Dec 2 13:24 xxxxxxx
-rw-r-----. 1 mysql mysql 634 Dec 2 13:24 xtrabackup_info
[root@DEVSVR01 download]#
[root@DEVSVR01 download]# semanage fcontext -a -t mysqld_db_t "/data/mysql(/.*)?"
-bash: semanage: command not found
[root@DEVSVR01 download]# semanage
-bash: semanage: command not found
[root@DEVSVR01 download]#
mysqld 는 정상 실행 되지만 접속하려고 하면 mysql.sock을 /var/lib/mysql/mysql.sock 에서 찾고 있습니다.
/etc/my.cnf를 수정 하면서 [mysqld] 섹션에 socket=/data/mysql/mysql.sock 라고 수정 했습니다. 이것은 mariadb 서버가 실행 될 때 참고 하는 섹션입니다. cli에서 mysql 을 접속 하는 것은 mysql client 로 서버에 접속하는 행위 이므로 mysql.sock 파일의 위치를 찾지 못하는 것 입니다.
[root@DEVSVR01 download]# systemctl start mariadb
[root@DEVSVR01 download]# mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@DEVSVR01 download]# vi /etc/my.cnf.d/
enable_encryption.preset mysql-clients.cnf server.cnf
[root@DEVSVR01 download]# vi /etc/my.cnf.d/mysql-clients.cnf
#
# These groups are read by MariaDB command-line tools
# Use it for options that affect only one utility
#
[mysql]
socket=/data/mysql/mysql.sock
[mysql_upgrade]
[mysqladmin]
[mysqlbinlog]
[mysqlcheck]
[mysqldump]
[mysqlimport]
[mysqlshow]
[mysqlslap]
~
~
~
~
~
~
~
:wq
/etc/my.cnf.d/mysql-clients.conf 에 [mysql] 섹션에 해당 소켓의 위치를 지정해 줍니다.
관리가 불편하면 /etc/my.cnf 파일 하단에 [mysql] 테그를 추가하고 해당 위치에 추가 해도 됩니다.
이외에 innodb 관련 설정들 몇가지가 달라서 mariadb 서버 실행에 에러가 발생했었습니다.
See "systemctl status mariadb.service" and "journalctl -xe" for details. 메시지 대로
journalctl -xe 명령으로 어디서 에러가 발생했는지 살펴 보시면서 하나씩 해결 하면 됩니다.
6. mariadb 실행 및 데이터 복원 확인
[root@DEVSVR01 download]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.4.27-MariaDB-log MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| fb_ebmp |
| information_schema |
| lcs |
| mysql |
| oneshot_sms |
| performance_schema |
| server_audit |
+--------------------+
7 rows in set (0.031 sec)
MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [mysql]> select user, host, password from user;
+---------------+--------------+-------------------------------------------+
| User | Host | Password |
+---------------+--------------+-------------------------------------------+
| mariadb.sys | localhost | |
| root | localhost | *보안삭제 |
| mysql | localhost | invalid |
... 생략 ...
+---------------+--------------+-------------------------------------------+
26 rows in set (0.001 sec)
MariaDB [mysql]>
MariaDB [(none)]> quit
Bye
[root@DEVSVR01 download]#
정상 복원이 완료 되었습니다.
7. 외부에서 접근하기 위해서는 OS 방화벽 설정이 필요합니다.
[root@DEVSVR01 download]# vi /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="ssh"/>
<service name="dhcpv6-client"/>
<!-- mariadb start -->
<rule family="ipv4">
<port protocol="tcp" port="3306"/>
<accept/>
</rule>
<!-- mariadb end -->
</zone>
~
~
~
~
~
~
~
~
~
[root@DEVSVR01 download]# firewall-cmd --reload
success
[root@DEVSVR01 download]#
우분투 버전 Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-52-generic x86_64)
기본적으로 X Window 가 설치되어 있는 상태에서 시작
주의 상용 서비스를 운영중인 또는 운영 예정인 서버에 GUI 환경을 설치하는 것은 매우 신중하시기 바랍니다. 미니멀 설치 외에 추가로 설치되는 많은 패키지들로 인한 보안 문제가 발생할 수 있으며, 그로 인한 잦은 업데이트 권고 및 업데이트 후 예상치 못한 상황으로 전개 될 수 있습니다.
0. 사용자를 root 로 전환 (sudo 명령을 사용하기 귀찮아서...)
myuser@myserver:~$ su -
Password:
root@myserver:~# id
uid=0(root) gid=0(root) groups=0(root)
root@myserver:~#
1. xrdp 설치
root@myserver:~# apt-get install xrdp
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
python3-cliapp python3-markdown python3-pygments python3-ttystatus
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libfuse2 xorg xorgxrdp
Suggested packages:
xorg-docs xfonts-100dpi xfonts-75dpi x11-xfs-utils guacamole
The following NEW packages will be installed:
libfuse2 xorg xorgxrdp xrdp
0 upgraded, 4 newly installed, 0 to remove and 64 not upgraded.
Need to get 675 kB of archives.
After this operation, 3,764 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libfuse2 amd64 2.9.9-5ubuntu3 [90.3 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 xrdp amd64 0.9.17-2ubuntu2 [517 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 xorg amd64 1:7.7+23ubuntu2 [2,890 B]
Get:4 http://archive.ubuntu.com/ubuntu jammy/universe amd64 xorgxrdp amd64 1:0.2.17-1build1 [65.3 kB]
Fetched 675 kB in 3s (265 kB/s)
Selecting previously unselected package libfuse2:amd64.
(Reading database ... 297274 files and directories currently installed.)
Preparing to unpack .../libfuse2_2.9.9-5ubuntu3_amd64.deb ...
Unpacking libfuse2:amd64 (2.9.9-5ubuntu3) ...
Selecting previously unselected package xrdp.
Preparing to unpack .../xrdp_0.9.17-2ubuntu2_amd64.deb ...
Unpacking xrdp (0.9.17-2ubuntu2) ...
Selecting previously unselected package xorg.
Preparing to unpack .../xorg_1%3a7.7+23ubuntu2_amd64.deb ...
Unpacking xorg (1:7.7+23ubuntu2) ...
Selecting previously unselected package xorgxrdp.
Preparing to unpack .../xorgxrdp_1%3a0.2.17-1build1_amd64.deb ...
Unpacking xorgxrdp (1:0.2.17-1build1) ...
Setting up libfuse2:amd64 (2.9.9-5ubuntu3) ...
Setting up xorg (1:7.7+23ubuntu2) ...
Setting up xorgxrdp (1:0.2.17-1build1) ...
Setting up xrdp (0.9.17-2ubuntu2) ...
Generating 2048 bit rsa key...
ssl_gen_key_xrdp1 ok
saving to /etc/xrdp/rsakeys.ini
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp-sesman.service → /lib/systemd/system/xrdp-sesman.service.
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp.service → /lib/systemd/system/xrdp.service.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...
The processor microcode seems to be up-to-date.
Restarting services...
systemctl restart avahi-daemon.service colord.service packagekit.service polkit.service
Service restarts being deferred:
/etc/needrestart/restart.d/dbus.service
systemctl restart gdm3.service
systemctl restart networkd-dispatcher.service
systemctl restart unattended-upgrades.service
systemctl restart user@1000.service
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@myserver:~
이상태에서 윈도우 원격데스크탑연결로 연결시 인증화면까지 진행되고 id / pw 입력 하면 윈도우가 종료된다.
구글링 구글링...
2. xrdp 유저, ssl-cert 그룹에 추가
root@myserver:~# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
... 생략...
xrdp:x:134:140::/run/xrdp:/usr/sbin/nologin
root@myserver:~#
root@myserver:~# adduser xrdp ssl-cert
Adding user `xrdp' to group `ssl-cert' ...
Adding user xrdp to group ssl-cert
Done.
root@myserver:~#
3. 방화벽 허용 (내부방 172.30.*.* 에서 접속 가능하도록 방화벽 정책 추가)
root@myserver:~# ufw allow from 172.30.0.0/16 to any port 3389
Rules updated
root@myserver:~# ufw reload
Firewall not enabled (skipping reload)
root@myserver:~# ufw status
Status: inactive
root@myserver:~#
우분투 방화벽은 활성화 되어 있지 않았음 (-.,-a)
사실 인증 화면까지 나왔다는 것은 방화벽 문제는 아니었음을...
4. xfce4 인스톨
구글링 결과 기본 xrdp 만으로는 버그로 인해 원격데스크톱연결이 잘 안되는 것 같다.
ubuntu-desktop과 xfce4 추가 인스톨
서두에서 언급한 보안 및 업데이트 문제로 상용 서비스에 사용하는 서버는 ubuntu-desktop 설치에 신중하시기 바랍니다.
root@myserver:~# apt install ubuntu-desktop
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
... 생략...
root@myserver:~# apt-get install xfce4 -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
python3-cliapp python3-markdown python3-pygments python3-ttystatus
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
dbus-x11 desktop-base elementary-xfce-icon-theme exo-utils fonts-quicksand gir1.2-libxfce4util-1.0 gir1.2-xfconf-0 greybird-gtk-theme libexo-2-0 libexo-common libgarcon-1-0 libgarcon-common libgarcon-gtk3-1-0 libkeybinder-3.0-0 libthunarx-3-0 libtumbler-1-0 libxfce4panel-2.0-4 libxfce4ui-2-0 libxfce4ui-common
libxfce4ui-utils libxfce4util-bin libxfce4util-common libxfce4util7 libxfconf-0-3 libxpresent1 pavucontrol tango-icon-theme thunar thunar-data thunar-volman tumbler tumbler-common xfce4-appfinder xfce4-helpers xfce4-notifyd xfce4-panel xfce4-pulseaudio-plugin xfce4-screensaver xfce4-session xfce4-settings
xfconf xfdesktop4 xfdesktop4-data xfwm4 xiccd
Suggested packages:
devhelp gnome-icon-theme kdelibs-data thunar-archive-plugin thunar-media-tags-plugin tumbler-plugins-extra xfce4-goodies xfce4-power-manager fortunes-mod
The following NEW packages will be installed:
dbus-x11 desktop-base elementary-xfce-icon-theme exo-utils fonts-quicksand gir1.2-libxfce4util-1.0 gir1.2-xfconf-0 greybird-gtk-theme libexo-2-0 libexo-common libgarcon-1-0 libgarcon-common libgarcon-gtk3-1-0 libkeybinder-3.0-0 libthunarx-3-0 libtumbler-1-0 libxfce4panel-2.0-4 libxfce4ui-2-0 libxfce4ui-common
libxfce4ui-utils libxfce4util-bin libxfce4util-common libxfce4util7 libxfconf-0-3 libxpresent1 pavucontrol tango-icon-theme thunar thunar-data thunar-volman tumbler tumbler-common xfce4 xfce4-appfinder xfce4-helpers xfce4-notifyd xfce4-panel xfce4-pulseaudio-plugin xfce4-screensaver xfce4-session
xfce4-settings xfconf xfdesktop4 xfdesktop4-data xfwm4 xiccd
0 upgraded, 46 newly installed, 0 to remove and 64 not upgraded.
Need to get 18.3 MB of archives.
After this operation, 88.5 MB of additional disk space will be used.
... 생략 ...
root@myserver:~#
설정 파일 수정
root@overtake:~# vi /etc/xrdp/startwm.sh
#!/bin/sh
# xrdp X session start script (c) 2015, 2017, 2021 mirabilos
# published under The MirOS Licence
# Rely on /etc/pam.d/xrdp-sesman using pam_env to load both
# /etc/environment and /etc/default/locale to initialise the
# locale and the user environment properly.
if test -r /etc/profile; then
. /etc/profile
fi
# 내용 추가
unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
# 실행 명령 변경
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession
test -x /usr/bin/startxfce4 && exec /usr/bin/startxfce4
exec /bin/sh /usr/bin/startxfce4
~
~
~
~
~
~
volumio@volumio:~$ sudo apt update
[sudo] password for volumio:
Hit:1 https://deb.nodesource.com/node_14.x buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
28 packages can be upgraded. Run 'apt list --upgradable' to see them.
volumio@volumio:~$
volumio@volumio:~$
volumio@volumio:~$
volumio@volumio:~/LCD-show/usr$ sudo apt install apt-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libapt-inst2.0
The following NEW packages will be installed:
apt-utils libapt-inst2.0
0 upgraded, 2 newly installed, 0 to remove and 31 not upgraded.
Need to get 600 kB of archives.
After this operation, 1529 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf libapt-inst2.0 armhf 1.8.2.3 [200 kB]
Get:2 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf apt-utils armhf 1.8.2.3 [400 kB]
Fetched 600 kB in 4s (151 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libapt-inst2.0:armhf.
(Reading database ... 53885 files and directories currently installed.)
Preparing to unpack .../libapt-inst2.0_1.8.2.3_armhf.deb ...
Unpacking libapt-inst2.0:armhf (1.8.2.3) ...
Selecting previously unselected package apt-utils.
Preparing to unpack .../apt-utils_1.8.2.3_armhf.deb ...
Unpacking apt-utils (1.8.2.3) ...
Setting up libapt-inst2.0:armhf (1.8.2.3) ...
Setting up apt-utils (1.8.2.3) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpt2+rpi1+deb10u1) ...
volumio@volumio:~/LCD-show/usr$ sudo apt install xserver-xorg-input-evdev
Reading package lists... Done
Building dependency tree
Reading state information... Done
xserver-xorg-input-evdev is already the newest version (1:2.10.6-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.
volumio@volumio:~$
volumio@volumio:~$
volumio@volumio:~$
volumio@volumio:~$ sudo apt install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libgpm2 vim-common vim-runtime xxd
Suggested packages:
gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
libgpm2 vim vim-common vim-runtime xxd
0 upgraded, 5 newly installed, 0 to remove and 31 not upgraded.
Need to get 7150 kB of archives.
After this operation, 33.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf xxd armhf 2:8.1.0875-5+deb10u2 [139 kB]
Get:2 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf vim-common all 2:8.1.0875-5+deb10u2 [195 kB]
Get:3 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf libgpm2 armhf 1.20.7-5 [34.4 kB]
Get:4 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf vim-runtime all 2:8.1.0875-5+deb10u2 [5775 kB]
Get:5 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf vim armhf 2:8.1.0875-5+deb10u2 [1006 kB]
Fetched 7150 kB in 15s (482 kB/s)
Selecting previously unselected package xxd.
(Reading database ... 51986 files and directories currently installed.)
Preparing to unpack .../xxd_2%3a8.1.0875-5+deb10u2_armhf.deb ...
Unpacking xxd (2:8.1.0875-5+deb10u2) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_2%3a8.1.0875-5+deb10u2_all.deb ...
Unpacking vim-common (2:8.1.0875-5+deb10u2) ...
Selecting previously unselected package libgpm2:armhf.
Preparing to unpack .../libgpm2_1.20.7-5_armhf.deb ...
Unpacking libgpm2:armhf (1.20.7-5) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a8.1.0875-5+deb10u2_all.deb ...
Adding 'diversion of /usr/share/vim/vim81/doc/help.txt to /usr/share/vim/vim81/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim81/doc/tags to /usr/share/vim/vim81/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.1.0875-5+deb10u2) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a8.1.0875-5+deb10u2_armhf.deb ...
Unpacking vim (2:8.1.0875-5+deb10u2) ...
Setting up libgpm2:armhf (1.20.7-5) ...
Setting up xxd (2:8.1.0875-5+deb10u2) ...
Setting up vim-common (2:8.1.0875-5+deb10u2) ...
Setting up vim-runtime (2:8.1.0875-5+deb10u2) ...
Setting up vim (2:8.1.0875-5+deb10u2) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/da/man1/vi.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/de/man1/vi.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/fr/man1/vi.1.gz because associated file /usr/share/man/fr/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/it/man1/vi.1.gz because associated file /usr/share/man/it/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ja/man1/vi.1.gz because associated file /usr/share/man/ja/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/pl/man1/vi.1.gz because associated file /usr/share/man/pl/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ru/man1/vi.1.gz because associated file /usr/share/man/ru/man1/vim.1.gz (of link group vi) doesn't exist
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/da/man1/view.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/de/man1/view.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/fr/man1/view.1.gz because associated file /usr/share/man/fr/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/it/man1/view.1.gz because associated file /usr/share/man/it/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ja/man1/view.1.gz because associated file /usr/share/man/ja/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/pl/man1/view.1.gz because associated file /usr/share/man/pl/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ru/man1/view.1.gz because associated file /usr/share/man/ru/man1/vim.1.gz (of link group view) doesn't exist
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/da/man1/ex.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/de/man1/ex.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/fr/man1/ex.1.gz because associated file /usr/share/man/fr/man1/vim.1.gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/it/man1/ex.1.gz because associated file /usr/share/man/it/man1/vim.1.gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ja/man1/ex.1.gz because associated file /usr/share/man/ja/man1/vim.1.gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/pl/man1/ex.1.gz because associated file /usr/share/man/pl/man1/vim.1.gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ru/man1/ex.1.gz because associated file /usr/share/man/ru/man1/vim.1.gz (of link group ex) doesn't exist
update-alternatives: warning: forcing reinstallation of alternative /bin/nano because link group editor is broken
update-alternatives: warning: skip creation of /usr/share/man/man1/editor.1.gz because associated file /usr/share/man/man1/nano.1.gz (of link group editor) doesn't exist
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.28-10+rpt2+rpi1+deb10u1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for mime-support (3.62) ...
volumio@volumio:~$
volumio@volumio:~/LCD-show/usr$ sudo vi /boot/config.txt
display_auto_detect=1
disable_overscan=1
initramfs volumio.initrd
gpu_mem=32
max_usb_current=1
dtparam=audio=on
audio_pwm_mode=2
dtparam=i2c_arm=on
dtparam=spi=on
disable_splash=1
hdmi_force_hotplug=1
force_eeprom_read=0
include userconfig.txt
#### Volumio i2s setting below: do not alter ####
dtoverlay=iqaudio-dacplus,unmute_amp
dtoverlay=tft35a:rotate=270
~
~
~
~
11 fbdurbo.conf 수정
volumio@volumio:~$ sudo vi /usr/share/X11/xorg.conf.d/99-fbturbo.conf
# This is a minimal sample config file, which can be copied to
# /etc/X11/xorg.conf in order to make the Xorg server pick up
# and load xf86-video-fbturbo driver installed in the system.
#
# When troubleshooting, check /var/log/Xorg.0.log for the debugging
# output and error messages.
#
# Run "man fbturbo" to get additional information about the extra
# configuration options for tuning the driver.
Section "Device"
Identifier "Allwinner A10/A13 FBDEV"
Driver "fbturbo"
Option "fbdev" "/dev/fb1"
Option "SwapbuffersWait" "true"
EndSection
~
~
~
~
volumio@volumio:~$
11. xserver 설치
volumio@volumio:~/LCD-show/usr$ sudo apt install xserver-xorg-input-evdev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
xserver-xorg-input-evdev
0 upgraded, 1 newly installed, 0 to remove and 31 not upgraded.
Need to get 117 kB of archives.
After this operation, 170 kB of additional disk space will be used.
Get:1 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf xserver-xorg-input-evdev armhf 1:2.10.6-1+b1 [117 kB]
Fetched 117 kB in 2s (62.5 kB/s)
Selecting previously unselected package xserver-xorg-input-evdev.
(Reading database ... 53875 files and directories currently installed.)
Preparing to unpack .../xserver-xorg-input-evdev_1%3a2.10.6-1+b1_armhf.deb ...
Unpacking xserver-xorg-input-evdev (1:2.10.6-1+b1) ...
Setting up xserver-xorg-input-evdev (1:2.10.6-1+b1) ...
Processing triggers for man-db (2.8.5-2) ...
volumio@volumio:~/LCD-show/usr$
volumio@volumio:~/LCD-show/usr$
volumio@volumio:~/LCD-show/usr$ sudo apt-get install xserver-xorg-video-fbturbo
12. volumio 실행 설정
volumio@volumio:~$ sudo vi /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
[ -d /etc/boot.d ] && run-parts /etc/boot.d
/usr/bin/xinit /usr/bin/chromium-browser --no-sandbox --no-first-run --noerrdialogs --start-fullscreen --start-maximized --disable-notifications --disable-infobars --kiosk --incognito http://localhost:3000 &
exit 0
~
~
~
~
volumio@volumio:~$
1. MySQL 서버 중지
[root@localhost ~]# systemctl stop mysqld
2. MySQL 환경변수 설정
[root@localhost ~]# systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
3. MySQL 서버 가동
[root@localhost ~]# systemctl start mysqld
4. 비번 없이 root 로그인
[root@localhost ~]# mysql -u root
5. root 비밀번호 업데이트
mysql> UPDATE mysql.user SET authentication_string = PASSWORD('새비밀번호')
-> WHERE User = 'root' AND Host = 'localhost';
ERROR 1348 (HY000): Column 'authentication_string' is not updatable
마리아 DB 10.4.12 에서는 위와 같은 방법으로는 에러가 발생합니다.
아래 방법으로 해결 가능합니다.
mysql> ALTER mysql.user 'root'@'localhost' identified by '새비밀번호';
Query OK, 0 rows affected (0.012 sec)
mysql> COMMIT;
mysql> FLUSH PRIVILEGES;
mysql> quit
6. MySQL 중지
[root@localhost ~]# systemctl stop mysqld
7. MySQL 환경변수 초기화
[root@localhost ~]# systemctl unset-environment MYSQLD_OPTS
8. MySQL 서버 시작
[root@localhost ~]# systemctl start mysqld
9. 새 비밀번호로 로그인 확인
[root@localhost ~]# mysql -u root -p
참고로 user 테이블이 변경 된것은 user 테이블의 접근을 쿼리가 아닌 시스템 명령으로 하면 큰 차이는 없을 것 같습니다.
MySQL 공식 문서에서도
alter user 'root'@'localhost' identified by '새비밀번호';
언젠가 카드사 홈페이지 회원가입에 주민번호를 입력해도 주민번호를 확인하라고 계속 뜬다고 해서 확인해 보니, 189? 년생 여자분... 기존에 개발 하신 분이 1,2만 체크하도록 만들어 놓으신 것인데, 그때가 100살이 넘은 분이 직접 카드사 홈페이지에 회원가입을 할리는 없고 아들이 본인 신용상의 문제로 어머니(할머니?) 주민번호로 카드를 발급한 상태였음
3. 지역코드
성별 다음 4자리는 지역 코드 (주민번호 지역코드 정도로 구글링 하면 많은 정보가 나온다)
4. 순차번호
다음으로 뒷자리 7개 숫자중 끝에서 두번째 자리는 같은 지역에서 같은날 여러명이 태어난 경우를 대비해 만들어 놓은 순차 번호이다.
5. Check Digit
맨마지막 1자리는 앞의 자리가 정상적으로 입력되었는지 확인하는 Check Digit 이다. 예전에 전산을 처음 배울때Check Digit을 구하는 공식은 국가2급 기밀이라고 했었는데, 요즘 인터넷에 검색해 보면 수도 없이 나온다.
실명인증으로 대체
최근에는 개인정보 중요성이 대두되면서 주민번호 뒷자리까지 입력받는 경우는 의료나, 금융쪽밖에 없다. 웬만해선 이름+생년월일+성별로 대부분 식별이 가능하니 구지 주민번호 뒷자리까지 공개하지 않고 있다. 그리고 그것을 이용하여 신용평가회사 등에서 휴대폰 등을 통해 확인을 해주는 방식을 쓰고 있다.
위에 이야기 했던 카드사쇼핑몰에서 일하던 시절... 회원가입하면서 주민번호가 잘못되었다는 메시지가 계속 나온다고해서 확인해 보니 80세 여성고객의 자제분 새로 카드를 만들려고 하는데 주민번호 인증이 안된다고 연락이 왔다... 이분은 1900년대 생으로 주민번호 성별이 잘못된 케이스도 아님... 당시 실명인증을 대행하던 신평사에 문의했더니 진짜 없는 주민번호라고... 어째 그럴수가 있을까?
신용평가사는 금융결재원에서 전국민이 이용한 금융거래 기록에서 이름과 주민번호를 제공받아서 그것으로 장사를 하는 것이다.
그분은 80세가 넘도록 금융거래를 한번도 한적이 없었던 분으로 판명됨.
주민번호 중복 가능성
현재의 주민번호 체계는 같은지역(읍/면/동)에서 같은날 출생신고를 하는 동성의 사람이 10명을 초과 하게 되면 주민번호가 중복 될수 밖에 없는 구조이다. 앞의 11자리는 모두 동일할 것이고 순차번호는 0~9까지 10명 밖에 수용하지 못한다. 과거에 인구가 적던 시절에 만들어진 체계 이기 때문에 현실적으로 서울의 큰 동에서는 이를 초과하는 경우가 발생할 수도 있을 것 같다.(실제 있을것 같은데... 어떻게 하는지는 잘 모르겠음)
물론 현재 의 출산율을 봤을 때 인구가 줄어드는 상황으로 큰 문제는 없을 것 같다는 생각이...
2020.02.07 추가 : 최근 뉴스에서 주민번호 지역코드를 전국으로 통합하겠다고 하는 기사를 본것 같다. 아마도 주민번호4자리 + 순차코드 1자리로 대도시의 출생률에 대응하는데 문제가 있어서 아닐까?
성별코드 고갈
성별코드 역시 0~9까지 모두 사용한 상태이다. 향후 2100년(...그때 까지 살 수 있을까?) 이후에는 새로운 성별코드가 필요하다. 그때가 되면 현재의 주민번호 체계가 아닌 다른 체계의 인식코드를 사용하거나, 설마... 현재의 주민번호 체계를 그때까지 계속 쓴다면 1800년대 생을 위해 할당되었던 0,9를 재활용하지 않을까... 그때 되면 데이타 마이그레이션 할 일이 많을까? 어쩌면.... 2100년에 호모사피엔스가 지구에 존재하지 않을수도...