본문 바로가기
MariaDB

MariaDB 구성 (build) 과정 중 troubleshooting

열린기술자·2015년 4월 23일·조회 4,906

MariaDB를 소스에서 빌드하거나 초기화하는 과정에서 발생할 수 있는 의존성 관련 오류를 정리해 보았다. 아래 사례는 CentOS/RHEL 계열에서 yum으로 필요한 패키지를 설치해 해결한 기록이다.

1) CMake is required to build MySQL

CMake is required to build MySQL.

./configure 단계에서 CMake가 없으면 빌드 구성이 진행되지 않는다. MariaDB/MySQL 소스 빌드에는 CMake가 필요하므로, 먼저 cmake 패키지를 설치한 뒤 다시 빌드를 진행한다.

# ./configure --with-plugin-xtradb
CMake is required to build MySQL.
# yum install cmake
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.daumkakao.com
 * extras: ftp.daumkakao.com
 * updates: ftp.daumkakao.com
base
extras
updates
updates/primary_db
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package cmake.x86_64 0:2.8.12.2-4.el6 will be installed
--> Processing Dependency: libarchive.so.2()(64bit) for package: cmake-2.8.12.2-4.el6.x86_64
--> Running transaction check
---> Package libarchive.x86_64 0:2.8.3-4.el6_2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================
 Package                                          Arch                                         Version
==================================================================================================================================
Installing:
 cmake                                            x86_64                                       2.8.12.2-4.el6
Installing for dependencies:
 libarchive                                       x86_64                                       2.8.3-4.el6_2

Transaction Summary
==================================================================================================================================
Install       2 Package(s)

Total download size: 8.1 M
Installed size: 29 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): cmake-2.8.12.2-4.el6.x86_64.rpm
(2/2): libarchive-2.8.3-4.el6_2.x86_64.rpm
----------------------------------------------------------------------------------------------------------------------------------
Total
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libarchive-2.8.3-4.el6_2.x86_64
  Installing : cmake-2.8.12.2-4.el6.x86_64
  Verifying  : cmake-2.8.12.2-4.el6.x86_64
  Verifying  : libarchive-2.8.3-4.el6_2.x86_64

Installed:
  cmake.x86_64 0:2.8.12.2-4.el6

Dependency Installed:
  libarchive.x86_64 0:2.8.3-4.el6_2

Complete!

2) Could NOT find Curses

Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)

CMake가 Curses 라이브러리와 헤더 파일을 찾지 못해 발생한 오류다. 오류 메시지에도 안내되어 있듯이 Debian/Ubuntu 계열에서는 libncurses5-dev, Red Hat 계열에서는 ncurses-devel 패키지가 필요하다.

패키지를 설치한 뒤에는 이전 CMake 실행 결과가 남아 있을 수 있으므로, 오류 메시지의 안내처럼 CMakeCache.txt를 삭제하고 다시 CMake를 실행하는 것이 좋다.

-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:85 (MESSAGE):
  Curses library not found.  Please install appropriate package,

      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:196 (FIND_CURSES)
  CMakeLists.txt:358 (MYSQL_CHECK_READLINE)


-- Configuring incomplete, errors occurred!
See also "/u01/mariadb/installer/mariadb-10.0.17/CMakeFiles/CMakeOutput.log".
See also "/u01/mariadb/installer/mariadb-10.0.17/CMakeFiles/CMakeError.log".

# yum install ncurses-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.nara.wide.ad.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ncurses-devel.x86_64 0:5.7-3.20090208.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================
 Package                          Arch                      Version                                 Repository               Size
==================================================================================================================================
Installing:
 ncurses-devel                    x86_64                    5.7-3.20090208.el6                      base                    642 k

Transaction Summary
==================================================================================================================================
Install       1 Package(s)

Total download size: 642 k
Installed size: 1.7 M
Is this ok [y/N]: y
Downloading Packages:
ncurses-devel-5.7-3.20090208.el6.x86_64.rpm                                                                | 642 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ncurses-devel-5.7-3.20090208.el6.x86_64                                                                        1/1
  Verifying  : ncurses-devel-5.7-3.20090208.el6.x86_64                                                                        1/1

Installed:
  ncurses-devel.x86_64 0:5.7-3.20090208.el6

Complete!

3) libaio.so.1 파일을 찾을 수 없는 경우

error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

mysql_install_db 실행 시 libaio.so.1을 찾지 못하면 MariaDB 서버 바이너리가 필요한 공유 라이브러리를 로드하지 못한 상태다. InnoDB 등에서 비동기 I/O 라이브러리를 사용하므로, Red Hat 계열에서는 libaio 패키지를 설치해 해결할 수 있다.

설치 후 같은 명령을 다시 실행해 시스템 테이블 초기화가 정상적으로 진행되는지 확인한다. 그래도 실패한다면 출력에 표시된 데이터 디렉터리의 로그 파일을 먼저 확인하는 것이 좋다.

# ./scripts/mysql_install_db --user=mariadb
Installing MariaDB/MySQL system tables in '/u01/mariadb/test' ...
/u01/mariadb/10.0/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

Installation of system tables failed!  Examine the logs in
/u01/mariadb/test for more information.

# yum install libaio
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.daumkakao.com
 * extras: ftp.daumkakao.com
 * updates: ftp.daumkakao.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libaio.x86_64 0:0.3.107-10.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                   Arch                      Version                              Repository               Size
========================================================================================================================
Installing:
 libaio                    x86_64                    0.3.107-10.el6                       base                     21 k

Transaction Summary
========================================================================================================================
Install       1 Package(s)

Total download size: 21 k
Installed size: 34 k
Is this ok [y/N]: y
Downloading Packages:
libaio-0.3.107-10.el6.x86_64.rpm                                                                 |  21 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libaio-0.3.107-10.el6.x86_64                                                                         1/1
  Verifying  : libaio-0.3.107-10.el6.x86_64                                                                         1/1

Installed:
  libaio.x86_64 0:0.3.107-10.el6

Complete!

관련 글

댓글 0

로그인 후 댓글을 남길 수 있습니다.

아직 댓글이 없습니다.