CentOS 8 로 넘어오면서 기본 패키지 매니지먼트로 dnf 가 되었다. 여전히 yum 을 지원하지만 앞으로는 dnf 로 쭉 간다고 하니 이참에 배워보자고 생각하지만…. 겁나 빡치는게, 이제 그만 바꿨으면 한다. 뭔 yum 정도로도 충분히 잘 쓰고 있고 괜찮다고 싶다. 무슨 겁나 가볍네, 더 빠르네 어케 좋네… 응 yum 도 그렇게 느리고 그렇게 무겁지도 않아! 도대체 뭘 할때마다 갈아 엎고 이걸 새로 배우라고 하니.. 뭐 어쩌것나.. 그렇게 하겠다는데, 닥치고 배워야지! dnf 햐.. 쓰기도 귀찮다… “DNF is the next upcoming major version of […]
Ubuntu 18.04, Static IP 할당하기
Ubuntu 18.04 의 경우 네트워크 인터페이스 관련 작업은 netplan 으로 바뀌었다. 만일 Static IP 를 할당하고 싶다면 netplan 의 설정 파일을 수정하고 적용하면 된다. /etc/netplan/*.yml 여기서 파일을 수정하면 된다. 대략 다음과 같은 포맷을 갖는다. dhcp4: yes 로 되어 있는 경우에는 DHCP 로 아이피를 받아온다. 하지만 이것을 no 바꾸면 Static IP 를 할당할 수 있다. netplan 적용 수정을 다 했다면 다음과 같이 적용해 준다.
Ubuntu 18.04 ethernet 이름 변경하기
Ubuntu 18.04 를 설치하면 ethernet 인터페이스 이름이 과거 eth0 가 아닌 ens3 과 같이 나온다. 하지만 아직도 많은 프로그램들이 기본적으로 eth0 를 기본으로 찾기도 한다. eth0 변경하는 방법에 대해 다룬다. GRUB 파라메터 수정 다음과 같이 Grub 에 파라메터를 추가 한다. Grub 에 파라메터는 /etc/default/grub 파일에서 다음과 같이 추가할 수 있다. 수정된 사항이 Grub 에 반영하기 위해서 업데이트를 수행한다. 여기서 중요한 것이 바로 재부팅을 하면 안된다. 특히나 DHCP 환경에서는 다음의 단계를 수행한 후에 재부팅을 해야 한다. netplan 수정 netplan 은 Ubuntu […]
Trac 에서 Ticket 삭제하기
Trac 을 사용하다보면 Ticket 을 삭제하고 싶을때가 있다. Ticket 삭제 플러그인이 존재하지만 Ticket 이란게 자주 삭제를 하는 것이 아니여서 굳이 이것을 설치해서 사용해야할 만큼은 아닌듯 한데, 그런데도 잘못된 Ticket 을 삭제해야한다면 다음과 같이 하면 된다. trac-admin 을 활용하면 된다. 출처: Deleting trac tickets created since a certain date until today 두번째 방법으로 ‘ticket.deleter’ 를 활성화하면 된다. 이는 Trac 에서 공식지원하는 것으로 Ticket 웹화면에서 Reply 버튼 옆에 Delete 버튼이 나타난다. 이를 위해서는 trac.ini 설정파일에 다음과 같이 설정해준다.
Grub2 에 기본 커널 지정하기
Grub2 은 리눅스 시스템의 부팅 메니져이다. 리눅스는 커널을 여러개를 설치하고 부팅시에 선택해서 원하는 커널로 부팅을 할 수 있도록 해준다. 비상 복구가 필요할 경우에도 부팅 메니져인 Grub2 에서 비상복구 모드를 선택하면 된다. 문제는 어떻게 기본 커널을 지정할 수 있을까? 먼저, 기본 부팅 커널은 다음과 같이 확인할 수 있다. 만일 부팅 상황이라면 위에 설정한 커널을 기본으로 부팅을 진행하게 된다. 만일 이 기본 커널을 변경하고자 할 경우에는 어떻게 할까? 우선, 현재 Grub2 에 등록된 커널 목록들을 알아야하는데 다음과 같이 하면 알 수 있다. […]
Ubuntu 18.04 도메인을 찾을 수 없을때
Ubuntu 18.04 를 사용중인데, 보안 업데이트를 하기 위해서 apt 명령을 입력했더니 다음과 같이 도메인을 찾을 수 없는 이유로 오류가 생긴다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
root@ubuntu:~# apt update Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease Temporary failure resolving 'archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease Temporary failure resolving 'security.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead. |
“Temporary failure resolving” 이게 뭘까 싶어서 알아본 내용을 정리한다. resolve.conf 파일을 열어보면 다음과 같이 되어 있을 것이다.
1 2 3 4 5 6 7 |
root@ubuntu:~# cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers. nameserver 127.0.0.53 |
resolv.conf 파일은 다들 알다시피 도메인 네임 서버를 지정해주는 설정 파일로 이 파일이 잘못되면 도메인을 ip로 변환할 수가 없게되어 결국에는 인터넷 연결을 할 수가 없게 된다. 그런데, 위 내용을 보면 도메인 서버 ip는 로컬 호스트로 보이고 코멘트에 이것을 수동으로 바꾸지 말것을 경고하고 […]
PHP7 설치하기
이 문서는 php7.2 설치 문서 입니다. 1. 준비 CentOS 가 최소설치되었다고 가정하고 시작했기 때문에 컴파일 환경을 구축해야 합니다.
1 2 3 |
yum update -y reboot yum install gcc.x86_64 gcc-c++.x86_64 wget.x86_64 bzip2-devel.x86_64 pkgconfig.x86_64 openssl-devel.x86_64 make.x86_64 man.x86_64 nasm.x86_64 gmp.x86_64 gmp-devel.x86_64 curl-devel.x86_64 libicu-devel.x86_64 libsodium-devel.x86_64 gdbm-devel.x86_64 readline-devel.x86_64 compat-readline43.x86_64 ncurses-devel.x86_64 db4-devel.x86_64 automake* autoconf* -y |
Ubuntu16.04 의 경우에는 다음과 같은 프로그램이 설치되어 있어야 합니다.
1 2 3 4 5 |
apt clean all apt update apt install build-essential libsystemd-dev pkg-config libxml2-dev libssl-dev libbz2-dev \ libcurl3 libcurl4-openssl-dev libsodium-dev libjpeg9-dev libpng-dev \ libfreetype6-dev libxpm-dev libgmp10-dev libxslt1-dev |
2.Download and Unpack 최신버전을 다운로드 받아야 합니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
]# wget http://jp2.php.net/get/php-7.2.1.tar.bz2/from/this/mirror --2018-01-07 00:17:28-- http://jp2.php.net/get/php-7.2.1.tar.bz2/from/this/mirror Resolving jp2.php.net... 49.212.134.217 Connecting to jp2.php.net|49.212.134.217|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://jp2.php.net/distributions/php-7.2.1.tar.bz2 [following] --2018-01-07 00:17:29-- http://jp2.php.net/distributions/php-7.2.1.tar.bz2 Connecting to jp2.php.net|49.212.134.217|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 14980278 (14M) [application/octet-stream] Saving to: `mirror' 100%[===================================================================================>] 14,980,278 6.55M/s in 2.2s 2018-01-07 00:17:31 (6.55 MB/s) - `mirror' saved [14980278/14980278] ]# tar xvjf mirror |
3. Configure and Compile 이제 PHP에서 사용할 기능들을 결정해야 합니다. PHP에서 제공하는 기능은 아주 많지만 여기서는 다음과 같은 기능들을 사용할 것입니다.
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 |
../configure --prefix=/opt/php-7.2.1 \ --with-config-file-path=/opt/php-7.2.1/etc \ --with-config-file-scan-dir=/opt/php-7.2.1/etc/conf.d \ --with-libdir=lib64 \ --enable-fpm \ --with-fpm-systemd \ --enable-sockets \ --with-gettext \ --with-mhash \ --with-gmp \ --with-gd \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-zlib-dir=/usr \ --with-freetype-dir=/usr \ --enable-bcmath \ --enable-exif \ --with-zlib \ --with-bz2 \ --enable-calendar \ --enable-mbstring \ --with-mhash \ --enable-intl \ --with-xsl \ --with-sodium \ --with-libxml-dir=/usr \ --with-curl \ --disable-debug \ --with-openssl \ --enable-mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --enable-inline-optimization \ --enable-sysvmsg \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-pcntl \ --enable-mbregex \ --with-mhash \ --enable-zip \ --with-pcre-regex |
아무런 에러없이 끝났다면 다음과 같이 컴파일을 해주고 설치해준다.
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 |
]# make ]# make install Installing shared extensions: /opt/php-7.2.1/lib/php/extensions/no-debug-non-zts-20170718/ Installing PHP CLI binary: /opt/php-7.2.1/bin/ Installing PHP CLI man page: /opt/php-7.2.1/php/man/man1/ Installing PHP FPM binary: /opt/php-7.2.1/sbin/ Installing PHP FPM defconfig: /opt/php-7.2.1/etc/ Installing PHP FPM man page: /opt/php-7.2.1/php/man/man8/ Installing PHP FPM status page: /opt/php-7.2.1/php/php/fpm/ Installing phpdbg binary: /opt/php-7.2.1/bin/ Installing phpdbg man page: /opt/php-7.2.1/php/man/man1/ Installing PHP CGI binary: /opt/php-7.2.1/bin/ Installing PHP CGI man page: /opt/php-7.2.1/php/man/man1/ Installing build environment: /opt/php-7.2.1/lib/php/build/ Installing header files: /opt/php-7.2.1/include/php/ Installing helper programs: /opt/php-7.2.1/bin/ program: phpize program: php-config Installing man pages: /opt/php-7.2.1/php/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /opt/php-7.2.1/lib/php/ [PEAR] Archive_Tar - installed: 1.4.3 [PEAR] Console_Getopt - installed: 1.4.1 [PEAR] Structures_Graph- installed: 1.1.1 [PEAR] XML_Util - installed: 1.4.2 [PEAR] PEAR - installed: 1.10.5 Wrote PEAR system config file at: /opt/php-7.2.1/etc/pear.conf You may want to add: /opt/php-7.2.1/lib/php to your php.ini include_path /root/php-7.2.1/build/shtool install -c ext/phar/phar.phar /opt/php-7.2.1/bin ln -s -f phar.phar /opt/php-7.2.1/bin/phar Installing PDO headers: /opt/php-7.2.1/include/php/ext/pdo/ |
4. Configure to the installed php7 config-file-scan 디렉토리를 생성해 준다.
1 |
]# mkdir /opt/php-7.2.1/etc/conf.d |
[…]
Database 를 위한 공유 메모리, HugePages 계산하기
Database 시스템은 공유메모리 혹은 HugePages 에 매우 의존적입니다. 서버에서 데이터베이스가 가동되면 Database 가 사용하는 메모리는 Database만을 위해서 사용되어 집니다. 대부분의 큰 Database 시스템은 다른 서버 프로그램 없이 단독으로 설치되어 운영되어지기 때문에 얼마만큼 물리적 메모리를 Database 에 할당할지가 Database 시스템 전체에 큰 영향을 미칩니다. 이 글에서 Database 시스템을 위한 공유메모리, HugePages 등을 할당할때에 고려사항은 무엇이며 얼마나 할당하는 것이 좋은지를 살펴보겠습니다. Oracle 11g or 12c 먼저 Oracle 은 물리적 메모리에 약 80% 를 Oracle 이 사용하도록 할당하도록 합니다. 여기서 대략 80% 라고 […]
x86_64 시스템에서 4MB 크기 HugePageSize 변경 불가.
HugePage 는 Linux 의 기본 메모리 페이지 크기인 4K(4096) 가 아닌 더 큰 페이지를 사용하도록함으로서 잦은 메모리 액세스를 줄여 자원 소모를 줄이게 해준다. 최신의 Linux 는 전부 이것을 지원하며 다음과 같이 확인 할 수 있다.
1 2 3 4 5 6 7 8 |
[orion@localhost ~]$ grep Huge /proc/meminfo AnonHugePages: 96256 kB ShmemHugePages: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB |
기본 메모리 페이지는 Hugepagesize 인 2MB(2048kb) 임을 확인할 수 있다. 그런데, 이 메모리 페이지 크기를 바꿀 수 있지 않을까? 결론부터 말하면 불가능하다. 이 Hugepagesize 는 CPU 지원에 의존한다. 2MB – cpu에 ‘pse’ 가 지원되면 된다. 1G – cpu 가 ‘pdpe1gb’ 가 지원되면 된다. 최신의 […]
Linux PAGE_SIZE 그리고 HugePage
다음의 글이 도움이 될 듯 싶다. Kernel hugepages does not alter the calculation of SHMMAX, which you need to set large enough to fit your largest Oracle SGA. SHMMAX applies to SYS V shared memory, which can be hugepages or use conventional 4K memory pages. SHMMAX is not relevant when you use /dev/shm POSIX shared memory (Oracle AMM). The Oracle database requires shared memory for the SGA. This can be Sys V (IPC) or POSIX /dev/shm. Shared memory and semaphores, […]