10. mysql@16shots-default-db-0:~$ mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 193
Server version: 5.1.41-3ubuntu12.10-log (Ubuntu)
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
※説明の為、16shotsというアプリケーションを作成しています。
11. mysql> s
--------------
mysql Ver 14.14 Distrib 5.1.61, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 85
Current database:
Current user: root@ip-10-79-37-178.ec2.internal ←イーモバイルから接続しただけ
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.41-3ubuntu12.10-log (Ubuntu)
Protocol version: 10
Connection: ??????.dotcloud.com via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 18935
Uptime: 16 days 9 hours 52 min 0 sec
Threads: 1 Questions: 274 Slow queries: 0 Opens: 139 Flush tables: 1 Open tables: 33
Queries per second avg: 0.0
12. mysql> SHOW VARIABLES LIKE 'version%' G
*************************** 1. row ***************************
Variable_name: version
Value: 5.1.41-3ubuntu12.10-log
*************************** 2. row ***************************
Variable_name: version_comment
Value: (Ubuntu)
*************************** 3. row ***************************
Variable_name: version_compile_machine
Value: x86_64
*************************** 4. row ***************************
Variable_name: version_compile_os
Value: debian-linux-gnu
4 rows in set (0.00 sec)
14. [root@localhost ~]# mysql -h mysqlsdb.?????.eu-west-1.rds.amazonaws.com -u username -P
3306 -p databasename
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 45987481
Server version: 5.1.57-log MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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.
15. mysql> s
--------------
mysql Ver 14.14 Distrib 5.1.61, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 45987481
Current database: databasename
Current user: databasename@EM114-48-20-237.pool.e-mobile.ne.jp
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.57-log MySQL Community Server (GPL)
Protocol version: 10
Connection: mysqlsdb.???????.eu-west-1.rds.amazonaws.com via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3306
Uptime: 110 days 5 hours 55 min 5 sec
Threads: 22 Questions: 879893254 Slow queries: 1672 Opens: 21887591 Flush tables: 1
Open tables: 64 Queries per second avg: 92.374
--------------
16. mysql> SHOW VARIABLES LIKE 'version%' G
*************************** 1. row ***************************
Variable_name: version
Value: 5.1.57-log
*************************** 2. row ***************************
Variable_name: version_comment
Value: MySQL Community Server (GPL)
*************************** 3. row ***************************
Variable_name: version_compile_machine
Value: x86_64
*************************** 4. row ***************************
Variable_name: version_compile_os
Value: unknown-linux-gnu
4 rows in set (0.43 sec)
18. [root@localhost ~]# mysql -u username -P 9782 -h instancename.db.xeround.com -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 176
Server version: 5.1.42 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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>
19. mysql> s
Connection id: 23
Current database: mysql
--------------
mysql Ver 14.14 Distrib 5.1.61, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 23
Current database: mysql
Current user: username@EM111-188-50-181.pool.e-mobile.ne.jp
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.42 Source distribution
Protocol version: 10
Connection: ?????.db.xeround.com via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1
TCP port: 9782
Uptime: 55 min 19 sec
Threads: 3 Questions: 778 Slow queries: 0 Opens: 33 Flush tables: 1 Open tables: 26
Queries per second avg: 0.234
20. mysql> SHOW VARIABLES LIKE 'version%' G
*************************** 1. row ***************************
Variable_name: version
Value: 5.1.42
*************************** 2. row ***************************
Variable_name: version_comment
Value: Source distribution
*************************** 3. row ***************************
Variable_name: version_compile_machine
Value: x86_64
*************************** 4. row ***************************
Variable_name: version_compile_os
Value: unknown-linux-gnu
4 rows in set (0.20 sec)
24. mysql> SHOW PROCESSLIST G
*************************** 1. row ***************************
Id: 47
User: root
Host: ip-10-79-37-178.ec2.internal:33156
db: NULL
Command: Binlog Dump
Time: 621
State: Has sent all binlog to slave; waiting for binlog to be updated
Info: NULL
*************************** 2. row ***************************
Id: 48
User: root
Host: localhost
db: NULL
Command: Query
Time: 0
State: NULL
Info: SHOW PROCESSLIST
2 rows in set (0.01 sec)
25. で肝心のslave側にログインしたいのだか。。
mysql@16shots-default-db-0:~$ mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 221
Server version: 5.1.41-3ubuntu12.10-log (Ubuntu)
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> SHOW SLAVE HOSTS;
Empty set (0.00 sec)
mysql>
スレーブのマスター昇格は自動で行われる
(未確認 ※壊れた経験がありません。)
説明オワタ\(^o^)/
26. 念のため説明しますと、
[root@localhost ~]# dotcloud ssh 16shots.db
# $SHELL
mysql@16shots-default-db-0:~$ ifconfig
Warning: cannot open /proc/net/dev (No such file or directory). Limited output.
mysql@16shots-default-db-0:~$ ss
State Recv-Q Send-Q Local Address:Port Peer
Address:Port
mysql@16shots-default-db-0:~$ netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node PID/Program name Path
これらのコマンドではIPアドレスに関する情報は得られません。( ´・ω・)