服务器主机IP和虚拟浮动IP配置

RealServer A 192.168.75.133
RealServer B 192.168.75.134
VIP A 192.168.75.110
VIP B 192.168.75.111

安装KeepAlived软件包

[root@mysql-b ~]# yum install keepalived

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
keepalived i686 1.2.7-3.el6 base 170 k
Installing for dependencies:
libnl i686 1.1.4-2.el6 base 124 k
lm_sensors-libs i686 3.1.1-17.el6 base 37 k
net-snmp-libs i686 1:5.5-49.el6_5.1 updates 1.5 M
perl i686 4:5.10.1-136.el6 base 9.7 M
perl-Module-Pluggable i686 1:3.90-136.el6 base 40 k
perl-Pod-Escapes i686 1:1.04-136.el6 base 32 k
perl-Pod-Simple i686 1:3.13-136.el6 base 212 k
perl-libs i686 4:5.10.1-136.el6 base 593 k
perl-version i686 3:0.77-136.el6 base 51 k
Transaction Summary
================================================================================
Install 10 Package(s)

查看RPM包的文件路径

[root@mysql-a ~]# rpm -lq keepalived
/etc/keepalived
/etc/keepalived/keepalived.conf
/etc/rc.d/init.d/keepalived
/etc/sysconfig/keepalived
/usr/bin/genhash
/usr/sbin/keepalived
/usr/share/doc/keepalived-1.2.7
/usr/share/doc/keepalived-1.2.7/AUTHOR
/usr/share/doc/keepalived-1.2.7/CONTRIBUTORS
/usr/share/doc/keepalived-1.2.7/COPYING
/usr/share/doc/keepalived-1.2.7/ChangeLog
/usr/share/doc/keepalived-1.2.7/README
/usr/share/doc/keepalived-1.2.7/TODO
/usr/share/doc/keepalived-1.2.7/keepalived.conf.HTTP_GET.port
/usr/share/doc/keepalived-1.2.7/keepalived.conf.IPv6
/usr/share/doc/keepalived-1.2.7/keepalived.conf.SMTP_CHECK
/usr/share/doc/keepalived-1.2.7/keepalived.conf.SSL_GET
/usr/share/doc/keepalived-1.2.7/keepalived.conf.SYNOPSIS
/usr/share/doc/keepalived-1.2.7/keepalived.conf.fwmark
/usr/share/doc/keepalived-1.2.7/keepalived.conf.inhibit
/usr/share/doc/keepalived-1.2.7/keepalived.conf.misc_check
/usr/share/doc/keepalived-1.2.7/keepalived.conf.misc_check_arg
/usr/share/doc/keepalived-1.2.7/keepalived.conf.quorum
/usr/share/doc/keepalived-1.2.7/keepalived.conf.sample
/usr/share/doc/keepalived-1.2.7/keepalived.conf.status_code
/usr/share/doc/keepalived-1.2.7/keepalived.conf.track_interface
/usr/share/doc/keepalived-1.2.7/keepalived.conf.virtual_server_group
/usr/share/doc/keepalived-1.2.7/keepalived.conf.virtualhost
/usr/share/doc/keepalived-1.2.7/keepalived.conf.vrrp
/usr/share/doc/keepalived-1.2.7/keepalived.conf.vrrp.localcheck
/usr/share/doc/keepalived-1.2.7/keepalived.conf.vrrp.lvs_syncd
/usr/share/doc/keepalived-1.2.7/keepalived.conf.vrrp.routes
/usr/share/doc/keepalived-1.2.7/keepalived.conf.vrrp.scripts
/usr/share/doc/keepalived-1.2.7/keepalived.conf.vrrp.static_ipaddress
/usr/share/doc/keepalived-1.2.7/keepalived.conf.vrrp.sync
/usr/share/man/man1/genhash.1.gz
/usr/share/man/man5/keepalived.conf.5.gz
/usr/share/man/man8/keepalived.8.gz
/usr/share/snmp/mibs/KEEPALIVED-MIB.txt
[root@mysql-a ~]#

KeepAlived双主RealServer A配置
! Configuration File for keepalived

global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}

vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
#192.168.200.16
#192.168.200.17
#192.168.200.18
192.168.75.110
}
}

vrrp_instance VI_2 {
state BACKUP
interface eth0
virtual_router_id 52
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass 2222
}
virtual_ipaddress {
#192.168.200.16
#192.168.200.17
#192.168.200.18
192.168.75.111
}
}

KeepAlived双主RealServer B配置
! Configuration File for keepalived

global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}

vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
#192.168.200.16
#192.168.200.17
#192.168.200.18
192.168.75.110
}
}

