Installing MariaDB on Amazon EC2(Ubuntu 13.10)

EC2에 MariaDB 설치하기.
Ubuntu 13.10이 거지같은지 잘 안된다는 포스팅이 좀 보인다. 하지만 어쨌든 해본다. 물론 참고는 홈페이지의 문서로.


내 상황에 맞게 OS, 버젼 등을 고르면 아래 쪽에 친절하게 커맨드가 등장. 일단 그대로 따라 해 본다.
지금 내 EC2는 완전히 새거니까 중간중간 뭐 더 설치가 필요한 게 있을 수도 있음.

일단 접속.

~/Project/awskey> chmod 400 up_db_server.pem 
~/Project/awskey> ssh -i up_db_server.pem ubuntu@54.238.207.180
The authenticity of host '54.238.207.180 (54.238.207.180)' can't be established.
RSA key fingerprint is 7e:18:69:de:df:0d:b9:c5:22:9c:f1:88:62:df:05:43.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '54.238.207.180' (RSA) to the list of known hosts.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

ubuntu@ip-172-31-24-62:~$ 

접속 잘 됐고. 이제 설치하기 위한 준비(key 임포트, repository 추가)

ubuntu@ip-172-31-24-62:~$ sudo apt-get install software-properties-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
software-properties-common is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ubuntu@ip-172-31-24-62:~$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.tAPlhIYuvw --trustdb-name /etc/apt//trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
gpg: requesting key 1BB943DB from hkp server keyserver.ubuntu.com
gpg: key 1BB943DB: public key "MariaDB Package Signing Key " imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
ubuntu@ip-172-31-24-62:~$ sudo add-apt-repository 'deb http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu saucy main'
ubuntu@ip-172-31-24-62:~$ 

update

ubuntu@ip-172-31-24-62:~$ sudo apt-get update
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy InRelease
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates InRelease
Get:1 http://ap-northeast-1.ec2.archive.ubuntu.com saucy Release.gpg [933 B]
Get:2 http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates Release.gpg [933 B]                               
Get:3 http://ap-northeast-1.ec2.archive.ubuntu.com saucy Release [49.6 kB]                                          
Get:4 http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates Release [49.6 kB]                                                     
Get:5 http://ap-northeast-1.ec2.archive.ubuntu.com saucy/main Sources [1,009 kB]                                                               
Get:6 http://ap-northeast-1.ec2.archive.ubuntu.com saucy/universe Sources [6,108 kB]                          
Ign http://security.ubuntu.com saucy-security InRelease                                                        
Get:7 http://security.ubuntu.com saucy-security Release.gpg [933 B]                                            
Get:8 http://security.ubuntu.com saucy-security Release [49.6 kB]                                                           
Get:9 http://ap-northeast-1.ec2.archive.ubuntu.com saucy/main amd64 Packages [1,239 kB]                       
Get:10 http://ap-northeast-1.ec2.archive.ubuntu.com saucy/universe amd64 Packages [5,643 kB]                              
Get:11 http://security.ubuntu.com saucy-security/main Sources [3,993 B]                                                    
Get:12 http://ftp.kaist.ac.kr saucy InRelease [2,492 B]                                                
Get:13 http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/main Sources [15.1 kB]                 
Get:14 http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/universe Sources [2,751 B]                       
Get:15 http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/main amd64 Packages [36.4 kB]                     
Get:16 http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/universe amd64 Packages [13.3 kB]                 
Get:17 http://security.ubuntu.com saucy-security/universe Sources [14 B]                                            
Get:18 http://ftp.kaist.ac.kr saucy/main amd64 Packages [3,641 B]                                        
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy/main Translation-en_US                                      
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy/main Translation-en                  
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy/universe Translation-en_US           
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy/universe Translation-en              
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/main Translation-en_US       
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/main Translation-en          
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/universe Translation-en_US   
Ign http://ap-northeast-1.ec2.archive.ubuntu.com saucy-updates/universe Translation-en      
Get:19 http://security.ubuntu.com saucy-security/main amd64 Packages [14.9 kB]              
Get:20 http://security.ubuntu.com saucy-security/universe amd64 Packages [2,932 B]
Get:21 http://security.ubuntu.com saucy-security/main Translation-en [6,103 B]    
Get:22 http://security.ubuntu.com saucy-security/universe Translation-en [1,565 B]      
Ign http://ftp.kaist.ac.kr saucy/main Translation-en_US                                 
Ign http://ftp.kaist.ac.kr saucy/main Translation-en                   
Ign http://security.ubuntu.com saucy-security/main Translation-en_US
Ign http://security.ubuntu.com saucy-security/universe Translation-en_US                                                                                          
Fetched 14.3 MB in 8s (1,589 kB/s)                                                                                                                                
Reading package lists... Done
ubuntu@ip-172-31-24-62:~$ 

