728x90

출처

리눅스 버전 확인

pi@raspberrypi:~$ uname -a
Linux raspberrypi 6.6.20+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

도커 설치

pi@raspberrypi:~$ curl -sSL https://get.docker.com | sh

도커 버전 확인

pi@raspberrypi:~$ sudo docker version
Client: Docker Engine - Community
 Version:           26.0.0
 API version:       1.45

도커 허브에서 Oracle 데이터베이스용 이미지 다운로드

pi@raspberrypi:~$ sudo docker pull bluexmas/aarch64_oracle_db_19
Using default tag: latest
latest: Pulling from bluexmas/aarch64_oracle_db_19
ea4e27ae0b4c: Pull complete 
60e14e4a36dc: Pull complete 
2459d70df083: Pull complete 
43588f5a3c30: Pull complete 
fd59129c6b98: Pull complete 
f4347f997964: Pull complete 
b1a1518d1ad3: Pull complete 
051a9330efaf: Pull complete 
7145497f1832: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:276c6358c179efab39be868b6a8368df57c29210f0370c2e2cec9017f7b54dc2
Status: Downloaded newer image for bluexmas/aarch64_oracle_db_19:latest
docker.io/bluexmas/aarch64_oracle_db_19:latest

이미지 조회

pi@raspberrypi:~$ sudo docker images
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
bluexmas/aarch64_oracle_db_19   latest    73ebf0277483   2 hours ago   5.89GB

환경변수 추가

pi@raspberrypi:~$ vi ~/.profile
CONTAINER_NAME=ORCL
ORADATA=~/oracle-docker/oradata

환경변수 적용

pi@raspberrypi:~$ source ~/.profile