vrrp_instance VI_2 {
state MASTER
interface eth0
virtual_router_id 52
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 2222
}
virtual_ipaddress {
#192.168.200.16
#192.168.200.17
#192.168.200.18
192.168.75.111
}
}
在RealServer B上启动KeepAlived服务
[root@mysql-b keepalived]# chkconfig –list keepalived
keepalived 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@mysql-b keepalived]# chkconfig –level 35 keepalived on
[root@mysql-b keepalived]# service keepalived start
Starting keepalived: [ OK ]
[root@mysql-b keepalived]#

查看两个Virtual IP信息
[root@mysql-b keepalived]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:0c:29:7c:b3:f2 brd ff:ff:ff:ff:ff:ff
inet 192.168.75.134/24 brd 192.168.75.255 scope global eth0
inet 192.168.75.110/32 scope global eth0
inet 192.168.75.111/32 scope global eth0
inet6 fe80::20c:29ff:fe7c:b3f2/64 scope link
valid_lft forever preferred_lft forever
[root@mysql-b keepalived]#
在RealServer A上启动KeepAlived服务后查看Virtual IP信息
[root@mysql-a keepalived]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:0c:29:13:94:f0 brd ff:ff:ff:ff:ff:ff
inet 192.168.75.133/24 brd 192.168.75.255 scope global eth0
inet 192.168.75.110/32 scope global eth0
inet6 fe80::20c:29ff:fe13:94f0/64 scope link
valid_lft forever preferred_lft forever
[root@mysql-a keepalived]#

在RealServer B上再次查看Virtual IP信息
[root@mysql-b keepalived]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:7c:b3:f2 brd ff:ff:ff:ff:ff:ff
inet 192.168.75.134/24 brd 192.168.75.255 scope global eth0
inet 192.168.75.111/32 scope global eth0
inet6 fe80::20c:29ff:fe7c:b3f2/64 scope link
valid_lft forever preferred_lft forever
[root@mysql-b keepalived]#
————————–MySQL

[root@mysql-a ~]# yum install mysql-server mysql

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql i686 5.1.73-3.el6_5 updates 903 k
mysql-server i686 5.1.73-3.el6_5 updates 8.8 M
Installing for dependencies:
perl-DBD-MySQL i686 4.013-3.el6 base 134 k
perl-DBI i686 1.609-4.el6 base 705 k

Transaction Summary
================================================================================
Install 4 Package(s)
[root@mysql-a ~]# /usr/bin/mysqladmin -u root password ‘mysqlpass’

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

server-id=1
log-bin=mysql-bin
binlog-ignore-db=mysql
binlog_format=mixed
expire_logs_days=7
sync_binlog=1

auto_increment_offset=1
auto_increment_increment=2
log_slave_updates

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

—————————
server-id=2
log-bin=mysql-bin
binlog-ignore-db=mysql
binlog_format=mixed
expire_logs_days=7
sync_binlog=1

auto_increment_offset=2
auto_increment_increment=2
log_slave_updates

———————————–
添加复制用户并授权
A

mysql> grant replication slave on *.* to repl@’192.168.75.134′ identified by ‘replpasswd’;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

B

mysql> grant replication slave on *.* to repl@’192.168.75.133′ identified by ‘replpasswd’;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

—————-
锁定表为只读状态,并查看二进制日志的当前位置信息
A

mysql> flush tables with read lock;
Query OK, 0 rows affected (0.00 sec)

mysql> show master status;
+——————+———-+————–+——————+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+——————+———-+————–+——————+
| mysql-bin.000001 | 348 | | mysql |
+——————+———-+————–+——————+
1 row in set (0.00 sec)
B

mysql> flush tables with read lock;
Query OK, 0 rows affected (0.00 sec)

mysql> show master status;
+——————+———-+————–+——————+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+——————+———-+————–+——————+
| mysql-bin.000003 | 491 | | mysql |
+——————+———-+————–+——————+
1 row in set (0.00 sec)
——————-
各自指定对方为master主机的连接配置信息和位置信息
A

mysql> change master to master_host=’192.168.75.134′,master_user=’repl’,master_password=’replpasswd’,master_log_file=’mysql-bin.000003′,master_log_pos=491;
Query OK, 0 rows affected (0.03 sec)

mysql>
B

mysql> change master to master_host=’192.168.75.133′,master_user=’repl’,master_password=’replpasswd’,master_log_file=’mysql-bin.000001′,master_log_pos=348;
Query OK, 0 rows affected (0.03 sec)

mysql>
————–
解除表锁定,分别启动Slave并查看复制运行状态
A

mysql> unlock tables;
Query OK, 0 rows affected (0.00 sec)

mysql> start slave;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.75.134
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 491
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 251
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 491
Relay_Log_Space: 407
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)

ERROR:
No query specified

mysql>

B
mysql> unlock tables;
Query OK, 0 rows affected (0.00 sec)