실패.

ubuntu@ip-172-31-24-62:~$ sudo apt-get install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-5.5 (= 5.5.33a+maria-1~saucy) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ubuntu@ip-172-31-24-62:~$ 

뭔 소리냐. 잘 보자. 필요한 디펜던시를 다 갖추지 못해서 그런건가. 대충 에러메시지는 그런 것 같은데 잘 모르겠으니까 구글링을 한다.
역시 구글, 역시 Stackoverflow.

첫 번째 답변에 나온 해결방법은 약간 구버젼인 것 같고 그 답변의 리플 중에 아래와 같은 해결책이 있었다.

For Ubuntu 13.10 (Saucy Salamander), use sudo apt-get install libmysqlclient18=5.5.33a+maria-1~saucy mysql-common=5.5.33a+maria-1~saucy mariadb-server mariadb-client. –  absynce Oct 25 at 17:30 

필요한 것들을 먼저 설치하고

ubuntu@ip-172-31-24-62:~$ sudo apt-get install libmysqlclient18=5.5.33a+maria-1~saucy mysql-common=5.5.33a+maria-1~saucy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libmariadbclient18 mariadb-common
The following NEW packages will be installed:
  libmariadbclient18 libmysqlclient18 mariadb-common mysql-common
0 upgraded, 4 newly installed, 0 to remove and 20 not upgraded.
Need to get 874 kB of archives.
After this operation, 3,363 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main mysql-common all 5.5.33a+maria-1~saucy [8,802 B]
Get:2 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main mariadb-common all 5.5.33a+maria-1~saucy [3,254 B]
Get:3 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main libmysqlclient18 amd64 5.5.33a+maria-1~saucy [2,920 B]
Get:4 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main libmariadbclient18 amd64 5.5.33a+maria-1~saucy [859 kB]
Fetched 874 kB in 18s (47.0 kB/s)                                                                                                                                 
Selecting previously unselected package mysql-common.
(Reading database ... 53345 files and directories currently installed.)
Unpacking mysql-common (from .../mysql-common_5.5.33a+maria-1~saucy_all.deb) ...
Selecting previously unselected package mariadb-common.
Unpacking mariadb-common (from .../mariadb-common_5.5.33a+maria-1~saucy_all.deb) ...
Selecting previously unselected package libmysqlclient18.
Unpacking libmysqlclient18 (from .../libmysqlclient18_5.5.33a+maria-1~saucy_amd64.deb) ...
Selecting previously unselected package libmariadbclient18.
Unpacking libmariadbclient18 (from .../libmariadbclient18_5.5.33a+maria-1~saucy_amd64.deb) ...
Setting up mysql-common (5.5.33a+maria-1~saucy) ...
Setting up mariadb-common (5.5.33a+maria-1~saucy) ...
Setting up libmysqlclient18 (5.5.33a+maria-1~saucy) ...
Setting up libmariadbclient18 (5.5.33a+maria-1~saucy) ...
Processing triggers for libc-bin ...

본격적으로 mariadb-server 설치.

ubuntu@ip-172-31-24-62:~$ sudo apt-get install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl mariadb-client-5.5 mariadb-client-core-5.5 mariadb-server-5.5 mariadb-server-core-5.5
Suggested packages:
  libclone-perl libmldbm-perl libnet-daemon-perl libplrpc-perl libsql-statement-perl libipc-sharedcache-perl tinyca mailx mariadb-test
The following NEW packages will be installed:
  libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl mariadb-client-5.5 mariadb-client-core-5.5 mariadb-server mariadb-server-5.5
  mariadb-server-core-5.5