데이터 디렉터리 및 Docker 볼륨 만들기

 for dir in audit data diag reco
  do mkdir -p $ORADATA/${CONTAINER_NAME}/${dir}
     rm -fr $ORADATA/${CONTAINER_NAME}/${dir}/*
     sudo docker volume rm ${CONTAINER_NAME}_${dir} 2>/dev/null
     sudo docker volume create --opt type=none --opt o=bind \
            --opt device=$ORADATA/${CONTAINER_NAME}/${dir} \
            ${CONTAINER_NAME}_${dir}
done
pi@raspberrypi:~$  for dir in audit data diag reco
>   do mkdir -p $ORADATA/${CONTAINER_NAME}/${dir}
>      rm -fr $ORADATA/${CONTAINER_NAME}/${dir}/*
>      sudo docker volume rm ${CONTAINER_NAME}_${dir} 2>/dev/null
>      sudo docker volume create --opt type=none --opt o=bind \
>             --opt device=$ORADATA/${CONTAINER_NAME}/${dir} \
>             ${CONTAINER_NAME}_${dir}
> done
ORCL_audit
ORCL_data
ORCL_diag
ORCL_reco

도커 이미지에서 디렉토리 권한이 없으므로 디렉토리 권한 해제

pi@raspberrypi:~$ cd oracle-docker/oradata/
pi@raspberrypi:~/oracle-docker/oradata$ sudo chmod 777 -Rf ORCL
pi@raspberrypi:~/oracle-docker/oradata$ cd ORCL
pi@raspberrypi:~/oracle-docker/oradata/ORCL$ ls -al
합계 24
drwxrwxrwx 6 pi pi 4096  3월 23일  21:58 .
drwxr-xr-x 3 pi pi 4096  3월 23일  21:58 ..
drwxrwxrwx 2 pi pi 4096  3월 23일  21:58 audit
drwxrwxrwx 2 pi pi 4096  3월 23일  21:58 data
drwxrwxrwx 2 pi pi 4096  3월 23일  21:58 diag
drwxrwxrwx 2 pi pi 4096  3월 23일  21:58 reco

Oracle Docker 이미지 실행

sudo docker run -d \
    --name ${CONTAINER_NAME} \
    --volume ${CONTAINER_NAME}_data:/u02/app/oracle/oradata \
    --volume ${CONTAINER_NAME}_diag:/u01/app/oracle/diag \
    --volume ${CONTAINER_NAME}_audit:/u01/app/oracle/admin \
    --volume ${CONTAINER_NAME}_reco:/u03/app/oracle \
    --volume $ORADATA/scripts:/scripts \
    -e ORACLE_SID=${CONTAINER_NAME} \
    -e ORACLE_PDB=${CONTAINER_NAME}PDB1 \
    -p 8080:8080 \
    -p 1521:1521 \
    bluexmas/aarch64_oracle_db_19
pi@raspberrypi:~$ sudo docker run -d \
>     --name ${CONTAINER_NAME} \
>     --volume ${CONTAINER_NAME}_data:/u02/app/oracle/oradata \
>     --volume ${CONTAINER_NAME}_diag:/u01/app/oracle/diag \
>     --volume ${CONTAINER_NAME}_audit:/u01/app/oracle/admin \
>     --volume ${CONTAINER_NAME}_reco:/u03/app/oracle \
>     --volume $ORADATA/scripts:/scripts \
>     -e ORACLE_SID=${CONTAINER_NAME} \
>     -e ORACLE_PDB=${CONTAINER_NAME}PDB1 \
>     -p 8080:8080 \
>     -p 1521:1521 \
>     bluexmas/aarch64_oracle_db_19
cb12a2d9068bdb4ccf34ab033bfcc5ea9a9222f6d397a783995a1fb9da9393af

도커 실행 로그 확인

pi@raspberrypi:~$ sudo docker logs -f $CONTAINER_NAME
cat: /sys/fs/cgroup/memory.max: No such file or directory
ERROR: There was a problem getting the cgroups memory limit on the system
Exiting...
 
## ----------------------------------------------------------------------------------------------- #
  Oracle password for SYS, SYSTEM and PDBADMIN: muPGi2X9#b6J_7 
## ----------------------------------------------------------------------------------------------- #
 
## ----------------------------------------------------------------------------------------------- #
  runDBCA: Running DBCA for database ORCL at 2024-03-23 12:59:41
## ----------------------------------------------------------------------------------------------- #
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 23-MAR-2024 12:59:41
 
Copyright (c) 1991, 2023, Oracle.  All rights reserved.
 
Starting /u01/app/oracle/product/19.19/dbhome_1/bin/tnslsnr: please wait...
 
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.19/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/cb12a2d9068b/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                23-MAR-2024 12:59:41
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.19/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/cb12a2d9068b/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
 
## ----------------------------------------------------------------------------------------------- #
  runDBCA: Creating container database ORCL and 1 pluggable database(s) with name ORCLPDB1 at 2024-03-23 12:59:41
## ----------------------------------------------------------------------------------------------- #
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ORCL.
Database Information:
Global Database Name:ORCL
System Identifier(SID):ORCL
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details.
 
Pluggable database altered.
 
 
Pluggable database altered.
 
 
## ----------------------------------------------------------------------------------------------- #
  runDBCA: DBCA complete at 2024-03-23 13:09:10
## ----------------------------------------------------------------------------------------------- #
 
## ----------------------------------------------------------------------------------------------- #
  Database ORCL with unique name ORCL is open and available. 
## ----------------------------------------------------------------------------------------------- #
 
## ----------------------------------------------------------------------------------------------- #
  Tailing alert_ORCL.log: 
2024-03-23T13:09:09.405148+00:00
ORCLPDB1(3):CREATE SMALLFILE TABLESPACE "USERS" LOGGING  DATAFILE  SIZE 5M AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED  EXTENT MANAGEMENT LOCAL  SEGMENT SPACE MANAGEMENT  AUTO
ORCLPDB1(3):Completed: CREATE SMALLFILE TABLESPACE "USERS" LOGGING  DATAFILE  SIZE 5M AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED  EXTENT MANAGEMENT LOCAL  SEGMENT SPACE MANAGEMENT  AUTO
ORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
2024-03-23T13:09:10.226142+00:00
alter pluggable database all open
Completed: alter pluggable database all open
alter pluggable database all save state
Completed: alter pluggable database all save state

컨테이너 ID 확인

pi@raspberrypi:~$ sudo docker ps 
CONTAINER ID   IMAGE                           COMMAND                   CREATED          STATUS                    PORTS                                                                                            NAMES
cb12a2d9068b   bluexmas/aarch64_oracle_db_19   "/bin/sh -c 'exec $D…"   10 minutes ago   Up 10 minutes (healthy)   0.0.0.0:1521->1521/tcp, :::1521->1521/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 5500/tcp   ORCL

SQLPlus 접속

pi@raspberrypi:~$ sudo docker exec -it cb12a2d9068b sqlplus
 
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 23 13:11:36 2024
Version 19.19.0.0.0
 
Copyright (c) 1982, 2023, Oracle.  All rights reserved.
 
Enter user-name: SYSTEM
Enter password: 
Last Successful login time: Sat Mar 23 2024 13:05:14 +00:00
 
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
 
SQL> select TABLESPACE_NAME from DBA_TABLESPACES;
 
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
 
SQL> 
728x90
728x90

출처

카메라 모듈 연결 확인

pi@raspberrypi:~$ vcgencmd get_camera
supported=1 detected=1, libcamera interfaces=0

사진 찍기

pi@raspberrypi:~$ raspistill -o picture1.jpg

Python으로 사진 찍기

Python 소스 코드 작성

pi@raspberrypi:~$ vi camera_capture.py

camera_capture.py

import picamera
import time

camera = picamera.PiCamera()
camera.resolution = (2592, 1944) # (64, 64) ~ (2592, 1944) px

time.sleep(3)
camera.capture('snapshot.jpg')

실행

pi@raspberrypi:~$ python camera_capture.py

 

 

728x90
728x90

출처

WiFi 상태 확인

pi@raspberrypi:~$ iwconfig
lo        no wireless extensions.
 
eth0      no wireless extensions.
 
wlan0     IEEE 802.11  ESSID:"bluexmas"  
          Mode:Managed  Frequency:2.452 GHz  Access Point: 88:36:6C:45:F7:B0   
          Bit Rate=58.5 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=62/70  Signal level=-48 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:0   Missed beacon:0

SSID 목록 조회

pi@raspberrypi:~$ sudo iwlist wlan0 scan | grep SSID
                    ESSID:"U+Net7CCC"
                    ESSID:"bluexmas"
                    ESSID:"U+Net6519_5G"
                    ESSID:"Robin"
                    ESSID:"U+Net6519"
                    ESSID:"SK_WiFiGIGA71B1"
                    ESSID:"SK_WiFiGIGA71B1_2.4G"
                    ESSID:"\x00\x00\x00\x00\x00\x00\x00"
                    ESSID:"U+Net7CCC_5G"
                    ESSID:"\x00\x00\x00\x00\x00\x00\x00"

숨겨진 SSID 연결

scan_ssid값이 1인 경우 숨겨진 SSID 연결 설정

pi@raspberrypi:~$ cat /etc/wpa_supplicant/wpa_supplicant.conf 
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
 
network={
       ssid="bluexmas5G"
       scan_ssid=1
       psk="test1234" 
}

Network Manager 변경

pi@raspberrypi:~$ sudo raspi-config

NetworkManager 실행 상태 확인

pi@raspberrypi:~$ sudo systemctl status NetworkManager 
● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/NetworkManager.service.d
             └─10-dhcpcd.conf
     Active: active (running) since Sat 2024-01-27 01:57:21 GMT; 4min 3s ago
       Docs: man:NetworkManager(8)
   Main PID: 496 (NetworkManager)
      Tasks: 3 (limit: 4088)
        CPU: 681ms
     CGroup: /system.slice/NetworkManager.service
             └─496 /usr/sbin/NetworkManager --no-daemon
 
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3284] device (wlan0): state change: ip-config -> ip-check (r>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3382] device (wlan0): state change: ip-check -> secondaries >
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3390] device (wlan0): state change: secondaries -> activated>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3405] manager: NetworkManager state is now CONNECTED_LOCAL
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3541] manager: NetworkManager state is now CONNECTED_SITE
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3547] policy: set 'bluexmas' (wlan0) as default for IPv4 routing>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3557] dns-mgr: Writing DNS information to /sbin/resolvconf
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.4547] device (wlan0): Activation: successful, device activat>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.4568] manager: NetworkManager state is now CONNECTED_GLOBAL
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.4589] manager: startup complete

NetworkManager 연결 정보 확인

pi@raspberrypi:~$ cd /etc/NetworkManager/system-connections
pi@raspberrypi:/etc/NetworkManager/system-connections$ ls
bluexmas.nmconnection
pi@raspberrypi:/etc/NetworkManager/system-connections$ sudo cat bluexmas.nmconnection 
[connection]
id=bluexmas
uuid=db18715a-410e-4c57-8fc3-475a7391faec
type=wifi
interface-name=wlan0
permissions=
timestamp=1706314246
 
[wifi]
mac-address-blacklist=
mode=infrastructure
seen-bssids=88:36:6C:45:F7:B0;
ssid=bluexmas
 
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=s2u2n4g6
 
[ipv4]
dns-search=
method=auto
 
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
 
[proxy]
728x90
728x90

출처

Raspberry PI 시스템 업그레이드

pi@raspberrypi:~$ sudo apt update
pi@raspberrypi:~$ sudo apt upgrade

MongoDB 설치

빌드 도구 맟 관련 패키지 설치

pi@raspberrypi:~$ sudo apt-get install gcc-8 g++-8
pi@raspberrypi:~$ sudo apt-get install libssl-dev libcurl4-openssl-dev

Mongo DB 소스 다운로드

pi@raspberrypi:~$ git clone -b r4.4.0 https://github.com/mongodb/mongo.git
pi@raspberrypi:~$ cd mongo/

MongoDB GPG 서명 키 추가

pi@raspberrypi:~$ wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK

MongoDB에 대한 스토리지 엔진 및 복제를 구성한 다음 MongoDB 서비스를 시작

$ sudo sed -i "s/^#  engine:/  engine: wiredTiger/"  /etc/mongod.conf
$ sudo sed -i "s/^#replication:/replication:\n  replSetName: rs01/" /etc/mongod.conf

MongoDB 서비스 시작 및 활성화

bluesanta@Kubuntu:~$ sudo systemctl daemon-reload
bluesanta@Kubuntu:~$ sudo systemctl enable mongod
Created symlink /etc/systemd/system/multi-user.target.wants/mongod.service → /lib/systemd/system/mongod.service.
bluesanta@Kubuntu:~$ sudo systemctl restart mongod

MongoDB 서비스 확인

bluesanta@Kubuntu:~$ systemctl status mongod
● mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-05-24 01:28:11 KST; 5s ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 287216 (mongod)
     Memory: 65.2M
     CGroup: /system.slice/mongod.service
             └─287216 /usr/bin/mongod --config /etc/mongod.conf
 
 5월 24 01:28:11 Kubuntu systemd[1]: Started MongoDB Database Server.
 5월 24 01:28:11 Kubuntu mongod[287216]: /usr/bin/mongod: /usr/local/lib/libcurl.so.4: no version information available (required by >

MongoDB 테스트

bluesanta@Kubuntu:~$ mongo --eval "printjson(rs.initiate())"
MongoDB shell version v5.0.8
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("63537e3c-d3f1-42df-8158-043e7a759f3c") }
MongoDB server version: 5.0.8
{
        "info2" : "no configuration specified. Using a default configuration for the set",
        "me" : "127.0.0.1:27017",
        "ok" : 1
}

MongoDB 로그 확인

bluesanta@Kubuntu:~$ sudo tail -f /var/log/mongodb/mongod.log

 

 

 

빌드오류

Creating 'build/opt/mongo/resmoke/resmoke.py'
Creating 'build/opt/mongo/config.h'
/usr/bin/python3 src/mongo/base/generate_error_codes.py src/mongo/base/error_codes.yml src/mongo/base/error_codes.tpl.h build/opt/mongo/base/error_codes.h
Install file: "build/opt/mongo/resmoke/resmoke.py" as "build/install/bin/resmoke.py"
Chmod("build/install/bin/resmoke.py", "u+x")
Compiling build/opt/third_party/mozjs-60/extract/mozglue/misc/ConditionVariable_posix.o
cc1plus: fatal error: js-confdefs.h: No such file or directory
compilation terminated.
scons: *** [build/opt/third_party/mozjs-60/extract/mozglue/misc/ConditionVariable_posix.o] Error 1
Generating build/opt/mongo/db/logical_session_id_gen.cpp
/usr/bin/python3 src/mongo/base/generate_error_codes.py src/mongo/base/error_codes.yml src/mongo/base/error_codes.tpl.cpp build/opt/mongo/base/error_codes.cpp
scons: building terminated because of errors.
build/opt/third_party/mozjs-60/extract/mozglue/misc/ConditionVariable_posix.o failed: Error 1

몽고 DB 삭제 방법

bluesanta@Kubuntu:~$ sudo apt-get remove mongodb-org
bluesanta@Kubuntu:~$ sudo apt-get purge mongodb-org*
bluesanta@Kubuntu:~$ sudo rm -rf /var/log/mongodb
bluesanta@Kubuntu:~$ sudo rm -rf /var/lib/mongodb
728x90
728x90

출처

리눅스 정보 조회

출처 : 리눅스 종류 확인, 리눅스 버전 확인 - 제타위키

pi@raspberrypi:~$ cat /etc/*-release | uniq
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

리눅스 비트 확인

출처 : 리눅스 32비트 64비트 확인 - 제타위키

pi@raspberrypi:~$ getconf LONG_BIT
32

관련패키지 설치

pi@raspberrypi:~$ sudo apt install gcc g++ libncurses5-dev libxml2-dev openssl libssl-dev curl libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libsasl2-dev autoconf libncurses5-dev

MySQL 계정 만들기

pi@raspberrypi:~$ sudo groupadd mysql
pi@raspberrypi:~$ sudo useradd -g mysql -s /bin/bash -m mysql

cmake 설치

pi@raspberrypi:~$ sudo apt-get install cmake

MySQL 소스 다운로드, 압축해제, 컴파일, 설치

pi@raspberrypi:~$ wget https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-5.7.35.tar.gz 
pi@raspberrypi:~$ tar xvf mysql-boost-5.7.35.tar.gz 
pi@raspberrypi:~$ cd mysql-5.7.35
pi@raspberrypi:~/mysql-5.7.35$ sudo cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql57 \
-DMYSQL_DATADIR=/usr/local/mysql57/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql57/mysql.sock \
-DSYSCONFDIR=/usr/local/mysql57 \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_USER=mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DDOWNLOAD_BOOST=0 -DWITH_BOOST=./boost
pi@raspberrypi:~/mysql-5.7.35$ sudo make 
pi@raspberrypi:~/mysql-5.7.35$ sudo make install

환경설정

$ sudo vi /usr/local/mysql57/my.cnf

my.cnf

[mysqld]
port=8017
# basedir=/usr/local/mysql57
# datadir=/usr/local/mysql57/data
# pid-file=/usr/local/mysql57/mysqld.pid
# log_error=/usr/local/mysql57/mysql_error.log
# lc-messages-dir=/usr/local/mysql57/share

init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
character-set-server=utf8
collation-server=utf8_general_ci
# table_cache=1024
max_connections=2048
max_user_connections=500
max_connect_errors=10000
wait_timeout=300
query_cache_type = 1
query_cache_size = 128M
query_cache_limit = 5M
slow_query_log
long_query_time=3
max_allowed_packet=16M
sort_buffer_size = 2M
# skip-innodb
skip-name-resolve
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

skip_ssl
# disable_ssl

[mysql]
default-character-set=utf8

[client]
default-character-set=utf8

MySQL 설치 디렉토리 mysql 계정으로 권한 수정

pi@raspberrypi:~/mysql-5.7.35$ sudo chown -R mysql:mysql /usr/local/mysql57

MySQL 데이터베이스 초기화 (mysql 계정으로 실행)

pi@raspberrypi:~/mysql-5.7.35$ su mysql
Password: 
mysql@raspberrypi:/home/pi/mysql-5.7.35$ whoami
mysql
mysql@raspberrypi:/home/pi/mysql-5.7.35$ cd /usr/local/mysql57
mysql@raspberrypi:/usr/local/mysql57$ bin/mysql_install_db --no-defaults --user=mysql --datadir=/usr/local/mysql57/data --basedir=/usr/local/mysql57 -v
2021-12-19 09:54:25 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2021-12-19 09:54:25 [NOTE]    Creating data directory /usr/local/mysql57/data
2021-12-19 09:54:25 [NOTE]    Generating random password to /home/mysql/.mysql_secret...done.
2021-12-19 09:54:25 [NOTE]    Executing /usr/local/mysql57/bin/mysqld --no-defaults --bootstrap --datadir=/usr/local/mysql57/data --lc-messages-dir=/usr/local/mysql57/share --lc-messages=en_US --basedir=/usr/local/mysql57
2021-12-19 09:54:55 [NOTE]    Creating system tables...done.
2021-12-19 09:54:55 [NOTE]    Filling system tables with data...done.
2021-12-19 09:55:00 [NOTE]    Filling help table with data...done.
2021-12-19 09:55:00 [NOTE]    Creating user for internal session service...done.
2021-12-19 09:55:00 [NOTE]    Creating default user root@localhost
2021-12-19 09:55:00 [NOTE]    Creating default proxy root@localhost
2021-12-19 09:55:00 [NOTE]    Creating sys schema
2021-12-19 09:55:02 [NOTE]    done.
2021-12-19 09:55:03 [WARNING] The bootstrap log isn't empty:
2021-12-19 09:55:03 [WARNING] 2021-12-19T00:54:25.228532Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

MySQL 서비스 등록

서비스 mysqld 파일 복사

mysql@raspberrypi:/usr/local/mysql57$ sudo cp /usr/local/mysql57/support-files/mysql.server /etc/init.d/mysqld57

mysqld 수정

mysql@raspberrypi:/usr/local/mysql57$ sudo vi /etc/init.d/mysqld57

mysqld파일을 열어서 basedir에 mysql이 설치된 디렉토리와 데이터 디렉토리(datadir)를 설정한다.

basedir=/usr/local/mysql57
datadir=/usr/local/mysql57/data

mysqld 서비스 등록

mysql@raspberrypi:/usr/local/mysql57$ sudo update-rc.d mysqld57 defaults

mysqld 서비스 실행

mysql@raspberrypi:/usr/local/mysql57$ sudo systemctl start mysqld57.service
mysql@raspberrypi:/usr/local/mysql57$ sudo systemctl status mysqld57.service
● mysqld57.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/init.d/mysqld57; generated)
   Active: active (running) since Sun 2021-12-19 10:27:04 KST; 12s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15063 ExecStart=/etc/init.d/mysqld57 start (code=exited, status=0/SUCCESS)
    Tasks: 28 (limit: 4915)
   CGroup: /system.slice/mysqld57.service
           ├─15071 /bin/sh /usr/local/mysql57/bin/mysqld_safe --datadir=/usr/local/mysql57/data --pid-file=/usr/local/mysql57/data/raspb
           └─15419 /usr/local/mysql57/bin/mysqld --basedir=/usr/local/mysql57 --datadir=/usr/local/mysql57/data --plugin-dir=/usr/local/
 
Dec 19 10:27:01 raspberrypi systemd[1]: Starting LSB: start and stop MySQL...
Dec 19 10:27:01 raspberrypi mysqld57[15063]: Starting MySQL
Dec 19 10:27:02 raspberrypi mysqld57[15063]: .Logging to '/usr/local/mysql57/data/raspberrypi.err'.
Dec 19 10:27:04 raspberrypi mysqld57[15063]: ...
Dec 19 10:27:04 raspberrypi systemd[1]: Started LSB: start and stop MySQL.
mysql@raspberrypi:/usr/local/mysql57$ sudo systemctl stop mysqld57.service

root 암호 초기화

권한을 무시하고 mysql 서버 실행

mysql@raspberrypi:/usr/local/mysql57$ bin/mysqld_safe --skip-grant-tables &
[1] 15759
mysql@raspberrypi:/usr/local/mysql57$ 2021-12-19T01:32:53.052394Z mysqld_safe Logging to '/usr/local/mysql57/data/raspberrypi.err'.
2021-12-19T01:32:53.127375Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql57/data

root 암호 설정

mysql@raspberrypi:/usr/local/mysql57$ bin/mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.35-log Source distribution
 
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> 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
mysql> update user set authentication_string = password('manager01!') where user = 'root';
Query OK, 1 row affected, 1 warning (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 1
 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
 
mysql> quit
Bye

ERROR 1820 (HY000) 오류 해결

mysql> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> SET PASSWORD = PASSWORD('sql');
Query OK, 0 rows affected, 1 warning (0.00 sec)
 
mysql> 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

사용자 추가

mysql> create user 'user1'@'%' identified by 'userpw'; 
mysql> grant all privileges on *.* to 'user1'@'%' with grant option; 
mysql> flush privileges;

사용자 추가

mysql> create user 'terecal'@'%' identified by '****';
mysql> GRANT ALL privileges ON terecal_db.* TO 'terecal'@'%';
mysql> flush privileges;
728x90
728x90

출처

Tomcat 다운로드

pi@raspberrypi:~$ wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.72/bin/apache-tomcat-8.5.72.tar.gz

Tomcat 압축풀기

pi@raspberrypi:~$ sudo tar xvf apache-tomcat-8.5.72.tar.gz -C /usr/local
pi@raspberrypi:~$ cd /usr/local/apache-tomcat-8.5.72/
pi@raspberrypi:/usr/local/apache-tomcat-8.5.72$ 

Tomcat 서비스 등록

tomcat.service 파일 생성

pi@raspberrypi:~$ sudo vi /etc/systemd/system/tomcat.service

tomcat.service 파일

[UNIT]
Description=tomcat8
After=syslog.target network.target

[Service]
Type=forking

Environment="JAVA_HOME=/usr/local/java/jdk1.8.0_202/"
Environment="CATALINA_HOME=/usr/local/apache-tomcat-8.5.72"
Environment="CATALINA_BASE=/usr/local/apache-tomcat-8.5.72"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"

ExecStart=/usr/local/apache-tomcat-8.5.72/bin/startup.sh
ExecStop=/usr/local/apache-tomcat-8.5.72/bin/shutdown.sh

User=root
Group=root
UMask=0007
RestartSec=10

[Install]
WantedBy=multi-user.target

Tomcat 서비스 등록

pi@raspberrypi:~$ sudo systemctl enable tomcat.service Created symlink /etc/systemd/system/multi-user.target.wants/tomcat.service → /etc/systemd/system/tomcat.service.

Tomcat 서비스 시작

pi@raspberrypi:~$ sudo systemctl start tomcat.service

Tomcat 서비스 종료

pi@raspberrypi:~$ sudo systemctl start tomcat.service

Tomcat 서비스 재시작

pi@raspberrypi:~$ sudo systemctl restart tomcat.service

Tomcat 서비스 싱태 확인

pi@raspberrypi:~$ sudo systemctl status tomcat.service
● tomcat.service
   Loaded: loaded (/etc/systemd/system/tomcat.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-10-23 22:32:44 KST; 8s ago
  Process: 18200 ExecStart=/usr/local/apache-tomcat-8.5.72/bin/startup.sh (code=exited, status=0/SUCCESS
 Main PID: 18207 (java)
    Tasks: 24 (limit: 4915)
   CGroup: /system.slice/tomcat.service
           └─18207 /usr/local/java/jdk1.8.0_202//bin/java -Djava.util.logging.config.file=/usr/local/apa
 
Oct 23 22:32:44 raspberrypi systemd[1]: Starting tomcat.service...
Oct 23 22:32:44 raspberrypi startup.sh[18200]: Tomcat started.
Oct 23 22:32:44 raspberrypi systemd[1]: Started tomcat.service.
728x90
728x90

출처

압축풀기

pi@raspberrypi:~$ tar xvf jdk-8u202-linux-arm32-vfp-hflt.tar.gz

jdk 디렉토리 이동

pi@raspberrypi:~$ sudo mkdir /usr/local/java
pi@raspberrypi:~$ sudo mv jdk1.8.0_202/ /usr/local/java/

java를 기본 명령어로 등록

pi@raspberrypi:~$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_202/bin/java" 1;
update-alternatives: using /usr/local/java/jdk1.8.0_202/bin/java to provide /usr/bin/java (java) in auto mode
pi@raspberrypi:~$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_202/bin/javac" 1;
update-alternatives: using /usr/local/java/jdk1.8.0_202/bin/javac to provide /usr/bin/javac (javac) in auto mode
pi@raspberrypi:~$ ls -al /usr/bin/java
lrwxrwxrwx 1 root root 22 Oct 23 22:04 /usr/bin/java -> /etc/alternatives/java

pi@raspberrypi:~$ sudo update-alternatives --set java /usr/local/java/jdk1.8.0_202/bin/java;
pi@raspberrypi:~$ sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_202/bin/javac;

설치확인

pi@raspberrypi:~$ java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) Server VM (build 25.202-b08, mixed mode)
728x90
728x90

본 체험 제품은 아이씨뱅큐㈜ 에서 진행하는 무상 체험단 활동으로 작성한 것입니다.

Raspbot (라즈봇)의 간단한 개봉기와 조립 과정을 정리해보았습니다.

조립과정은 유튜브를 보면서 조립 할 수 있어서 조립이 어렵지는 않았지만,
모터 고정 프레임 조립시 프레임의 방향을 잘 못 조립해서 몇 번을 분해, 조립했습니다.

부품별로 작은 봉투에 번호가 표시 되어 있어 조립시 필요한 부품을 찾기는 쉬웠습니다.

배송받은 박스

박스개봉

본체 보드와 각각의 부품이 작은 봉투로 나누어져 있고, 조립에 필요한 드라이버가 포함되어 있어 별도의 드라이버가 필요하지 않습니다. 한가지 아쉬운 것은 전원이 110v인데 돼지코는 별도로 구입해셔야 합니다.

모터 고정 프레임 조립

오른쪽 상단에 잘 못 조립한 예입니다.
저와 같은 실수하지 마세요.

카메라 브라켓 조립

카메라 케이블이 짧아서 동본된 케이블를 사용하셔야 합니다.

팬 틸트 브라켓 조립

팬 틸트 브라켓 지지대 조립

라인트레이서 지지대 조립

팬 틸트 브라켓 지지대에 조립

라인트레이서 지지대에 조립

찍찍이 테이프로 베터리 고정

라즈베리파이 지지대 조립

GPIO 케이블 RC카 본체에 조립

라즈베리파이 지지대에 고정, GPIO 케이블 라즈베리파이에 연결

라즈베리파이까지 조립하면 조립은 완성입니다.

다음 강좌에는 App를 이용해서 Raspbot (라즈봇)를 연결해보겠습니다.

 

마이크로비트 마퀸 공식 구입처 : 아이씨뱅큐 https://www.icbanq.com/

 

전자부품쇼핑몰 아이씨뱅큐 - 전자부품, 오픈소스 하드웨어의 모든 것

국내 최대 전자부품 쇼핑몰. 아두이노/마이크로비트/라즈베리파이 등 오픈 H/W , LCD,리튬배터리, 반도체 부품, 코딩교육키트 등 판매 및 PCB/SMT/아트웍 임가공 서비스 제공. 다양한 마케팅 채널(블

www.icbanq.com

아이씨뱅큐 공식 카페 : https://cafe.naver.com/icbanq

 

No.1 전자엔지니어 전문몰 아이씨뱅큐 : 네이버 카페

체험단, 무상체험단, DIY 체험, 경품, 리뷰, 파워블로거,이벤트, 전자제품체험단, 후기 공모, 로봇체험

cafe.naver.com

아이씨뱅큐 공식 블로그 : https://blog.naver.com/icbanq

 

No.1 전자엔지니어 전문몰 아이씨뱅큐 : 네이버 블로그

♡전자 엔지니어와 메이커 DIY 매니아를 위한 다양한 정보 상시 업데이트!♡ - 마이크로비트/아두이노/라즈베리파이/라떼판다/젯슨나노 등 다양한 오픈소스 하드웨어 정보 가득! - 유튜브 '나도

blog.naver.com

마이크로비트 공식 카페 : https://cafe.naver.com/bbcmicro

 

코딩교육을 위한 BBC 마이크로비트... : 네이버 카페

코딩교육을위한 BBC microbit(micro:bit) 한국 총판인 element14 공식 후원 사용자모임 카페입니다.

cafe.naver.com

나도메이커 유튜브 채널 : https://www.youtube.com/user/ICbanQ

 

나도메이커

안녕하세요! 나도메이커입니다! 저희 채널은 전자엔지니어와 Maker, DIY 매니아들을 위한 다양한 정보를 제공합니다! 또한 반도체 전자부품, 로봇, 오픈소스하드웨어, 아두이노, 라즈베리파이, AVR,

www.youtube.com

 

728x90

+ Recent posts