sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator
Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").
Vector = {} | |
Vector.__index = Vector | |
function Vector.__add(a, b) | |
if type(a) == "number" then | |
return Vector.new(b.x + a, b.y + a) | |
elseif type(b) == "number" then | |
return Vector.new(a.x + b, a.y + b) | |
else | |
return Vector.new(a.x + b.x, a.y + b.y) |
常用的实现读写分离的方式有如下两种
第三方中间件,比较成熟的有Mysql官方提供的 MySQL Router以及 360公司基于MySQL-Proxy 0.8.2开发的开源 Atlas等
其次就是在应用中做解决,在 ActiveRecord
中做做处理, 如:octopus
本次实践的是用 gem octopus
来实现读写分离。
为了模拟读写分离,将 MySQL
分别安装在了本地 Mac
和阿里云 Linux
系统上,Mac
的 MySQL
作为写入数据库,而Linux的作为读取数据库。