mysql> start slave;
Query OK, 0 rows affected (0.00 sec)
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.75.133
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 348
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 251
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 348
Relay_Log_Space: 407
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)

ERROR:
No query specified

mysql>

[root@mysql-a ~]# netstat -nt |grep 3306
tcp 0 0 192.168.75.133:3306 192.168.75.134:36244 ESTABLISHED
tcp 0 0 192.168.75.133:60121 192.168.75.134:3306 ESTABLISHED
[root@mysql-a ~]#
[root@mysql-b keepalived]# netstat -nt |grep 3306
tcp 0 0 192.168.75.134:3306 192.168.75.133:60121 ESTABLISHED
tcp 0 0 192.168.75.134:36244 192.168.75.133:3306 ESTABLISHED
[root@mysql-b keepalived]#
———————–
测试:
A
mysql> create database aaa;
Query OK, 1 row affected (0.00 sec)

mysql>
B

mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| aaa |
| mysql |
| test |
+——————–+
4 rows in set (0.00 sec)

mysql> create database bbb;
Query OK, 1 row affected (0.00 sec)

mysql>

A

mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| aaa |
| bbb |
| mysql |
| test |
+——————–+
5 rows in set (0.01 sec)

mysql>

——————–

VIP测试

A

mysql> create database ccc;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on ccc.* to cccuser@’%’;
Query OK, 0 rows affected (0.00 sec)

mysql> set password for cccuser@’%’=password(‘cccpwd’);
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql>
VIP 192.168.75.110

[root@localhost ~]# mysql -u cccuser -pcccpwd -h 192.168.75.110
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.73-log Source distribution

Copyright (c) 2000, 2013, 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> use ccc;
Database changed

mysql> create table list (id int(4) not null primary key auto_increment,
-> name char(20) not null,
-> address char(40) not null);
Query OK, 0 rows affected (0.01 sec)

mysql> show tables;
+—————+
| Tables_in_ccc |
+—————+
| list |
+—————+
1 row in set (0.00 sec)

mysql> quit
Bye
[root@localhost ~]#

VIP 192.168.75.111

[root@localhost ~]# mysql -u cccuser -pcccpwd -h 192.168.75.111
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.1.73-log Source distribution

Copyright (c) 2000, 2013, 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> use ccc;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+—————+
| Tables_in_ccc |
+—————+
| list |
+—————+
1 row in set (0.00 sec)

mysql> quit
Bye
[root@localhost ~]#
————————-
关闭RealServer B 测试KeepAlived VIP可用性和数据库连接
[root@localhost ~]# mysql -u cccuser -pcccpwd -h 192.168.75.110
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.1.73-log Source distribution

Copyright (c) 2000, 2013, 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> quit
Bye
[root@localhost ~]# mysql -u cccuser -pcccpwd -h 192.168.75.111
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.1.73-log Source distribution

Copyright (c) 2000, 2013, 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> quit
Bye
[root@localhost ~]#
在RealServer B关闭情况下的ping测试
[root@localhost ~]# ping -c 4 192.168.75.110
PING 192.168.75.110 (192.168.75.110) 56(84) bytes of data.
64 bytes from 192.168.75.110: icmp_seq=1 ttl=64 time=0.535 ms
64 bytes from 192.168.75.110: icmp_seq=2 ttl=64 time=0.312 ms
64 bytes from 192.168.75.110: icmp_seq=3 ttl=64 time=0.351 ms
64 bytes from 192.168.75.110: icmp_seq=4 ttl=64 time=0.356 ms

— 192.168.75.110 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.312/0.388/0.535/0.088 ms
[root@localhost ~]# ping -c 4 192.168.75.111
PING 192.168.75.111 (192.168.75.111) 56(84) bytes of data.
64 bytes from 192.168.75.111: icmp_seq=1 ttl=64 time=0.572 ms
64 bytes from 192.168.75.111: icmp_seq=2 ttl=64 time=0.301 ms
64 bytes from 192.168.75.111: icmp_seq=3 ttl=64 time=0.452 ms
64 bytes from 192.168.75.111: icmp_seq=4 ttl=64 time=0.293 ms

— 192.168.75.111 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 0.293/0.404/0.572/0.117 ms
[root@localhost ~]#

原文地址:http://www.linuxcache.com/archives/2831

转载请注明原文地址

