systemd 는 이제 리눅스 시스템의 뼈대가 되는 기본운영 방법이 되었다. 기존에는 System V Init 이였지만 RHEL 7, Ubuntu 16.04부터 기본 시스템운영 프로그램이 되었다. systemd 는 ‘ctl’ 로 끝나는 명령어들의 집합으로 제어가 가능하다. systemctl, journalctl, timedatectl, hostnamectl, loginctl 이 대표적이다. systemctl 의 경우에는 systemd unit 파일들에 대한 제어와 설정이 가능하다. systemd unit 파일은 기존의 Systemv V init Script 를 대체하는 것으로 일종의 시스템 데몬 프로그램들이라고 보면 된다. 시스템이 시작될때에 자동으로 시작되게 한다거나 종료하게 한다거나 하는것들을 가능하게 한다. unit 파일은 텍스트 파일이기 […]
WebLogic 12c: 노드 매니저(NodeManager) 설정하기
WebLogic 에서 노드매니저(NodeManger)는 웹로직을 운영할 머신(Machine) 에 설치되는 것으로 웹로직의 Admin 서버에 요청을 받아 처리해주는 역할을 한다. 노드매니저가 하는 일은 대략 다음과 같다. 매니지드 서버 생성/삭제 매니지드 서버 시작, 중지, 종료 웹로직을 설치하면 노드 매니저도 함께 설치가 된다. 기본적으로 터미널 상에서 노드매니저를 설정을 한 후에 Admin 콘솔에서 Admin 서버가 인식할 수 있도록 등록을 해줘야 한다. 여기서는 터미널 상에서 노드매니저 설정에 대해서 간단하게 다루어 본다. 참고: Oracle WebLogic 12c (12.2.1): Configuring and Using Node Manager 노드매니저 설정 웹로직을 설치하고 난 후에 […]
쿠버네티스 수동 설치
쿠버네티스 설치는 kubeadm 명령어를 이용하면 손쉽게 자동으로 이루어 진다. HA 를 위한 설치에서는 좀 더 손이 더 가겠지만 어쨌거나 그것도 kubeadm 을 이용한다. 쿠버네티스 설치에 많은 시간을 들이는 것이 그렇게 현명해 보이지는 않을 수 있지만 쿠버네티스의 기본적인 구조를 이해하는데 수동 설치만큼 유용한 것도 없다. 인터넷을 검색해보면 쿠버네티스 수동 설치는 보통 ‘Hard way’ 로 많이 나온다. ‘힘든 방법’ 등으로 번역할 수 있는데, 하나하나 수동으로 설치를 하게 된다. 이 글이 어렵다면 ‘Kubernetes Hard way’ 로 검색하면 많은 자료를 얻을 수 있다. Requirements […]
WebLogic 12c Silent 설치
WebLogic 12c 사일런트(Silent) 설치에 대해서 다룹니다. 현재 WebLogic 은 12.2.1.4 버전이다. WebLogic 12.2.1.4 WebLogic 은 자바 엔터프라이즈 서버(Java Enterprise Server) 이다. 자바를 필요로 하는데, 특징은 Oracle 자바 jdk8 이 반드시 필요하다. JEE 7 스펙을 만족한다. 최근에 Oracle Linux 8.x 에서 인증이 되어서 설치할 수 있게 되었다. 시스템 계정 생성 WebLogic 을 운영하기 위한 시스템 계정을 생성 한다.
1 2 3 4 5 6 7 8 |
]# groupadd -g 1000 oinstall ]# useradd -u 1100 -g oinstall oracle ]# passwd oracle oracle 사용자의 비밀 번호 변경 중 새 암호: 잘못된 암호: 암호는 8 개의 문자 보다 짧습니다 새 암호 재입력: passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다. |
디렉토리 생성 WebLogic 설치를 위한 디렉토리를 다음과 같이 생성해 준다.
1 2 3 4 5 6 |
]# mkdir -p /u01/app/oracle/middleware ]# mkdir -p /u01/app/oracle/config/domains ]# mkdir -p /u01/app/oracle/config/applications ]# mkdir -p /u01/software ]# chown -R oracle:oinstall /u01 ]# chmod -R 775 /u01/ |
oracle 계정의 Bash 환경변수 세팅 oracle 계정으로 운영할 WebLogic 을 위해서 […]
Redmine 컴파일 설치
Redmine 컴파일 설치에 대해서 다룬다. 최신의 OS 를 가지고 하면 좋겠지만, CentOS 7 에서 설치를 진행 했다. Mariadb 설치 MySQL 도 가능하지만, MariaDB 를 선택했다. 컴파일 설치가 가능하지만 패키지 설치로 설치한다.
1 |
]# yum install mariadb-server mariadb-devel -y |
각종 의존성이 함께 설치가 된다. CentOS 7 에서 MariaDB 버전은 5.5 이다. 현재 최선 버전은 10.4 이며 이것을 설치하고자 한다면 MariaDB 홈페이지에 공식 리파지토리를 설정하고 yum 명령어로 간단하게 설치할 수 있다. my.cnf 파일을 다음과 같이 설정해 준다.
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 |
]# vim /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd character-set-server = utf8 collation-server = utf8_general_ci port = 3306 skip-name-resolve [mysqld_safe] log-error=/var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d [mysql] default-character-set = utf8 no-auto-rehash show-warnings prompt=\u@\h:\d\_\R:\m:\\s> pager="less -n -i -F -X -E" |
캐릭터 셋을(character-set) 설정하는 부분과 함께 mysql 콘솔에 대한 설정이 전부다. […]
Redmine 설치하기
Redmine 은 오픈소스 프로젝트 매니지먼트 프로그램이다. Ruby 로 제작되었기 때문에 설치 과정에서 Ruby 가 있어야 한다. 웹을 통해서 서비스를 하기 때문에 보통 웹서버와 연동을 하는 편이다. 환경 OS: CentOS 7 Arch: x86_64 Minimal Installation 상태 MariaDB 설치 MySQL 도 가능하지만, MariaDB 를 선택했다. 컴파일 설치가 가능하지만 패키지 설치로 설치한다.
1 |
]# yum install mariadb-server -y |
각종 의존성이 함께 설치가 된다. my.cnf 파일을 다음과 같이 설정해 준다.
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 |
]# vim /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd character-set-server = utf8 collation-server = utf8_general_ci port = 3306 skip-name-resolve [mysqld_safe] log-error=/var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d [mysql] default-character-set = utf8 no-auto-rehash show-warnings prompt=\u@\h:\d\_\R:\m:\\s> pager="less -n -i -F -X -E" |
다음과 같이 서버를 실행해 준다.
1 2 |
]# systemctl start mariadb.service ]# systemctl enable mariadb.service |
이제 기본적인 설정을 위해 mysql_secure_installation 을 실행해 준다.
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 |
]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): <- 그냥 엔터 OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! ]# |
root 패스워드를 설정하기 […]
Oracle 계정 생성
오라클에서 계정을 생성해 보자. 오라클에서 계정 생성은 다른 데이터베이스와는 완전히 다른 의미를 갖는다. 보통 데이터베이스의 계정은 데이터베이스에 접속을 하기 위한 목적만 가진다. 하지만 오라클 데이터베이스의 계정은 이와는 다르다. 스키마(Schema) 오라클에서 스키마는 데이터베이스 오브젝트(Object)들의 모음이다. 오브젝트라고 하면 테이블(Table), 뷰(View) 와 같은 것을 말한다. 이론적으로 데이터베이스에 의해서 사용되어지는 메타데이터의 집합이라고도 한다. 하나의 스키마는 테이블, 컬럼, 속성등과 같은 데이터베이스의 애튜리브트(Attribute) 를 정의한다. 그래서 데이터베이스는 이러한 스키마들을 관리해주는 시스템이라고 보면 된다. 스키마의 존재 이유는 데이터의 모음을 그룹화하고 권한 설정을 하는데 있다. 오라클은 관계형 데이터베이스이기 […]
listener.ora, tnsnames.ora 생성하기
오라클 데이터베이스 19c 를 Silent 설치를 하고 나면 listener.ora, tnsnames.ora 가 생성되지 않는다. 어떻게 수동으로 이것을 생성하는지에 대해서 알아보고 차이에 대해서 간단히 설명한다. 신기하게도 오라클 데이터베이스 19c를 Silent 설치하고 난 후에 이것을 생성하지 않는다고 하더라도 원격 클라이언트 접속에는 아무런 문제가 되지 않는다. 하지만 접속 서비스를 할당하고 접속을 쪼개고 싶다면 tnsnames.ora 파일이 반드시 있어야 한다. Oracle Net Listener Listener 는 정확하게는 ‘Oracle Net Listener’ 라고 한다. 리스너는 하나 혹은 그 이상의 지원하는 서비스에 대한 정보, 프로토콜 주소들을 리스닝하도록 설정된다. 리스너의 설정 […]
오라클 기본 정보 확인
오라클을 설치하고 나면 정보를 확인해야 한다. 오라클은 많은 테이블, 뷰, 동적쿼리등을 지원하는데 워낙 많다보니까 다 알수는 없다. 필요한 정보를 위한 간단한 쿼리들을 소개 한다. 데이터베이스 컴포넌트들의 상태 확인 오라클 데이터베이스는 다양한 컴포넌트들로 구성되는데, 이에 대한 상태를 확인할 수 있다.
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 |
SQL> col comp_name for a40 SQL> col version for a15 SQL> col status for a10 SQL> SELECT name, comp_name, version, status FROM v$database, dba_registry; NAME COMP_NAME VERSION STATUS O19C Oracle Database Catalog Views 19.0.0.0.0 VALID O19C Oracle Database Packages and Types 19.0.0.0.0 VALID O19C Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF O19C JServer JAVA Virtual Machine 19.0.0.0.0 VALID O19C Oracle XDK 19.0.0.0.0 VALID O19C Oracle Database Java Packages 19.0.0.0.0 VALID O19C OLAP Analytic Workspace 19.0.0.0.0 VALID O19C Oracle XML Database 19.0.0.0.0 VALID O19C Oracle Workspace Manager 19.0.0.0.0 VALID O19C Oracle Text 19.0.0.0.0 VALID O19C Oracle Multimedia 19.0.0.0.0 VALID O19C Spatial 19.0.0.0.0 VALID O19C Oracle OLAP API 19.0.0.0.0 VALID O19C Oracle Label Security 19.0.0.0.0 VALID NAME COMP_NAME VERSION STATUS O19C Oracle Database Vault 19.0.0.0.0 VALID 15 rows selected. |
만일 INVALID 컴포넌트가 있다면 다음과 같이 해준다.
1 |
SQL> @?/rdbms/admin/utlrp.sql |
데이터베이스 이름 확인 데이터베이스 이름이 뭔지를 확인할 수 있다.
1 2 3 |
SQL> SELECT dbid, name, db_unique_name, created, log_mode, open_mode, cdb, con_id FROM v$database; DBID NAME DB_UNIQUE_NAME CREATED LOG_MODE OPEN_MODE CDB CON_ID 2857479539 O19C o19c 30-APR-21 NOARCHIVELOG READ WRITE YES 0 |
CDB 가 YES 면 데이터베이스가 CDB 로 생성되었다는 것을 말한다. NO 라면 non-CDB 데이터베이스다. DB_UNIQUE_NAME 은 쉘 환경변수에도 사용되고 있어 확인해 둘 […]
오라클 데이터베이스 19c 샘플 스키마 생성
오라클 데이터베이스 19c 를 Silent 설치를 할 경우에 대부분 데이터베이스를 생성하고 끝나게 된다. 하지만 오라클은 샘플 스키마를 제공하고 있는데, HR 관련 된 내용의 샘플 스키마를 제공 한다. 이것을 설치해보자. SQLcl 활용 SQL Plus 에 기능을 더한 SQLcl 를 활용할 것이다. SQLcl 은 $ORACLE_HOME/sqldeveloper/sqldeveloper/bin 디렉토리가 있다. 여기에 sql 스크립트가 존재하는데 이것이 SQLcl 이다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
]$ cd $ORACLE_HOME ]$ cd sqldeveloper/sqldeveloper/bin ]$ chmod +x sql ]$ ./sql SQLcl: Release 19.1 Production on Fri Apr 30 23:23:46 2021 Copyright (c) 1982, 2021, Oracle. All rights reserved. Username? (''?) sys as sysdba Password? (**********?) ************ Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> set sqlformat ansiconsole; SQL> |
“set sqlformat ansiconsole” 를 할 경우에 결과를 보다 보기 좋게 해준다. PDB 로 세션 변경 오라클 데이터베이스 19c 의 경우에 CDB, PDB 개념이 존재한다. 실제 사용자 데이터베이스는 […]