0 upgraded, 9 newly installed, 0 to remove and 22 not upgraded.
Need to get 32.3 MB of archives.
After this operation, 111 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main mariadb-client-core-5.5 amd64 5.5.33a+maria-1~saucy [1,845 kB]
Get:2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ saucy/main libaio1 amd64 0.3.109-4 [6,364 B]
Get:3 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ saucy/main libdbi-perl amd64 1.627-1 [874 kB]
Get:4 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ saucy/main libdbd-mysql-perl amd64 4.023-1 [97.3 kB]
Get:5 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ saucy/main libhtml-template-perl all 2.91-1 [65.1 kB]
Get:6 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main mariadb-client-5.5 amd64 5.5.33a+maria-1~saucy [5,122 kB]                                        
Get:7 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main mariadb-server-core-5.5 amd64 5.5.33a+maria-1~saucy [5,441 kB]                                   
Get:8 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main mariadb-server-5.5 amd64 5.5.33a+maria-1~saucy [18.8 MB]                                         
Get:9 http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu/ saucy/main mariadb-server all 5.5.33a+maria-1~saucy [2,956 B]                                               
Fetched 32.3 MB in 10min 34s (50.9 kB/s)                                                                                                                          
Preconfiguring packages ...
Selecting previously unselected package libaio1:amd64.
(Reading database ... 53375 files and directories currently installed.)
Unpacking libaio1:amd64 (from .../libaio1_0.3.109-4_amd64.deb) ...
Selecting previously unselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.627-1_amd64.deb) ...
Selecting previously unselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.023-1_amd64.deb) ...
Selecting previously unselected package mariadb-client-core-5.5.
Unpacking mariadb-client-core-5.5 (from .../mariadb-client-core-5.5_5.5.33a+maria-1~saucy_amd64.deb) ...
Selecting previously unselected package mariadb-client-5.5.
Unpacking mariadb-client-5.5 (from .../mariadb-client-5.5_5.5.33a+maria-1~saucy_amd64.deb) ...
Selecting previously unselected package mariadb-server-core-5.5.
Unpacking mariadb-server-core-5.5 (from .../mariadb-server-core-5.5_5.5.33a+maria-1~saucy_amd64.deb) ...
Selecting previously unselected package mariadb-server-5.5.
Unpacking mariadb-server-5.5 (from .../mariadb-server-5.5_5.5.33a+maria-1~saucy_amd64.deb) ...
Selecting previously unselected package libhtml-template-perl.
Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.91-1_all.deb) ...
Selecting previously unselected package mariadb-server.
Unpacking mariadb-server (from .../mariadb-server_5.5.33a+maria-1~saucy_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up libaio1:amd64 (0.3.109-4) ...
Setting up libdbi-perl (1.627-1) ...
Setting up libdbd-mysql-perl (4.023-1) ...
Setting up mariadb-client-core-5.5 (5.5.33a+maria-1~saucy) ...
Setting up mariadb-client-5.5 (5.5.33a+maria-1~saucy) ...
Setting up mariadb-server-core-5.5 (5.5.33a+maria-1~saucy) ...
Setting up mariadb-server-5.5 (5.5.33a+maria-1~saucy) ...
 * Stopping MariaDB database server mysqld                                                                                                                  [ OK ] 
131031  7:45:51 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
131031  7:45:51 [Note] Plugin 'InnoDB' is disabled.
131031  7:45:51 [Note] Plugin 'FEEDBACK' is disabled.
 * Starting MariaDB database server mysqld                                                                                                                  [ OK ] 
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
Setting up libhtml-template-perl (2.91-1) ...
Processing triggers for ureadahead ...
Setting up mariadb-server (5.5.33a+maria-1~saucy) ...
Processing triggers for libc-bin ...
ubuntu@ip-172-31-24-62:~$ 

중간에 root user의 패스워드 설정 부분이 나온다.


잘 설치됐나 테스트

ubuntu@ip-172-31-24-62:~$ mysql -v
ERROR 1045 (28000): Access denied for user 'ubuntu'@'localhost' (using password: NO)
ubuntu@ip-172-31-24-62:~$ 

db에 ubuntu라는 user가 없어서 저것도 안된다. 저 에러 메시지만 보여도 일단 설치는 잘 된거니까 본격적으로 접속이 잘 되는지 root user를 이용해 테스트한다.

ubuntu@ip-172-31-24-62:~$ mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 38
Server version: 5.5.33a-MariaDB-1~saucy-log mariadb.org binary distribution

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

잘 됨. 이제 Ubuntu에 mariadb용 계정 생성하고 mariadb에 계정 생성/권한 부여해서 진행하면 되겠다.

댓글 없음:

댓글 쓰기