【转载】MySQL和Keepalived高可用双主复制的更多相关文章

  1. Nginx+keepalived(高可用双主模式)

    Nginx+keepalived(高可用双主模式) tips:前面已经介绍了nginx+keepalived高可用主从模式,今天补充下高可用的双主模式,均可以作为主机使用 server1:192.16 ...

  2. MySQL的keepalived高可用监控脚本

    MySQL的keepalived高可用监控脚本 MySQL(或者其它服务)的keepalived高可用监控脚本 开发脚本需求 :我们知道,keepalive是基于虚拟ip的存活来判断是否抢占maste ...

  3. [Mysql高可用]——双主互备+keepalived

    实验架构图    实验环境 主机名 操作系统 Mysql版本 keepalived版本 主机IP VIP lyj1(Master/Slave) Red Hat release 6.5 Mysql5.6 ...

  4. 暑假打工 2 个 月,让我明白了 Keepalived 高可用的三种路由方案

    暑假打工 2 个 月,让我明白了 Keepalived 高可用的三种路由方案 这是悟空的第 158 篇原创文章 原文链接:首发悟空聊架构 官网:www.passjava.cn 你好,我是悟空. 前言 ...

  5. keepalived+mysql双主复制高可用方案

    MySQL双主复制,即互为Master-Slave(只有一个Master提供写操作),可以实现数据库服务器的热备,但是一个Master宕机后不能实现动态切换.而Keepalived通过虚拟IP,实现了 ...

  6. MySQL集群搭建(6)-双主+keepalived高可用

    双主 + keepalived 是一个比较简单的 MySQL 高可用架构,适用于中小 MySQL 集群,今天就说说怎么用 keepalived 做 MySQL 的高可用. 1 概述 1.1 keepa ...

  7. nginx+keepalived高可用及双主模式

    高可用有2中方式. 1.Nginx+keepalived 主从配置 这种方案,使用一个vip地址,前端使用2台机器,一台做主,一台做备,但同时只有一台机器工作,另一台备份机器在主机器不出现故障的时候, ...

  8. 基于Keepalived实现LVS双主高可用集群

    Reference:  https://mp.weixin.qq.com/s?src=3&timestamp=1512896424&ver=1&signature=L1C7us ...

  9. nginx+keepalived高可用及双主模式【h】

    高可用有2中方式. 1.Nginx+keepalived 主从配置 这种方案,使用一个vip地址,前端使用2台机器,一台做主,一台做备,但同时只有一台机器工作,另一台备份机器在主机器不出现故障的时候, ...

随机推荐

  1. Qt元类型(MetaType)注册门(使用qRegisterMetaType注册错误等级)

    昨天调试项目时,突然发现如下消息: QObject::connect: Cannot queue arguments of type 'ERROR_LEVEL' (Make sure 'ERROR_L ...

  2. windows安装rabbitMQ服务

    简介: RabbitMQ是流行的开源消息队列系统,用erlang语言开发.RabbitMQ是AMQP(高级消息队列协议)的标准实现. windows安装rabbitMQ服务步骤: 首先需要安装 Erl ...

  3. CoreData使用方法二:NSFetchedResultsController实例操作与解说

    学习了NSFetchedResultsController.才深深的体会到coredata的牛逼之处.原来Apple公司弄个新技术.不是平白无故的去弄,会给代码执行到来非常大的优点.coredata不 ...

  4. 基于 Android NDK 的学习之旅-----JNI 数据类型

    经典老套流程,学编程语言东西,先学它最基础的数据类型,JNI也是如此.JNI 定义了一系列基本数据类型和引用数据类型与java想对应. 1.基本数据类型 下面一张表是描述了 Java 基本数据类型和J ...

  5. html5-2 html实体和颜色有哪些

    html5-2 html实体和颜色有哪些 一.总结 一句话总结:网站配色用安全色. 1.颜色用什么类型的颜色(安全色)? 直接百度搜 安全色 即可 2.html实体常用哪6个,头尾符号是什么? 头是取 ...

  6. js时间和时间戳之间如何转换(汇总)

    js时间和时间戳之间如何转换(汇总) 一.总结 一句话总结: 1.js中通过new Date()来获取时间对象, 2.这个时间对象可以通过getTime()方法获取时间戳, 3.也可以通过getYea ...

  7. url前面双斜杠、单斜杠、无斜杠、点+单斜杠的总结

    原文:url前面双斜杠.单斜杠.无斜杠.点+单斜杠的总结 本来只是一个绝对url和相对url的简单问题,但实际使用中会碰到一些不常见的,比如双斜杠,经常不用竟然忘了,做一下总结.可以参考一下这篇文章 ...

  8. UiwebView and html

    基础篇: NSURL介绍 http://blog.csdn.net/ysy441088327/article/details/7416759 网页执行js代码   复制代码 stringByEvalu ...

  9. CSS知识总结之浏览器

    web页面浏览器渲染过程 1.解析html文件,并构建DOM树: 在DOM树中,每一个html标签都有一个对应的节点,并且每一个文本也有一个对应 的节点(js的textNode),DOM树的根节点就是 ...

  10. SpringMVC“Ambiguous mapping found. Cannot map 'XXXController' bean method”解决方法

    [转 :http://www.fanfanyu.cn/news/staticpagefile/2351.html] 最近在开发项目的过程中SpringMVC抛了个"Ambiguous map ...