SlideShare una empresa de Scribd logo
1 de 54
Descargar para leer sin conexión
MaxScale
MySQL Meetup - Madrid

Ivan	
  Zoratti	
  
V1401.01
Agenda
•Architecture	
  

•Use	
  Cases	
  

•Jargon	
  

•Documentation	
  and	
  More	
  

•Installation	
  

Material

•Configuration	
  
2
MaxScale	
  Architecture
MaxScale	
  -­‐	
  Objectives
•Highly	
  Scalable	
  

•Extendible	
  

•Lightweight,	
  with	
  small	
  footprint	
   •Must	
  provide	
  authentication	
  
•Minimum	
  possible	
  latency	
  
•Highly	
  available	
  

•Must	
  be	
  transparent	
  to	
  the	
  
application

!

4
MaxScale	
  Core
•Event	
  driven	
  network	
  I/O	
  processor	
  
•Polling,	
  event	
  driven	
  mechanism	
  that	
  is	
  responsible	
  for	
  dispatching	
  events	
  to	
  the	
  
various	
  modules	
  that	
  make	
  up	
  the	
  MaxScale	
  application	
  

•Events	
  in	
  MaxScale	
  =	
  Network	
  requests,	
  such	
  as:	
  

•Handling	
  an	
  incoming	
  connection	
  on	
  a	
  listener	
  socket	
  
•Incoming	
  data	
  for	
  a	
  client	
  connection	
  
•Data	
  arriving	
  on	
  a	
  connection	
  from	
  a	
  backend	
  database	
  server	
  
•A	
  socket	
  error	
  on	
  one	
  of	
  the	
  client	
  or	
  database	
  connections	
  
•A	
  socket	
  closure	
  
•The	
  availability	
  of	
  connections	
  to	
  receive	
  more	
  data
5
MaxScale	
  Polling
•Linux	
  epoll	
  mechanism	
  to	
  poll	
  for	
  activity	
  on	
  the	
  file	
  descriptors	
  
•The	
  epoll	
  mechanism	
  allows	
  a	
  file	
  descriptor	
  to	
  be	
  registered	
  along	
  with	
  some	
  
user	
  data	
  

•MaxScale	
  makes	
  use	
  of	
  this	
  user	
  data	
  to	
  register	
  a	
  descriptor	
  control	
  block	
  for	
  each	
  
descriptor

6
Descriptor	
  Control	
  Block	
  -­‐	
  DCB
•The	
  main	
  source	
  of	
  state	
  information	
  that	
  
is	
  used	
  within	
  the	
  event	
  processing	
  core	
  
of	
  MaxScale.	
  
•On	
  an	
  event	
  occurring	
  for	
  a	
  descriptor	
  the	
  
corresponding	
  DCB	
  is	
  used	
  to	
  determine	
  
how	
  that	
  event	
  should	
  be	
  handled.	
  

•DCB	
  Members:	
  

•State	
  -­‐	
  used	
  to	
  determine	
  where	
  in	
  its	
  lifecycle	
  
the	
  DCB	
  currently	
  is.	
  

•Func	
  -­‐	
  set	
  of	
  function	
  pointers	
  for	
  routines	
  that	
  
are	
  called	
  when	
  particular	
  events	
  occur	
  or	
  
when	
  MaxScale	
  wishes	
  to	
  perform	
  certain	
  
operations.	
  It	
  allows	
  MaxScale	
  to	
  be	
  extended	
  
to	
  support	
  new	
  protocols	
  without	
  the	
  need	
  to	
  
alter	
  the	
  MaxScale	
  core	
  itself.	
  
•Session	
  -­‐	
  a	
  pointer	
  to	
  the	
  session	
  to	
  which	
  this	
  
connection	
  belongs.	
  
•Service	
  -­‐	
  the	
  service	
  that	
  this	
  connection	
  
belongs	
  to.	
  
•Writeq	
  -­‐	
  a	
  pointer	
  to	
  a	
  chain	
  of	
  GWBUF	
  
structures	
  that	
  contain	
  data	
  waiting	
  to	
  be	
  
written.	
  
•Delayq	
  -­‐	
  similar	
  to	
  writeq,	
  it	
  buffer	
  data	
  that	
  
has	
  to	
  be	
  held	
  due	
  to	
  some	
  other	
  activity.
7
testroute              |  Router            |  V1.0.0
debugcli                |  Router            |  V1.0.0
readconnroute      |  Router            |  V1.0.0
(gdb)

Descriptor	
  Control	
  Block	
  -­‐	
  DCB
Descriptor Control Blocks

The  Descriptor  Control  Block  (DCB)  is  an  important  concept  within  MaxScale  since  it  is  this
block  that  is  passed  to  the  polling  system,  when  an  event  occurs  it  is  that  structure  that  is
available  and  from  this  structure  it  must  be  possible  to  navigate  to  all  other  structures  that
contain  state  regarding  the  session  and  protocol  in  use.

!
gw_dcb_state2string (int state) {!
! switch(state) {!
! ! case DCB_STATE_ALLOC:!
! ! ! return "DCB Allocated";!
! ! case DCB_STATE_POLLING:!
! ! ! return "DCB in the polling loop";!
! ! case DCB_STATE_LISTENING:!
! ! ! return "DCB for listening socket";!
! ! case DCB_STATE_DISCONNECTED:!
! ! ! return "DCB socket closed";!
! ! case DCB_STATE_FREED:!
! ! ! return "DCB memory could be freed";!
! ! case DCB_STATE_ZOMBIE:!
! ! ! return "DCB Zombie";!
! ! default:!
! ! ! return "DCB (unknown)";!
! }!
}

Similar  print  routines  exist  for  the  DCB
(gdb)  call  printAllDCBs()
DCB:  0x60ead0
DCB  state:
DCB  for  listening  socket
Queued  write  data:
0

8
Descriptor	
  Control	
  Block	
  -­‐	
  DCB
!
DCB: 0xfb1650!
! DCB state:
! Service:
! Statistics:!
! ! No. of Reads:
! ! No. of Writes:
! ! No. of Buffered
! ! No. of Accepts:
DCB: 0x1050bc0!
! DCB state:
! Service:
! Statistics:!
! ! No. of Reads:
! ! No. of Writes:
! ! No. of Buffered
! ! No. of Accepts:
DCB: 0xfae370!
! DCB state:
! Service:
! Statistics:!
! ! No. of Reads:
! ! No. of Writes:
! ! No. of Buffered
! ! No. of Accepts:
DCB: 0x107ff50!
! DCB state:
! Service:
! Connected to:
! Statistics:!
! ! No. of Reads:
! ! No. of Writes:
! ! No. of Buffered
! ! No. of Accepts:

!
DCB for listening socket!
RW Split Router!
0!
0!
Writes: 0!
1324!
DCB for listening socket!
HTTPD Router!
0!
0!
Writes: 0!
0!
DCB for listening socket!
Debug Interface!
0!
0!
Writes: 0!
1!

DCB: 0x10ed970!
! DCB state:
! Service:
! Statistics:!
! ! No. of Reads:
! ! No. of Writes:
! ! No. of Buffered
! ! No. of Accepts:
DCB: 0x10a0640!
! DCB state:
! Service:
! Statistics:!
! ! No. of Reads:
! ! No. of Writes:
! ! No. of Buffered
! ! No. of Accepts:
DCB: 0x10a6e40!
! DCB state:
! Service:
! Connected to:
! Statistics:!
! ! No. of Reads:
! ! No. of Writes:
! ! No. of Buffered
! ! No. of Accepts:

DCB in the polling loop!
RW Split Router!
4!
3!
Writes: 0!
0!
DCB in the polling loop!
RW Split Router!
3!
2!
Writes: 0!
0!
DCB in the polling loop!
Debug Interface!
127.0.0.1!
12!
205!
Writes: 0!
0!

DCB in the polling loop!
RW Split Router!
192.168.0.20!
3!
3!
Writes: 0!
0

9
MaxScale	
  Jargon
Backend	
  Database

•A	
  database	
  that	
  sits	
  behind	
  MaxScale	
  and	
  is	
  accessed	
  by	
  applications	
  
via	
  MaxScale

11
Module
•A	
  separate	
  code	
  entity	
  that	
  may	
  be	
  

loaded	
  dynamically	
  into	
  MaxScale	
  to	
  
increase	
  the	
  available	
  functionality.	
  

•Modules	
  are	
  implemented	
  as	
  run-­‐
time	
  loadable	
  shared	
  objects

!

MaxScale> show modules!
!

Module Name
| Module Type | Version!
----------------+-------------+---------!
MySQLBackend
| Protocol
| V2.0.0!
telnetd
| Protocol
| V1.0.1!
HTTPD
| Protocol
| V1.0.1!
MySQLClient
| Protocol
| V1.0.0!
mysqlmon
| Monitor
| V1.0.0!
readwritesplit | Router
| V1.0.2!
testroute
| Router
| V1.0.0!
debugcli
| Router
| V1.0.1

12
Server
•An	
  individual	
  database	
  server	
  to	
  which	
  
a	
  client	
  can	
  be	
  connected	
  via	
  MaxScale

!
MaxScale> show servers!
Server 0xfae860!
! Server:
192.168.0.21!
! Status:
Master, Running!
! Protocol:! !
MySQLBackend!
! Port:! ! !
3306!
! Number of connections: 1320!
! Current no. of connections:!1!
Server 0xfb15c0!
! Server:
192.168.0.22!
! Status:
Slave, Running!
! Protocol:
MySQLBackend!
! Port:
3306!
! Number of connections: 298!
! Current no. of connections:!0!
Server 0xfb1530!
! Server:
192.168.0.23!
! Status:
Slave, Running!
! Protocol:
MySQLBackend!
! Port:
3306!
! Number of connections: 365!
! Current no. of connections:!0!
Server 0xfb14a0!
! Server:
192.168.0.24!
! Status:
Slave, Running!
! Protocol:
MySQLBackend!
! Port:
3306!
! Number of connections: 365!
! Current no. of connections:!0!
Server 0xfb1410!
! Server:
192.168.0.25!
! Status:
Slave, Running!
! Protocol:
MySQLBackend!
! Port:
3306!
! Number of connections: 292!
! Current no. of connections:!1!
MaxScale>

13
Monitor
•A	
  module	
  that	
  can	
  be	
  executed	
  within	
  MaxScale	
  to	
  monitor	
  the	
  state	
  
of	
  a	
  set	
  of	
  database.	
  

•The	
  use	
  of	
  an	
  internal	
  monitor	
  is	
  optional,	
  monitoring	
  may	
  be	
  
performed	
  externally	
  to	
  MaxScale.

!
MaxScale> show monitors!
Monitor: 0x104ddc0!
! Name:! ! MariaDB10 Monitor!
! Monitor running!
! Monitored servers:!192.168.0.21:3306, 192.168.0.22:3306, 192.168.0.23:3306, 192.168.0.24:3306, 192.168.0.25:3306

14
Router
•A	
  module	
  within	
  MaxScale	
  that	
  will	
  route	
  client	
  request	
  to	
  the	
  various	
  
database	
  server	
  which	
  MaxScale	
  provides	
  a	
  service	
  interface	
  to

15
Connection	
  Routing
•A	
  method	
  of	
  handling	
  requests	
  in	
  which	
  MaxScale	
  will	
  accept	
  

connections	
  from	
  a	
  client	
  and	
  route	
  data	
  on	
  that	
  connection	
  to	
  a	
  
single	
  database	
  using	
  a	
  single	
  connection.	
  

•Connection	
  based	
  routing	
  sets	
  the	
  connection	
  to	
  a	
  database	
  and	
  it	
  
does	
  not	
  examine	
  requests	
  on	
  the	
  connection.	
  

•Once	
  the	
  connection	
  with	
  a	
  database	
  is	
  established,	
  it	
  cannot	
  be	
  
moved.

16
Statement	
  Routing
•A	
  method	
  of	
  handling	
  requests	
  in	
  which	
  each	
  request	
  within	
  a	
  
connection	
  will	
  be	
  handled	
  individually.	
  

•Requests	
  may	
  be	
  sent	
  to	
  one	
  or	
  more	
  servers	
  and	
  connections	
  may	
  
be	
  dynamically	
  added	
  or	
  removed	
  from	
  the	
  session.

17
Protocol
•A	
  software	
  module	
  that	
  is	
  used	
  to	
  communicate	
  with	
  another	
  
software	
  entity	
  within	
  the	
  system.	
  

•MaxScale	
  supports	
  the	
  dynamic	
  loading	
  of	
  protocol	
  modules.

18
Listener
•The	
  network	
  endpoint	
  that	
  is	
  used	
  to	
  listen	
  for	
  connections	
  to	
  
MaxScale	
  from	
  the	
  client	
  applications.	
  

•A	
  listener	
  is	
  associated	
  to	
  a	
  single	
  service,	
  however	
  a	
  service	
  may	
  have	
  
many	
  listeners.

19
Service
•MaxScale	
  offers	
  a	
  set	
  of	
  services	
  to	
  the	
  clients	
  
•Each	
  service	
  is	
  a	
  protocol/port	
  pair	
  +	
  a	
  query	
  routing	
  
module	
  +	
  backends	
  

•The	
  protocol	
  that	
  should	
  be	
  used	
  
•The	
  port	
  on	
  which	
  to	
  listen	
  for	
  incoming	
  client	
  requests	
  
•The	
  query	
  routing	
  module	
  defines	
  the	
  choice	
  of	
  backed	
  

server	
  used	
  to	
  execute	
  the	
  statement	
  received	
  from	
  the	
  client	
  
•The	
  backends	
  are	
  the	
  servers	
  that	
  statements	
  may	
  be	
  sent	
  to	
  
as	
  part	
  of	
  this	
  service	
  

•A	
  service	
  may	
  have	
  more	
  than	
  one	
  protocol/port	
  
associated	
  with	
  it

!
MaxScale> show services!
Service 0x104cd40!
! Service:! ! RW Split Router!
! Router:! ! ! readwritesplit (0x7ff2a1921d40)!
! Number of router sessions:
! 1320!
! Current no. of router sessions:
! 1!
! Number of queries forwarded:
!
34308!
! Number of queries forwarded to master:!
26691!
! Number of queries forwarded to slave: !
6189!
! Number of queries forwarded to all:
!
1428!
! Started:! ! Wed Jan 1 11:15:17 2014!
! Backend databases!
! ! 192.168.0.25:3306 Protocol: MySQLBackend!
! ! 192.168.0.24:3306 Protocol: MySQLBackend!
! ! 192.168.0.23:3306 Protocol: MySQLBackend!
! ! 192.168.0.22:3306 Protocol: MySQLBackend!
! ! 192.168.0.21:3306 Protocol: MySQLBackend!
! Users data:
! 0x104dd00!
! Total connections:! 1321!
! Currently connected:!2!
Service 0xfaf380!
! Service:! ! HTTPD Router!
! Router:! ! ! testroute (0x7ff2a1b277c0)!
! Started:! ! Wed Jan 1 11:15:17 2014!
! Backend databases!
! ! 192.168.0.25:3306 Protocol: MySQLBackend!
! ! 192.168.0.24:3306 Protocol: MySQLBackend!
! ! 192.168.0.23:3306 Protocol: MySQLBackend!
! ! 192.168.0.22:3306 Protocol: MySQLBackend!
! ! 192.168.0.21:3306 Protocol: MySQLBackend!
! Users data:
! 0xfaf740!
! Total connections:! 1!
! Currently connected:!1!
Service 0xfae8f0!
! Service:! ! Debug Interface!
! Router:! ! ! debugcli (0x7ff2a1d31500)!
! Started:! ! Wed Jan 1 11:15:17 2014!
! Backend databases!
! Users data:
! 0xfaf1b0!
! Total connections:! 2!
! Currently connected:!2

20
Connection	
  Failover

•When	
  a	
  connection	
  currently	
  being	
  used	
  between	
  MaxScale	
  and	
  the	
  
database	
  server	
  fails	
  a	
  replacement	
  will	
  be	
  automatically	
  created	
  to	
  
another	
  server	
  by	
  MaxScale	
  without	
  client	
  intervention

21
MaxScale	
  Installation
Download	
  &	
  Unpack
!
[root@Sky6
[root@Sky6
[root@Sky6
[root@Sky6
[root@Sky6
[root@Sky6
…!
[root@Sky6
…!
drwxr-xr-x
…!
[root@Sky6
total 48!
drwxr-xr-x
-rw-r--r-drwxr-xr-x
drwxr-xr-x
-rw-r--r-drwxr-xr-x
-rw-r--r--rw-r--r--

~]# cd!
~]# curl ftp://ftp.skysql.com/downloads/Dev/maxscale.preview.0.4.tar.gz > maxscale.preview.0.4.tar.gz!
~]# cd /usr/local!
local]# mkdir skysql!
local]# cd skysql!
skysql]# tar xzvf ~/maxscale.preview.0.4.tar.gz!
skysql]# ls -l!
6 10045 2000 4096 Dec 16 18:14 maxscale!
skysql]# ls -l maxscale!
2
1
2
2
1
6
1
1

10045
10045
10045
10045
10045
10045
10045
10045

2000 4096 Dec 16 15:18
2000
754 Dec 16 17:56
2000 4096 Dec 16 16:43
2000 4096 Dec 16 16:24
2000 18011 Dec 16 17:56
2000 4096 Dec 16 16:38
2000
30 Dec 16 16:26
2000 1542 Dec 16 18:13

bin!
COPYRIGHT!
Documentation!
lib!
LICENSE!
MaxScale!
my.cnf!
SETUP

Check

MaxScale	
  Configuraeon	
  And	
  Usage	
  Scenarios.pdf
23
Start	
  MaxScale
!

[root@Sky6 ~]# /usr/local/skysql/maxscale/bin/maxscale -h!
!

SkySQL MaxScale! Tue Dec 31 17:34:59 2013!
------------------------------------------------------!
*!
* Usage : maxscale [-h] | [-d] [-c <home directory>] [-f <config file name>]!
* where:!
* -h help!
* -d enable running in terminal process (default:disabled)!
* -c relative|absolute MaxScale home directory!
* -f relative|absolute pathname of MaxScale configuration file (default:MAXSCALE_HOME/etc/MaxScale.cnf)!
*

24
Set	
  the	
  Environment	
  Variables	
  
and	
  Start	
  MaxScale
!

[root@Sky6 ~]# MAXSCALE_HOME=/usr/local/skysql/maxscale/MaxScale!
[root@Sky6 ~]# LD_LIBRARY_PATH=/usr/local/skysql/maxscale/lib!
[root@Sky6 ~]# /usr/local/skysql/maxscale/bin/maxscale!
!
!

SkySQL MaxScale! Tue Dec 31 14:59:16 2013!
------------------------------------------------------!
Info : MaxScale will be run in a daemon process.!
! See the log from the following log files :!
!

Error log
Message log
Trace log
Debug log

:!
:!
:!
:!

/usr/local/skysql/maxscale/MaxScale/log/skygw_err1.log!
/usr/local/skysql/maxscale/MaxScale/log/skygw_msg1.log!
/usr/local/skysql/maxscale/MaxScale/log/skygw_trace1.log!
/usr/local/skysql/maxscale/MaxScale/log/skygw_debug1.log!

!

Listening MySQL connections at 0.0.0.0:4004!
Listening http connections at 0.0.0.0:6444!
Listening telnet connections at 0.0.0.0:4444

…or	
  create	
  a	
  3	
  lines	
  script
25
Checking	
  MaxScale
!

[root@Sky6 ~]# telnet localhost 4444!
Trying ::1...!
telnet: connect to address ::1: Connection refused!
Trying 127.0.0.1...!
Connected to localhost.!
Escape character is '^]'.!
Welcome the SkySQL MaxScale Debug Interface (V1.0.1).!
Type help for a list of available commands.!
!

MaxScale login: admin!
Password:!
!

MaxScale>

UID/PWD:	
  admin	
  /	
  skysql

!
MaxScale> help!
Available commands:!
add user!
clear server!
remove user!
restart monitor!
restart service!
set server!
show dcbs!
show dcb!
show dbusers!
show epoll!
show modules!
show monitors!
show server!
show servers!
show services!
show session!
show sessions!
show users!
shutdown maxscale!
shutdown monitor!
shutdown service!
reload config!
reload dbusers!
enable log!
disable log
26
MaxScale	
  Configuration
Configuration	
  Template
!
[root@Sky6 etc]# cat MaxScale_template.cnf!
#!
# Example MaxScale.cnf configuration file!
#!
# Number of server threads!
# Valid options are:!
# ! hreads=<number of threads>!
t
!
[maxscale]!
threads=1!
…!
!
[Monitor Module]!
…!
!
[R/W Split Module]!
…!
!
[Read Connection Router]!
…!
!
[HTTPD Router]!
…!
!
[Debug Interface]!
…

!
# Listener definitions for the services!
#!
# Valid options are:!
#!
# ! ervice=<name of service defined elsewhere>!
s
# ! rotocol=<name of protocol module with which to listen>!
p
# ! ort=<Listening port>!
p
!
[RW Split Listener]!
…!
!
[Read Connection Listener]!
…!
!
[Debug Listener]!
…!
!
[HTTPD Listener]!
…!
!
# Definition of the servers!
!
[server1]!
…!
!
[serverN]!
…
28
Database	
  Settings
•Create	
  a	
  valid	
  MaxScale	
  user	
  

•Allow	
  access	
  from	
  the	
  MaxScale	
  node

!

MariaDB [test]> create user maxuser identified by 'maxpwd';!
Query OK, 0 rows affected (0.01 sec)!
!

MariaDB [test]> grant all on *.* to maxuser@‘192.168.0.26’;!
Query OK, 0 rows affected (0.00 sec)

29
Global	
  Settings
!

•Settings	
  used	
  to	
  configure	
  the	
  core	
  of	
  MaxScale	
  

[maxscale]!
threads=1!

•Options:	
  

•threads	
  -­‐	
  number	
  of	
  user	
  threads	
  that	
  poll	
  for	
  network	
  

traffic	
  
• Start	
  with	
  the	
  smallest	
  number	
  and	
  try	
  to	
  increase	
  to	
  
check	
  the	
  impact	
  on	
  high	
  workload	
  
• This	
  parameter	
  does	
  not	
  include	
  the	
  number	
  of	
  
“internal	
  threads”	
  

30
Server	
  Settings
•Settings	
  used	
  to	
  configure	
  the	
  backend	
  
•type	
  -­‐	
  the	
  server	
  type	
  
•Options:	
  

•address	
  -­‐	
  The	
  IP	
  address	
  used	
  by	
  MaxScale	
  to	
  connect	
  to	
  the	
  server	
  
•port	
  -­‐	
  The	
  TCP	
  port	
  used	
  by	
  MaxScale	
  to	
  connect	
  to	
  the	
  server	
  
•Protocol	
  -­‐	
  The	
  DB	
  protocol.	
  
• MySQLBackend	
  is	
  the	
  native	
  MySQL	
  protocol	
  
•MonitorUser	
  -­‐	
  The	
  DB	
  user	
  used	
  by	
  MaxScale	
  to	
  connect	
  with	
  the	
  
Monitoring	
  module	
  
• When	
  MonitorUser	
  is	
  not	
  present,	
  MaxScale	
  uses	
  the	
  credentials	
  set	
  in	
  the	
  
Monitor	
  section	
  

•MonitorPW	
  -­‐	
  The	
  DB	
  user	
  password

!

[max1]!
type=server!
address=192.168.0.21!
port=3006!
protocol=MySQLBackend!
!

[max2]!
type=server!
address=192.168.0.22!
port=3006!
protocol=MySQLBackend!
!

…!
!

[max5]!
type=server!
address=192.168.0.25!
port=3006!
protocol=MySQLBackend

31
Monitor	
  Settings
•Settings	
  used	
  to	
  configure	
  the	
  monitor	
  module	
  for	
  
MySQL/MariaDB	
  
•type	
  -­‐	
  the	
  monitor	
  type	
  

•Options:	
  

•module	
  -­‐	
  The	
  loadable	
  module,	
  mysqlmon	
  for	
  MySQL/

MariaDB	
  
•servers	
  -­‐	
  Comma	
  separated	
  list	
  of	
  the	
  servers	
  to	
  monitor	
  
• Servers	
  must	
  be	
  of	
  the	
  same	
  type	
  (e.g.	
  MySQL/MariaDB	
  servers)	
  
•user	
  -­‐	
  DB	
  user	
  used	
  to	
  connect	
  to	
  the	
  server	
  
• Used	
  when	
  the	
  credentials	
  are	
  not	
  available	
  in	
  the	
  server	
  section	
  
•passwd	
  -­‐	
  DB	
  user	
  password

!

[MariaDB10 Monitor]!
type=monitor!
module=mysqlmon!
servers=max1,!
max2,!
max3,!
max4,!
max5!
user=maxuser!
passwd=maxpwd

32
SLB	
  with	
  Read/Write	
  Split	
  Service	
  Settings
•Settings	
  used	
  to	
  configure	
  the	
  service	
  module	
  for	
  

statement-­‐based	
  load	
  balancing	
  (with	
  read/write	
  
splitting)	
  
•type	
  -­‐	
  the	
  service	
  type	
  

•Options:	
  

•router	
  -­‐	
  The	
  loadable	
  module,	
  readwritesplit	
  for	
  MySQL/

MariaDB	
  R/W	
  splitting	
  with	
  MySQL	
  Replication	
  
•servers	
  -­‐	
  Comma	
  separated	
  list	
  of	
  the	
  servers	
  to	
  monitor	
  
•user	
  -­‐	
  DB	
  user	
  used	
  to	
  connect	
  to	
  the	
  server	
  to	
  extract	
  the	
  
list	
  of	
  the	
  database	
  users	
  to	
  allow	
  local	
  authentication	
  
•passwd	
  -­‐	
  DB	
  user	
  password

!

[RW Split Router]!
type=service!
router=readwritesplit!
servers=max1,!
max2,!
max3,!
max4,!
max5 !
user=maxuser!
passwd=maxpwd

33
CLB	
  Service	
  Settings
•Settings	
  used	
  to	
  configure	
  the	
  service	
  module	
  for	
  statement-­‐
based	
  load	
  balancing	
  (with	
  read/write	
  splitting)	
  
•type	
  -­‐	
  the	
  service	
  type	
  

•Options:	
  

•router	
  -­‐	
  The	
  loadable	
  module,	
  readconnroute	
  for	
  connection	
  load	
  

balancing	
  with	
  MySQL	
  Replication	
  
•router_options	
  -­‐	
  options	
  passed	
  to	
  the	
  module.	
  
• slave	
  means	
  that	
  the	
  load	
  balancing	
  is	
  applied	
  only	
  to	
  the	
  slave	
  servers	
  
• master,slave	
  means	
  that	
  the	
  load	
  balancing	
  is	
  applied	
  master	
  and	
  slave	
  servers	
  
•servers	
  -­‐	
  Comma	
  separated	
  list	
  of	
  the	
  servers	
  to	
  monitor	
  
•user	
  -­‐	
  DB	
  user	
  used	
  to	
  connect	
  to	
  the	
  server	
  to	
  extract	
  the	
  list	
  of	
  the	
  
database	
  users	
  to	
  allow	
  local	
  authentication	
  
•passwd	
  -­‐	
  DB	
  user	
  password

!

[Read Connection Router]!
type=service!
router=readconnroute!
router_options=slave!
servers=max1,!
max2,!
max3,!
max4,!
max5!
user=maxuser!
passwd=maxpwd

34
Listener	
  Settings	
  -­‐	
  SLB
!

•Set	
  the	
  Protocol	
  and	
  Service	
  pair.	
  This	
  is	
  used	
  to	
  offer	
  the	
  SLB	
  
with	
  Read/Write	
  Splitting	
  
•type	
  -­‐	
  the	
  listener	
  type	
  

[RW Split Listener]!
type=listener!
service=RW Split Router!
protocol=MySQLClient!
port=4006!

•Options:	
  

•service	
  -­‐	
  The	
  service	
  associated	
  to	
  the	
  listener	
  (e.g.	
  RW	
  Split	
  Router)	
  
•protocol	
  -­‐	
  The	
  protocol	
  paired	
  to	
  the	
  service	
  (e.g.	
  MySQLClient)	
  
•port	
  -­‐	
  The	
  TCP	
  port	
  used	
  to	
  listen	
  to	
  the	
  client	
  requests

35
Listener	
  Settings	
  -­‐	
  Debug	
  &	
  HTTP
!

•These	
  listeners	
  are	
  used	
  to	
  offer	
  a	
  debug	
  and	
  a	
  HTTP	
  interface	
  
to	
  MaxScale	
  
•type	
  -­‐	
  the	
  listener	
  type	
  

•Options:	
  

•service	
  -­‐	
  DBAs	
  can	
  connect	
  to	
  MaxScale	
  using	
  telnet	
  or	
  via	
  a	
  restful	
  API	
  
•protocol	
  -­‐	
  The	
  protocol	
  paired	
  to	
  the	
  service	
  (e.g.	
  telnetd	
  and	
  httpd	
  )	
  
•port	
  -­‐	
  The	
  TCP	
  port	
  used	
  to	
  listen	
  to	
  the	
  client	
  requests

[Debug Listener]!
type=listener!
service=Debug Interface!
protocol=telnetd!
port=4444!
!

[HTTPD Listener]!
type=listener!
service=HTTPD Router!
protocol=HTTPD!
port=6444

36
Final	
  Configuration
!
[root@Sky6 etc]# cat MaxScale.cnf!
#!
# Number of server threads!
# Valid options are:!
# !
threads=<number of threads>!
[maxscale]!
threads=1!
!
#!
# Define a monitor that can be used to determine the state!
# and role of the servers.!
#!
# Valid options are:!
#!
# !
module=<name of module to load>!
# !
servers=<server name>,<server name>,...!
# !
user =<user name - must have slave replication and!
#
slave client privileges>!
# !
passwd=<password of the above user,

#
plain text currently>!
[MariaDB10 Monitor]!
type=monitor!
module=mysqlmon!
servers=max1,max2,max3,max4,max5!
user=maxuser!
passwd=maxpwd

!
#!
# A series of service definition!
#!
# Valid options are:!
#!
# !
router=<name of router module>!
# !
servers=<server name>,<server name>,...!
# !
user=<User to fetch password inforamtion with>!
# !
passwd=<Password of the user, plain text currently>!
#!
# Valid router modules currently are:!
# !
readwritesplit, readconnroute and debugcli!
[RW Split Router]!
type=service!
router=readwritesplit!
servers=max1,max2,max3,max4,max5!
user=maxuser!
passwd=maxpwd!
!
[HTTPD Router]!
type=service!
router=testroute!
servers=max1,max2,max3,max4,max5!
!
[Debug Interface]!
type=service!
router=debugcli
37
Final	
  Configuration
!
#!
# Listener definitions for the services!
#!
# Valid options are:!
#!
# !
service=<name of service defined elsewhere>!
# !
protocol=<name of protocol module with which to listen>!
# !
port=<Listening port>!
[RW Split Listener]!
type=listener!
service=RW Split Router!
protocol=MySQLClient!
port=4004!
!
[Debug Listener]!
type=listener!
service=Debug Interface!
protocol=telnetd!
port=4444!
!
[HTTPD Listener]!
type=listener!
service=HTTPD Router!
protocol=HTTPD!
port=6444!

!
# Servers Definition!
[max1]!
type=server!
address=192.168.0.21!
port=3306!
protocol=MySQLBackend!

!
[max2]!
type=server!
address=192.168.0.22!
port=3306!
protocol=MySQLBackend!

!
[max3]!
type=server!
address=192.168.0.23!
port=3306!
protocol=MySQLBackend!

!
[max4]!
type=server!
address=192.168.0.24!
port=3306!
protocol=MySQLBackend!

!
[max5]!
type=server!
address=192.168.0.25!
port=3306!
protocol=MySQLBackend

38
Password	
  Encryption
•Used	
  to	
  remove	
  plain	
  password	
  from	
  the	
  config	
  
file	
  

•Passwords	
  are	
  stored	
  in	
  a	
  readonly	
  file	
  (default	
  
$MAXSCALE_HOME/etc/.secrets)	
  

•Plain	
  passwords	
  in	
  the	
  config	
  file	
  can	
  be	
  replaced	
  
with	
  the	
  encrypted	
  password

!
[root@Sky6 ~]# /usr/local/skysql/maxscale/bin/
maxkeys /usr/local/skysql/maxscale/MaxScale/
etc/.secrets!
!
[root@Sky6 ~]# MAXSCALE_HOME=/usr/local/skysql/
maxscale/MaxScale!
[root@Sky6 ~]# /usr/local/skysql/maxscale/bin/
maxpasswd maxpwd!
14AE17C29AE7E6DB94EA5E6068D9833D!
!
[root@Sky6 ~]# vi /usr/local/skysql/maxscale/
MaxScale/etc/MaxScale.cnf!
!
…!
[MariaDB10 Monitor]!
type=monitor!
module=mysqlmon!
servers=max1,max2,max3,max4,max5!
user=maxuser!
passwd=14AE17C29AE7E6DB94EA5E6068D9833D!
…

39
Checking	
  MaxScale
SLB	
  R/W	
  Splimer	
  (for	
  the	
  users)

RESTful	
  API	
  (under	
  development)

Telnet	
  Interface	
  (for	
  debugging	
  and	
  DBAs)

!

MaxScale> show services!
Service 0x8e1d40!
! Service:! ! RW Split Router!
! Router:! ! ! readwritesplit (0x7ff7dd4d0d40)!
! Number of router sessions:
! 0!
! Current no. of router sessions:
! 0!
! Number of queries forwarded:
! 0!
! Number of queries forwarded to master:! 0!
! Number of queries forwarded to slave: ! 0!
! Number of queries forwarded to all:
! 0!
! Started:! ! Tue Dec 31 17:36:13 2013!
! Backend databases!
! ! 192.168.0.25:3006 Protocol: MySQLBackend!
! ! 192.168.0.24:3006 Protocol: MySQLBackend!
! ! 192.168.0.23:3006 Protocol: MySQLBackend!
! ! 192.168.0.22:3006 Protocol: MySQLBackend!
! ! 192.168.0.21:3006 Protocol: MySQLBackend!
! Users data:
!0x8e2d00!
! Total connections:! 1!
! Currently connected:! 1!
Service 0x844380!
! Service:! ! HTTPD Router!
! Router:! ! ! testroute (0x7ff7dd6d67c0)!
! Started:! ! Tue Dec 31 17:36:13 2013!
! Backend databases!
! ! 192.168.0.25:3006 Protocol: MySQLBackend!
! ! 192.168.0.24:3006 Protocol: MySQLBackend!
! ! 192.168.0.23:3006 Protocol: MySQLBackend!
! ! 192.168.0.22:3006 Protocol: MySQLBackend!
! ! 192.168.0.21:3006 Protocol: MySQLBackend!
! Users data:
!0x844740!
! Total connections:! 1!
! Currently connected:! 1!
Service 0x8438f0!
! Service:! ! Debug Interface!
! Router:! ! ! debugcli (0x7ff7dd8e0500)!
! Started:! ! Tue Dec 31 17:36:13 2013!
! Backend databases!
! Users data:
!0x8441b0!
! Total connections:! 2!
! Currently connected:! 2

40
Troubleshooting
!

2013 12/31 17:47:24 Error : access for secrets file [/usr/local/skysql/maxscale/MaxScale/etc/.secrets]
failed. Error 2, No such file or directory.

MaxScale	
  cannot	
  fine	
  the	
  encrypted	
  password	
  file

!

[root@Sky6 bin]# /usr/local/skysql/maxscale/MaxScale/bin/maxkeys /usr/local/skysql/maxscale/MaxScale/
etc/.secrets!

41
Troubleshooting
!

[root@Sky0 ~]# mysql -uroot -h 192.168.0.26 -P4004 -p!
Enter password:!
ERROR 1045 (2800): Authorization failed!
[root@Sky0 ~]#
root	
  is	
  not	
  loaded	
  to	
  the	
  available	
  users	
  to	
  
connect	
  via	
  MaxScale
!

<<<< User [root] was not found!
<<< CLIENT AUTH FAILED for user [root]!
!

[root@Sky0 ~]# mysql -umaxuser -h 192.168.0.26 -P4004 -pmaxpwd!
Welcome to the MariaDB monitor. Commands end with ; or g.!
Your MySQL connection id is 1535!
Server version: 5.5.22-SKYSQL-0.1.0 MariaDB Server!
!

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

Careful	
  with	
  this!

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

MySQL [(none)]>
42
Troubleshooting

From	
  MaxScale

You	
  see	
  the	
  Max1	
  process	
  list

!
MySQL [(none)]> show processlist;!
+-----+---------+-------------------+------+-------------+-------+----------------------------------------+------------------+----------+!
| Id | User
| Host
| db
| Command
| Time | State
| Info
| Progress |!
+-----+---------+-------------------+------+-------------+-------+----------------------------------------+------------------+----------+!
|
5 | root
| skycluster3:33830 | NULL | Binlog Dump | 82453 | Master has sent all binlog to slave; … | NULL
|
0.000 |!
|
6 | root
| skycluster4:43403 | NULL | Binlog Dump | 82389 | Master has sent all binlog to slave; … | NULL
|
0.000 |!
|
7 | root
| skycluster5:46878 | NULL | Binlog Dump | 82382 | Master has sent all binlog to slave; … | NULL
|
0.000 |!
|
8 | root
| skycluster2:54912 | NULL | Binlog Dump | 82376 | Master has sent all binlog to slave; … | NULL
|
0.000 |!
| 100 | root
| skycluster0:41977 | NULL | Sleep
|
0 |
| NULL
|
0.000 |!
| 101 | root
| skycluster0:41997 | NULL | Sleep
|
60 |
| NULL
|
0.000 |!
| 129 | maxuser | skycluster6:55557 | NULL | Sleep
|
5 |
| NULL
|
0.000 |!
| 132 | maxuser | skycluster6:55565 | NULL | Query
|
0 | init
| show processlist |
0.000 |!
| 135 | maxuser | skycluster6:55571 | NULL | Sleep
|
41 |
| NULL
|
0.000 |!
+-----+---------+-------------------+------+-------------+-------+----------------------------------------+------------------+----------+!
9 rows in set (0.00 sec)

This	
  is	
  directly	
  from	
  Max2
!
MariaDB [(none)]> show processlist;!
+----+-------------+-------------------+------+---------+-------+----------------------------------+------------------+----------+!
| Id | User
| Host
| db
| Command | Time | State
| Info
| Progress |!
+----+-------------+-------------------+------+---------+-------+----------------------------------+------------------+----------+!
| 4 | system user |
| NULL | Connect | 82804 | Waiting for master to send event | NULL
|
0.000 |!
| 5 | system user |
| NULL | Connect | 73387 | Slave has read all relay log; wa…| NULL
|
0.000 |!
| 14 | root
| skycluster0:35933 | NULL | Sleep
|
0 |
| NULL
|
0.000 |!
| 15 | root
| skycluster0:35936 | NULL | Sleep
|
216 |
| NULL
|
0.000 |!
| 44 | maxuser
| skycluster6:46518 | NULL | Sleep
|
3 |
| NULL
|
0.000 |!
| 46 | root
| localhost
| NULL | Query
|
0 | init
| show processlist |
0.000 |!
+----+-------------+-------------------+------+---------+-------+----------------------------------+------------------+----------+!
6 rows in set (0.00 sec)

43
MaxScale	
  Use	
  Cases

with	
  the	
  current	
  version
MaxScale	
  with	
  MySQL	
  Replication

using	
  Connection	
  Load	
  Balancing

For	
  applicaLons	
  that	
  are	
  “ReplicaLon	
  aware”,	
  i.e.	
  they	
  can	
  use	
  
2	
  connecLons,	
  one	
  for	
  the	
  master	
  and	
  one	
  for	
  the	
  slave	
  servers
MaxScale

Each	
  applicaeon	
  server	
  uses	
  2	
  conneceon:

1	
  Read/Write,	
  1	
  Read/Only
Conneceon	
  load	
  balancing	
  is	
  fast,	
  lightweight	
  
and	
  it	
  provides	
  high	
  availability

Database

Database

Database

Database

Database

MaxScale	
  connects	
  the	
  R/W	
  client	
  
conneceon	
  to	
  the	
  master	
  and	
  it	
  load	
  
balances	
  the	
  R/O	
  client	
  conneceon	
  to	
  
one	
  of	
  the	
  slaves
MHA	
  provides	
  the	
  automaec	
  failover	
  
in	
  case	
  of	
  fault	
  of	
  the	
  master
45
MaxScale	
  with	
  MySQL	
  Replication

using	
  Connection	
  Load	
  Balancing
[Write Listener]
type=listener
service=Write Service
protocol=MySQLClient
port=4007

[Read Listener]
type=listener
service=Read Service
protocol=MySQLClient
port=4006
MaxScale

[Write Service]
type=service
router=readconnroute
router_options=master
servers=s1,s2,s3,s4,s5
user=maxuser
auth=maxpwd

[Read Service]
type=service
router=readconnroute
router_options=slave
servers=s1,s2,s3,s4,s5
user=maxuser
auth=maxpwd
Database

Database

Database

Database

Database

46
MaxScale	
  with	
  Galera


using	
  Connection	
  Load	
  Balancing
Each	
  applicaeon	
  server	
  
uses	
  only	
  1	
  conneceon

For	
  applicaLons	
  that	
  can	
  use	
  the“all-­‐
master”	
  capabiliLes	
  of	
  Galera

MaxScale

MaxScale	
  monitors	
  the	
  state	
  of	
  each	
  
Galera	
  Cluster	
  and	
  it	
  applies	
  load	
  
balancing	
  only	
  on	
  synced	
  	
  nodes

MaxScale	
  load	
  balances	
  the	
  client	
  
conneceons	
  to	
  the	
  Galera	
  nodes
Database

Database

Database

47
MaxScale	
  with	
  Galera


using	
  Connection	
  Load	
  Balancing
[Read Listener]
type=listener
service=Read Service
protocol=MySQLClient
port=4006
MaxScale

[Galera Service]
type=service
router=readconnroute
router_options=synced
servers=s1,s2,s3,s4,s5
user=maxuser
auth=maxpwd

Database

Database

Database

48
MaxScale	
  with	
  MySQL	
  Replication

using	
  Read/Write	
  Splitting
Each	
  applicaeon	
  server	
  
uses	
  only	
  1	
  conneceon

For	
  applicaLons	
  that	
  have	
  been	
  
designed	
  to	
  work	
  with	
  a	
  single	
  server	
  
and	
  require	
  read	
  scalability

MaxScale

MaxScale	
  monitors	
  the	
  state	
  of	
  each	
  
node	
  and	
  it	
  applies	
  load	
  balancing	
  
only	
  on	
  the	
  available	
  slaves

Database

Database

Database

Database

Database

MaxScale	
  creates	
  2	
  conneceons,	
  one	
  
for	
  R/W	
  on	
  the	
  master	
  node	
  and	
  one	
  
R/O	
  load	
  balanced	
  on	
  the	
  slave	
  	
  nodes

49
How	
  does	
  MaxScale	
  compare	
  to…
•HA	
  Proxy	
  
•MySQL	
  Proxy	
  
•Sharding	
  solutions	
  -­‐	
  ScaleBase,	
  DBShards,	
  Parelastic,	
  etc.

50
JSON	
  over	
  http	
  and	
  BSON

Strictly	
  Confidential	
  	
  -­‐	
  SkySQL	
  Internal	
  Use	
  Only

51
NDB	
  API

Strictly	
  Confidential	
  	
  -­‐	
  SkySQL	
  Internal	
  Use	
  Only

52
Where	
  To	
  Find	
  More	
  Material
GitHub	
  Project

hUps://github.com/skysql/MaxScale

Tarball

hUps://downloads.skysql.com/files/SkySQL/MaxScale

Documentaeon

hUps://github.com/skysql/MaxScale/tree/master/DocumentaLon

53
Thank	
  You!

www.skysql.com

Más contenido relacionado

La actualidad más candente

MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB Corporation
 
Moskva Architecture Highload
Moskva Architecture HighloadMoskva Architecture Highload
Moskva Architecture HighloadOntico
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLRené Cannaò
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQLMydbops
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteMarco Tusa
 
SQL, NoSQL, NewSQL? What's a developer to do?
SQL, NoSQL, NewSQL? What's a developer to do?SQL, NoSQL, NewSQL? What's a developer to do?
SQL, NoSQL, NewSQL? What's a developer to do?Chris Richardson
 
An Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformAn Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformMongoDB
 
Introducing Infinispan
Introducing InfinispanIntroducing Infinispan
Introducing InfinispanPT.JUG
 
MongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMydbops
 
gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020James Newton-King
 
Policy based cluster management in oracle 12c
Policy based cluster management in oracle 12c Policy based cluster management in oracle 12c
Policy based cluster management in oracle 12c Anju Garg
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
Vijfhart thema-avond-oracle-12c-new-features
Vijfhart thema-avond-oracle-12c-new-featuresVijfhart thema-avond-oracle-12c-new-features
Vijfhart thema-avond-oracle-12c-new-featuresmkorremans
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScaleMariaDB plc
 
MySQL HA with Pacemaker
MySQL HA with  PacemakerMySQL HA with  Pacemaker
MySQL HA with PacemakerKris Buytaert
 
Cassandra Summit 2014: Huge Online Genealogical Database Driven By Cassandra
Cassandra Summit 2014: Huge Online Genealogical Database Driven By CassandraCassandra Summit 2014: Huge Online Genealogical Database Driven By Cassandra
Cassandra Summit 2014: Huge Online Genealogical Database Driven By CassandraDataStax Academy
 
LibX 2.0
LibX 2.0LibX 2.0
LibX 2.0eby
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB
 
CFCamp 2016 - Couchbase Overview
CFCamp 2016 - Couchbase OverviewCFCamp 2016 - Couchbase Overview
CFCamp 2016 - Couchbase OverviewAaron Benton
 

La actualidad más candente (20)

MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
 
Ch20
Ch20Ch20
Ch20
 
Moskva Architecture Highload
Moskva Architecture HighloadMoskva Architecture Highload
Moskva Architecture Highload
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynote
 
SQL, NoSQL, NewSQL? What's a developer to do?
SQL, NoSQL, NewSQL? What's a developer to do?SQL, NoSQL, NewSQL? What's a developer to do?
SQL, NoSQL, NewSQL? What's a developer to do?
 
An Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformAn Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media Platform
 
Introducing Infinispan
Introducing InfinispanIntroducing Infinispan
Introducing Infinispan
 
MongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To Transactions
 
gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020
 
Policy based cluster management in oracle 12c
Policy based cluster management in oracle 12c Policy based cluster management in oracle 12c
Policy based cluster management in oracle 12c
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
Vijfhart thema-avond-oracle-12c-new-features
Vijfhart thema-avond-oracle-12c-new-featuresVijfhart thema-avond-oracle-12c-new-features
Vijfhart thema-avond-oracle-12c-new-features
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
 
MySQL HA with Pacemaker
MySQL HA with  PacemakerMySQL HA with  Pacemaker
MySQL HA with Pacemaker
 
Cassandra Summit 2014: Huge Online Genealogical Database Driven By Cassandra
Cassandra Summit 2014: Huge Online Genealogical Database Driven By CassandraCassandra Summit 2014: Huge Online Genealogical Database Driven By Cassandra
Cassandra Summit 2014: Huge Online Genealogical Database Driven By Cassandra
 
LibX 2.0
LibX 2.0LibX 2.0
LibX 2.0
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
 
CFCamp 2016 - Couchbase Overview
CFCamp 2016 - Couchbase OverviewCFCamp 2016 - Couchbase Overview
CFCamp 2016 - Couchbase Overview
 

Similar a 140116 max scale-for_madrid_meetup

Data Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDCData Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDCAbhijit Kumar
 
Membase Meetup - Silicon Valley
Membase Meetup - Silicon ValleyMembase Meetup - Silicon Valley
Membase Meetup - Silicon ValleyMembase
 
All Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZAll Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZconfluent
 
Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...
Databus - Abhishek Bhargava &  Maheswaran Veluchamy - DevOps Bangalore Meetup...Databus - Abhishek Bhargava &  Maheswaran Veluchamy - DevOps Bangalore Meetup...
Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...DevOpsBangalore
 
autonomous-database-100.pdf
autonomous-database-100.pdfautonomous-database-100.pdf
autonomous-database-100.pdfTrLuNguyn
 
Data Handning with Sqlite for Android
Data Handning with Sqlite for AndroidData Handning with Sqlite for Android
Data Handning with Sqlite for AndroidJakir Hossain
 
Top 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseTop 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseSandesh Rao
 
Using a Fast Operational Database to Build Real-time Streaming Aggregations
Using a Fast Operational Database to Build Real-time Streaming AggregationsUsing a Fast Operational Database to Build Real-time Streaming Aggregations
Using a Fast Operational Database to Build Real-time Streaming AggregationsVoltDB
 
Whats new in Autonomous Database in 2022
Whats new in Autonomous Database in 2022Whats new in Autonomous Database in 2022
Whats new in Autonomous Database in 2022Sandesh Rao
 
Hadoop & no sql new generation database systems
Hadoop & no sql   new generation database systemsHadoop & no sql   new generation database systems
Hadoop & no sql new generation database systemsramazan fırın
 
Informix - The Ideal Database for IoT
Informix - The Ideal Database for IoTInformix - The Ideal Database for IoT
Informix - The Ideal Database for IoTPradeep Natarajan
 
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce PlatformMongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce PlatformMongoDB
 
Agility and Scalability with MongoDB
Agility and Scalability with MongoDBAgility and Scalability with MongoDB
Agility and Scalability with MongoDBMongoDB
 
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...confluent
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsTeamstudio
 
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...Dhruv Sharma
 

Similar a 140116 max scale-for_madrid_meetup (20)

Data Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDCData Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDC
 
Membase Meetup - Silicon Valley
Membase Meetup - Silicon ValleyMembase Meetup - Silicon Valley
Membase Meetup - Silicon Valley
 
All Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZAll Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZ
 
Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...
Databus - Abhishek Bhargava &  Maheswaran Veluchamy - DevOps Bangalore Meetup...Databus - Abhishek Bhargava &  Maheswaran Veluchamy - DevOps Bangalore Meetup...
Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...
 
autonomous-database-100.pdf
autonomous-database-100.pdfautonomous-database-100.pdf
autonomous-database-100.pdf
 
VoltDB on SolftLayer Cloud
VoltDB on SolftLayer CloudVoltDB on SolftLayer Cloud
VoltDB on SolftLayer Cloud
 
Data Handning with Sqlite for Android
Data Handning with Sqlite for AndroidData Handning with Sqlite for Android
Data Handning with Sqlite for Android
 
Top 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseTop 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous Database
 
Using a Fast Operational Database to Build Real-time Streaming Aggregations
Using a Fast Operational Database to Build Real-time Streaming AggregationsUsing a Fast Operational Database to Build Real-time Streaming Aggregations
Using a Fast Operational Database to Build Real-time Streaming Aggregations
 
Whats new in Autonomous Database in 2022
Whats new in Autonomous Database in 2022Whats new in Autonomous Database in 2022
Whats new in Autonomous Database in 2022
 
Chap3 3 12
Chap3 3 12Chap3 3 12
Chap3 3 12
 
Hadoop & no sql new generation database systems
Hadoop & no sql   new generation database systemsHadoop & no sql   new generation database systems
Hadoop & no sql new generation database systems
 
Informix - The Ideal Database for IoT
Informix - The Ideal Database for IoTInformix - The Ideal Database for IoT
Informix - The Ideal Database for IoT
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce PlatformMongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
 
Agility and Scalability with MongoDB
Agility and Scalability with MongoDBAgility and Scalability with MongoDB
Agility and Scalability with MongoDB
 
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...
 
Scalable Web Apps
Scalable Web AppsScalable Web Apps
Scalable Web Apps
 

Último

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Último (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

140116 max scale-for_madrid_meetup

  • 1. MaxScale MySQL Meetup - Madrid Ivan  Zoratti   V1401.01
  • 2. Agenda •Architecture   •Use  Cases   •Jargon   •Documentation  and  More   •Installation   Material •Configuration   2
  • 4. MaxScale  -­‐  Objectives •Highly  Scalable   •Extendible   •Lightweight,  with  small  footprint   •Must  provide  authentication   •Minimum  possible  latency   •Highly  available   •Must  be  transparent  to  the   application ! 4
  • 5. MaxScale  Core •Event  driven  network  I/O  processor   •Polling,  event  driven  mechanism  that  is  responsible  for  dispatching  events  to  the   various  modules  that  make  up  the  MaxScale  application   •Events  in  MaxScale  =  Network  requests,  such  as:   •Handling  an  incoming  connection  on  a  listener  socket   •Incoming  data  for  a  client  connection   •Data  arriving  on  a  connection  from  a  backend  database  server   •A  socket  error  on  one  of  the  client  or  database  connections   •A  socket  closure   •The  availability  of  connections  to  receive  more  data 5
  • 6. MaxScale  Polling •Linux  epoll  mechanism  to  poll  for  activity  on  the  file  descriptors   •The  epoll  mechanism  allows  a  file  descriptor  to  be  registered  along  with  some   user  data   •MaxScale  makes  use  of  this  user  data  to  register  a  descriptor  control  block  for  each   descriptor 6
  • 7. Descriptor  Control  Block  -­‐  DCB •The  main  source  of  state  information  that   is  used  within  the  event  processing  core   of  MaxScale.   •On  an  event  occurring  for  a  descriptor  the   corresponding  DCB  is  used  to  determine   how  that  event  should  be  handled.   •DCB  Members:   •State  -­‐  used  to  determine  where  in  its  lifecycle   the  DCB  currently  is.   •Func  -­‐  set  of  function  pointers  for  routines  that   are  called  when  particular  events  occur  or   when  MaxScale  wishes  to  perform  certain   operations.  It  allows  MaxScale  to  be  extended   to  support  new  protocols  without  the  need  to   alter  the  MaxScale  core  itself.   •Session  -­‐  a  pointer  to  the  session  to  which  this   connection  belongs.   •Service  -­‐  the  service  that  this  connection   belongs  to.   •Writeq  -­‐  a  pointer  to  a  chain  of  GWBUF   structures  that  contain  data  waiting  to  be   written.   •Delayq  -­‐  similar  to  writeq,  it  buffer  data  that   has  to  be  held  due  to  some  other  activity. 7
  • 8. testroute              |  Router            |  V1.0.0 debugcli                |  Router            |  V1.0.0 readconnroute      |  Router            |  V1.0.0 (gdb) Descriptor  Control  Block  -­‐  DCB Descriptor Control Blocks The  Descriptor  Control  Block  (DCB)  is  an  important  concept  within  MaxScale  since  it  is  this block  that  is  passed  to  the  polling  system,  when  an  event  occurs  it  is  that  structure  that  is available  and  from  this  structure  it  must  be  possible  to  navigate  to  all  other  structures  that contain  state  regarding  the  session  and  protocol  in  use. ! gw_dcb_state2string (int state) {! ! switch(state) {! ! ! case DCB_STATE_ALLOC:! ! ! ! return "DCB Allocated";! ! ! case DCB_STATE_POLLING:! ! ! ! return "DCB in the polling loop";! ! ! case DCB_STATE_LISTENING:! ! ! ! return "DCB for listening socket";! ! ! case DCB_STATE_DISCONNECTED:! ! ! ! return "DCB socket closed";! ! ! case DCB_STATE_FREED:! ! ! ! return "DCB memory could be freed";! ! ! case DCB_STATE_ZOMBIE:! ! ! ! return "DCB Zombie";! ! ! default:! ! ! ! return "DCB (unknown)";! ! }! } Similar  print  routines  exist  for  the  DCB (gdb)  call  printAllDCBs() DCB:  0x60ead0 DCB  state: DCB  for  listening  socket Queued  write  data: 0 8
  • 9. Descriptor  Control  Block  -­‐  DCB ! DCB: 0xfb1650! ! DCB state: ! Service: ! Statistics:! ! ! No. of Reads: ! ! No. of Writes: ! ! No. of Buffered ! ! No. of Accepts: DCB: 0x1050bc0! ! DCB state: ! Service: ! Statistics:! ! ! No. of Reads: ! ! No. of Writes: ! ! No. of Buffered ! ! No. of Accepts: DCB: 0xfae370! ! DCB state: ! Service: ! Statistics:! ! ! No. of Reads: ! ! No. of Writes: ! ! No. of Buffered ! ! No. of Accepts: DCB: 0x107ff50! ! DCB state: ! Service: ! Connected to: ! Statistics:! ! ! No. of Reads: ! ! No. of Writes: ! ! No. of Buffered ! ! No. of Accepts: ! DCB for listening socket! RW Split Router! 0! 0! Writes: 0! 1324! DCB for listening socket! HTTPD Router! 0! 0! Writes: 0! 0! DCB for listening socket! Debug Interface! 0! 0! Writes: 0! 1! DCB: 0x10ed970! ! DCB state: ! Service: ! Statistics:! ! ! No. of Reads: ! ! No. of Writes: ! ! No. of Buffered ! ! No. of Accepts: DCB: 0x10a0640! ! DCB state: ! Service: ! Statistics:! ! ! No. of Reads: ! ! No. of Writes: ! ! No. of Buffered ! ! No. of Accepts: DCB: 0x10a6e40! ! DCB state: ! Service: ! Connected to: ! Statistics:! ! ! No. of Reads: ! ! No. of Writes: ! ! No. of Buffered ! ! No. of Accepts: DCB in the polling loop! RW Split Router! 4! 3! Writes: 0! 0! DCB in the polling loop! RW Split Router! 3! 2! Writes: 0! 0! DCB in the polling loop! Debug Interface! 127.0.0.1! 12! 205! Writes: 0! 0! DCB in the polling loop! RW Split Router! 192.168.0.20! 3! 3! Writes: 0! 0 9
  • 11. Backend  Database •A  database  that  sits  behind  MaxScale  and  is  accessed  by  applications   via  MaxScale 11
  • 12. Module •A  separate  code  entity  that  may  be   loaded  dynamically  into  MaxScale  to   increase  the  available  functionality.   •Modules  are  implemented  as  run-­‐ time  loadable  shared  objects ! MaxScale> show modules! ! Module Name | Module Type | Version! ----------------+-------------+---------! MySQLBackend | Protocol | V2.0.0! telnetd | Protocol | V1.0.1! HTTPD | Protocol | V1.0.1! MySQLClient | Protocol | V1.0.0! mysqlmon | Monitor | V1.0.0! readwritesplit | Router | V1.0.2! testroute | Router | V1.0.0! debugcli | Router | V1.0.1 12
  • 13. Server •An  individual  database  server  to  which   a  client  can  be  connected  via  MaxScale ! MaxScale> show servers! Server 0xfae860! ! Server: 192.168.0.21! ! Status: Master, Running! ! Protocol:! ! MySQLBackend! ! Port:! ! ! 3306! ! Number of connections: 1320! ! Current no. of connections:!1! Server 0xfb15c0! ! Server: 192.168.0.22! ! Status: Slave, Running! ! Protocol: MySQLBackend! ! Port: 3306! ! Number of connections: 298! ! Current no. of connections:!0! Server 0xfb1530! ! Server: 192.168.0.23! ! Status: Slave, Running! ! Protocol: MySQLBackend! ! Port: 3306! ! Number of connections: 365! ! Current no. of connections:!0! Server 0xfb14a0! ! Server: 192.168.0.24! ! Status: Slave, Running! ! Protocol: MySQLBackend! ! Port: 3306! ! Number of connections: 365! ! Current no. of connections:!0! Server 0xfb1410! ! Server: 192.168.0.25! ! Status: Slave, Running! ! Protocol: MySQLBackend! ! Port: 3306! ! Number of connections: 292! ! Current no. of connections:!1! MaxScale> 13
  • 14. Monitor •A  module  that  can  be  executed  within  MaxScale  to  monitor  the  state   of  a  set  of  database.   •The  use  of  an  internal  monitor  is  optional,  monitoring  may  be   performed  externally  to  MaxScale. ! MaxScale> show monitors! Monitor: 0x104ddc0! ! Name:! ! MariaDB10 Monitor! ! Monitor running! ! Monitored servers:!192.168.0.21:3306, 192.168.0.22:3306, 192.168.0.23:3306, 192.168.0.24:3306, 192.168.0.25:3306 14
  • 15. Router •A  module  within  MaxScale  that  will  route  client  request  to  the  various   database  server  which  MaxScale  provides  a  service  interface  to 15
  • 16. Connection  Routing •A  method  of  handling  requests  in  which  MaxScale  will  accept   connections  from  a  client  and  route  data  on  that  connection  to  a   single  database  using  a  single  connection.   •Connection  based  routing  sets  the  connection  to  a  database  and  it   does  not  examine  requests  on  the  connection.   •Once  the  connection  with  a  database  is  established,  it  cannot  be   moved. 16
  • 17. Statement  Routing •A  method  of  handling  requests  in  which  each  request  within  a   connection  will  be  handled  individually.   •Requests  may  be  sent  to  one  or  more  servers  and  connections  may   be  dynamically  added  or  removed  from  the  session. 17
  • 18. Protocol •A  software  module  that  is  used  to  communicate  with  another   software  entity  within  the  system.   •MaxScale  supports  the  dynamic  loading  of  protocol  modules. 18
  • 19. Listener •The  network  endpoint  that  is  used  to  listen  for  connections  to   MaxScale  from  the  client  applications.   •A  listener  is  associated  to  a  single  service,  however  a  service  may  have   many  listeners. 19
  • 20. Service •MaxScale  offers  a  set  of  services  to  the  clients   •Each  service  is  a  protocol/port  pair  +  a  query  routing   module  +  backends   •The  protocol  that  should  be  used   •The  port  on  which  to  listen  for  incoming  client  requests   •The  query  routing  module  defines  the  choice  of  backed   server  used  to  execute  the  statement  received  from  the  client   •The  backends  are  the  servers  that  statements  may  be  sent  to   as  part  of  this  service   •A  service  may  have  more  than  one  protocol/port   associated  with  it ! MaxScale> show services! Service 0x104cd40! ! Service:! ! RW Split Router! ! Router:! ! ! readwritesplit (0x7ff2a1921d40)! ! Number of router sessions: ! 1320! ! Current no. of router sessions: ! 1! ! Number of queries forwarded: ! 34308! ! Number of queries forwarded to master:! 26691! ! Number of queries forwarded to slave: ! 6189! ! Number of queries forwarded to all: ! 1428! ! Started:! ! Wed Jan 1 11:15:17 2014! ! Backend databases! ! ! 192.168.0.25:3306 Protocol: MySQLBackend! ! ! 192.168.0.24:3306 Protocol: MySQLBackend! ! ! 192.168.0.23:3306 Protocol: MySQLBackend! ! ! 192.168.0.22:3306 Protocol: MySQLBackend! ! ! 192.168.0.21:3306 Protocol: MySQLBackend! ! Users data: ! 0x104dd00! ! Total connections:! 1321! ! Currently connected:!2! Service 0xfaf380! ! Service:! ! HTTPD Router! ! Router:! ! ! testroute (0x7ff2a1b277c0)! ! Started:! ! Wed Jan 1 11:15:17 2014! ! Backend databases! ! ! 192.168.0.25:3306 Protocol: MySQLBackend! ! ! 192.168.0.24:3306 Protocol: MySQLBackend! ! ! 192.168.0.23:3306 Protocol: MySQLBackend! ! ! 192.168.0.22:3306 Protocol: MySQLBackend! ! ! 192.168.0.21:3306 Protocol: MySQLBackend! ! Users data: ! 0xfaf740! ! Total connections:! 1! ! Currently connected:!1! Service 0xfae8f0! ! Service:! ! Debug Interface! ! Router:! ! ! debugcli (0x7ff2a1d31500)! ! Started:! ! Wed Jan 1 11:15:17 2014! ! Backend databases! ! Users data: ! 0xfaf1b0! ! Total connections:! 2! ! Currently connected:!2 20
  • 21. Connection  Failover •When  a  connection  currently  being  used  between  MaxScale  and  the   database  server  fails  a  replacement  will  be  automatically  created  to   another  server  by  MaxScale  without  client  intervention 21
  • 23. Download  &  Unpack ! [root@Sky6 [root@Sky6 [root@Sky6 [root@Sky6 [root@Sky6 [root@Sky6 …! [root@Sky6 …! drwxr-xr-x …! [root@Sky6 total 48! drwxr-xr-x -rw-r--r-drwxr-xr-x drwxr-xr-x -rw-r--r-drwxr-xr-x -rw-r--r--rw-r--r-- ~]# cd! ~]# curl ftp://ftp.skysql.com/downloads/Dev/maxscale.preview.0.4.tar.gz > maxscale.preview.0.4.tar.gz! ~]# cd /usr/local! local]# mkdir skysql! local]# cd skysql! skysql]# tar xzvf ~/maxscale.preview.0.4.tar.gz! skysql]# ls -l! 6 10045 2000 4096 Dec 16 18:14 maxscale! skysql]# ls -l maxscale! 2 1 2 2 1 6 1 1 10045 10045 10045 10045 10045 10045 10045 10045 2000 4096 Dec 16 15:18 2000 754 Dec 16 17:56 2000 4096 Dec 16 16:43 2000 4096 Dec 16 16:24 2000 18011 Dec 16 17:56 2000 4096 Dec 16 16:38 2000 30 Dec 16 16:26 2000 1542 Dec 16 18:13 bin! COPYRIGHT! Documentation! lib! LICENSE! MaxScale! my.cnf! SETUP Check
 MaxScale  Configuraeon  And  Usage  Scenarios.pdf 23
  • 24. Start  MaxScale ! [root@Sky6 ~]# /usr/local/skysql/maxscale/bin/maxscale -h! ! SkySQL MaxScale! Tue Dec 31 17:34:59 2013! ------------------------------------------------------! *! * Usage : maxscale [-h] | [-d] [-c <home directory>] [-f <config file name>]! * where:! * -h help! * -d enable running in terminal process (default:disabled)! * -c relative|absolute MaxScale home directory! * -f relative|absolute pathname of MaxScale configuration file (default:MAXSCALE_HOME/etc/MaxScale.cnf)! * 24
  • 25. Set  the  Environment  Variables   and  Start  MaxScale ! [root@Sky6 ~]# MAXSCALE_HOME=/usr/local/skysql/maxscale/MaxScale! [root@Sky6 ~]# LD_LIBRARY_PATH=/usr/local/skysql/maxscale/lib! [root@Sky6 ~]# /usr/local/skysql/maxscale/bin/maxscale! ! ! SkySQL MaxScale! Tue Dec 31 14:59:16 2013! ------------------------------------------------------! Info : MaxScale will be run in a daemon process.! ! See the log from the following log files :! ! Error log Message log Trace log Debug log :! :! :! :! /usr/local/skysql/maxscale/MaxScale/log/skygw_err1.log! /usr/local/skysql/maxscale/MaxScale/log/skygw_msg1.log! /usr/local/skysql/maxscale/MaxScale/log/skygw_trace1.log! /usr/local/skysql/maxscale/MaxScale/log/skygw_debug1.log! ! Listening MySQL connections at 0.0.0.0:4004! Listening http connections at 0.0.0.0:6444! Listening telnet connections at 0.0.0.0:4444 …or  create  a  3  lines  script 25
  • 26. Checking  MaxScale ! [root@Sky6 ~]# telnet localhost 4444! Trying ::1...! telnet: connect to address ::1: Connection refused! Trying 127.0.0.1...! Connected to localhost.! Escape character is '^]'.! Welcome the SkySQL MaxScale Debug Interface (V1.0.1).! Type help for a list of available commands.! ! MaxScale login: admin! Password:! ! MaxScale> UID/PWD:  admin  /  skysql ! MaxScale> help! Available commands:! add user! clear server! remove user! restart monitor! restart service! set server! show dcbs! show dcb! show dbusers! show epoll! show modules! show monitors! show server! show servers! show services! show session! show sessions! show users! shutdown maxscale! shutdown monitor! shutdown service! reload config! reload dbusers! enable log! disable log 26
  • 28. Configuration  Template ! [root@Sky6 etc]# cat MaxScale_template.cnf! #! # Example MaxScale.cnf configuration file! #! # Number of server threads! # Valid options are:! # ! hreads=<number of threads>! t ! [maxscale]! threads=1! …! ! [Monitor Module]! …! ! [R/W Split Module]! …! ! [Read Connection Router]! …! ! [HTTPD Router]! …! ! [Debug Interface]! … ! # Listener definitions for the services! #! # Valid options are:! #! # ! ervice=<name of service defined elsewhere>! s # ! rotocol=<name of protocol module with which to listen>! p # ! ort=<Listening port>! p ! [RW Split Listener]! …! ! [Read Connection Listener]! …! ! [Debug Listener]! …! ! [HTTPD Listener]! …! ! # Definition of the servers! ! [server1]! …! ! [serverN]! … 28
  • 29. Database  Settings •Create  a  valid  MaxScale  user   •Allow  access  from  the  MaxScale  node ! MariaDB [test]> create user maxuser identified by 'maxpwd';! Query OK, 0 rows affected (0.01 sec)! ! MariaDB [test]> grant all on *.* to maxuser@‘192.168.0.26’;! Query OK, 0 rows affected (0.00 sec) 29
  • 30. Global  Settings ! •Settings  used  to  configure  the  core  of  MaxScale   [maxscale]! threads=1! •Options:   •threads  -­‐  number  of  user  threads  that  poll  for  network   traffic   • Start  with  the  smallest  number  and  try  to  increase  to   check  the  impact  on  high  workload   • This  parameter  does  not  include  the  number  of   “internal  threads”   30
  • 31. Server  Settings •Settings  used  to  configure  the  backend   •type  -­‐  the  server  type   •Options:   •address  -­‐  The  IP  address  used  by  MaxScale  to  connect  to  the  server   •port  -­‐  The  TCP  port  used  by  MaxScale  to  connect  to  the  server   •Protocol  -­‐  The  DB  protocol.   • MySQLBackend  is  the  native  MySQL  protocol   •MonitorUser  -­‐  The  DB  user  used  by  MaxScale  to  connect  with  the   Monitoring  module   • When  MonitorUser  is  not  present,  MaxScale  uses  the  credentials  set  in  the   Monitor  section   •MonitorPW  -­‐  The  DB  user  password ! [max1]! type=server! address=192.168.0.21! port=3006! protocol=MySQLBackend! ! [max2]! type=server! address=192.168.0.22! port=3006! protocol=MySQLBackend! ! …! ! [max5]! type=server! address=192.168.0.25! port=3006! protocol=MySQLBackend 31
  • 32. Monitor  Settings •Settings  used  to  configure  the  monitor  module  for   MySQL/MariaDB   •type  -­‐  the  monitor  type   •Options:   •module  -­‐  The  loadable  module,  mysqlmon  for  MySQL/ MariaDB   •servers  -­‐  Comma  separated  list  of  the  servers  to  monitor   • Servers  must  be  of  the  same  type  (e.g.  MySQL/MariaDB  servers)   •user  -­‐  DB  user  used  to  connect  to  the  server   • Used  when  the  credentials  are  not  available  in  the  server  section   •passwd  -­‐  DB  user  password ! [MariaDB10 Monitor]! type=monitor! module=mysqlmon! servers=max1,! max2,! max3,! max4,! max5! user=maxuser! passwd=maxpwd 32
  • 33. SLB  with  Read/Write  Split  Service  Settings •Settings  used  to  configure  the  service  module  for   statement-­‐based  load  balancing  (with  read/write   splitting)   •type  -­‐  the  service  type   •Options:   •router  -­‐  The  loadable  module,  readwritesplit  for  MySQL/ MariaDB  R/W  splitting  with  MySQL  Replication   •servers  -­‐  Comma  separated  list  of  the  servers  to  monitor   •user  -­‐  DB  user  used  to  connect  to  the  server  to  extract  the   list  of  the  database  users  to  allow  local  authentication   •passwd  -­‐  DB  user  password ! [RW Split Router]! type=service! router=readwritesplit! servers=max1,! max2,! max3,! max4,! max5 ! user=maxuser! passwd=maxpwd 33
  • 34. CLB  Service  Settings •Settings  used  to  configure  the  service  module  for  statement-­‐ based  load  balancing  (with  read/write  splitting)   •type  -­‐  the  service  type   •Options:   •router  -­‐  The  loadable  module,  readconnroute  for  connection  load   balancing  with  MySQL  Replication   •router_options  -­‐  options  passed  to  the  module.   • slave  means  that  the  load  balancing  is  applied  only  to  the  slave  servers   • master,slave  means  that  the  load  balancing  is  applied  master  and  slave  servers   •servers  -­‐  Comma  separated  list  of  the  servers  to  monitor   •user  -­‐  DB  user  used  to  connect  to  the  server  to  extract  the  list  of  the   database  users  to  allow  local  authentication   •passwd  -­‐  DB  user  password ! [Read Connection Router]! type=service! router=readconnroute! router_options=slave! servers=max1,! max2,! max3,! max4,! max5! user=maxuser! passwd=maxpwd 34
  • 35. Listener  Settings  -­‐  SLB ! •Set  the  Protocol  and  Service  pair.  This  is  used  to  offer  the  SLB   with  Read/Write  Splitting   •type  -­‐  the  listener  type   [RW Split Listener]! type=listener! service=RW Split Router! protocol=MySQLClient! port=4006! •Options:   •service  -­‐  The  service  associated  to  the  listener  (e.g.  RW  Split  Router)   •protocol  -­‐  The  protocol  paired  to  the  service  (e.g.  MySQLClient)   •port  -­‐  The  TCP  port  used  to  listen  to  the  client  requests 35
  • 36. Listener  Settings  -­‐  Debug  &  HTTP ! •These  listeners  are  used  to  offer  a  debug  and  a  HTTP  interface   to  MaxScale   •type  -­‐  the  listener  type   •Options:   •service  -­‐  DBAs  can  connect  to  MaxScale  using  telnet  or  via  a  restful  API   •protocol  -­‐  The  protocol  paired  to  the  service  (e.g.  telnetd  and  httpd  )   •port  -­‐  The  TCP  port  used  to  listen  to  the  client  requests [Debug Listener]! type=listener! service=Debug Interface! protocol=telnetd! port=4444! ! [HTTPD Listener]! type=listener! service=HTTPD Router! protocol=HTTPD! port=6444 36
  • 37. Final  Configuration ! [root@Sky6 etc]# cat MaxScale.cnf! #! # Number of server threads! # Valid options are:! # ! threads=<number of threads>! [maxscale]! threads=1! ! #! # Define a monitor that can be used to determine the state! # and role of the servers.! #! # Valid options are:! #! # ! module=<name of module to load>! # ! servers=<server name>,<server name>,...! # ! user =<user name - must have slave replication and! # slave client privileges>! # ! passwd=<password of the above user,
 # plain text currently>! [MariaDB10 Monitor]! type=monitor! module=mysqlmon! servers=max1,max2,max3,max4,max5! user=maxuser! passwd=maxpwd ! #! # A series of service definition! #! # Valid options are:! #! # ! router=<name of router module>! # ! servers=<server name>,<server name>,...! # ! user=<User to fetch password inforamtion with>! # ! passwd=<Password of the user, plain text currently>! #! # Valid router modules currently are:! # ! readwritesplit, readconnroute and debugcli! [RW Split Router]! type=service! router=readwritesplit! servers=max1,max2,max3,max4,max5! user=maxuser! passwd=maxpwd! ! [HTTPD Router]! type=service! router=testroute! servers=max1,max2,max3,max4,max5! ! [Debug Interface]! type=service! router=debugcli 37
  • 38. Final  Configuration ! #! # Listener definitions for the services! #! # Valid options are:! #! # ! service=<name of service defined elsewhere>! # ! protocol=<name of protocol module with which to listen>! # ! port=<Listening port>! [RW Split Listener]! type=listener! service=RW Split Router! protocol=MySQLClient! port=4004! ! [Debug Listener]! type=listener! service=Debug Interface! protocol=telnetd! port=4444! ! [HTTPD Listener]! type=listener! service=HTTPD Router! protocol=HTTPD! port=6444! ! # Servers Definition! [max1]! type=server! address=192.168.0.21! port=3306! protocol=MySQLBackend! ! [max2]! type=server! address=192.168.0.22! port=3306! protocol=MySQLBackend! ! [max3]! type=server! address=192.168.0.23! port=3306! protocol=MySQLBackend! ! [max4]! type=server! address=192.168.0.24! port=3306! protocol=MySQLBackend! ! [max5]! type=server! address=192.168.0.25! port=3306! protocol=MySQLBackend 38
  • 39. Password  Encryption •Used  to  remove  plain  password  from  the  config   file   •Passwords  are  stored  in  a  readonly  file  (default   $MAXSCALE_HOME/etc/.secrets)   •Plain  passwords  in  the  config  file  can  be  replaced   with  the  encrypted  password ! [root@Sky6 ~]# /usr/local/skysql/maxscale/bin/ maxkeys /usr/local/skysql/maxscale/MaxScale/ etc/.secrets! ! [root@Sky6 ~]# MAXSCALE_HOME=/usr/local/skysql/ maxscale/MaxScale! [root@Sky6 ~]# /usr/local/skysql/maxscale/bin/ maxpasswd maxpwd! 14AE17C29AE7E6DB94EA5E6068D9833D! ! [root@Sky6 ~]# vi /usr/local/skysql/maxscale/ MaxScale/etc/MaxScale.cnf! ! …! [MariaDB10 Monitor]! type=monitor! module=mysqlmon! servers=max1,max2,max3,max4,max5! user=maxuser! passwd=14AE17C29AE7E6DB94EA5E6068D9833D! … 39
  • 40. Checking  MaxScale SLB  R/W  Splimer  (for  the  users) RESTful  API  (under  development) Telnet  Interface  (for  debugging  and  DBAs) ! MaxScale> show services! Service 0x8e1d40! ! Service:! ! RW Split Router! ! Router:! ! ! readwritesplit (0x7ff7dd4d0d40)! ! Number of router sessions: ! 0! ! Current no. of router sessions: ! 0! ! Number of queries forwarded: ! 0! ! Number of queries forwarded to master:! 0! ! Number of queries forwarded to slave: ! 0! ! Number of queries forwarded to all: ! 0! ! Started:! ! Tue Dec 31 17:36:13 2013! ! Backend databases! ! ! 192.168.0.25:3006 Protocol: MySQLBackend! ! ! 192.168.0.24:3006 Protocol: MySQLBackend! ! ! 192.168.0.23:3006 Protocol: MySQLBackend! ! ! 192.168.0.22:3006 Protocol: MySQLBackend! ! ! 192.168.0.21:3006 Protocol: MySQLBackend! ! Users data: !0x8e2d00! ! Total connections:! 1! ! Currently connected:! 1! Service 0x844380! ! Service:! ! HTTPD Router! ! Router:! ! ! testroute (0x7ff7dd6d67c0)! ! Started:! ! Tue Dec 31 17:36:13 2013! ! Backend databases! ! ! 192.168.0.25:3006 Protocol: MySQLBackend! ! ! 192.168.0.24:3006 Protocol: MySQLBackend! ! ! 192.168.0.23:3006 Protocol: MySQLBackend! ! ! 192.168.0.22:3006 Protocol: MySQLBackend! ! ! 192.168.0.21:3006 Protocol: MySQLBackend! ! Users data: !0x844740! ! Total connections:! 1! ! Currently connected:! 1! Service 0x8438f0! ! Service:! ! Debug Interface! ! Router:! ! ! debugcli (0x7ff7dd8e0500)! ! Started:! ! Tue Dec 31 17:36:13 2013! ! Backend databases! ! Users data: !0x8441b0! ! Total connections:! 2! ! Currently connected:! 2 40
  • 41. Troubleshooting ! 2013 12/31 17:47:24 Error : access for secrets file [/usr/local/skysql/maxscale/MaxScale/etc/.secrets] failed. Error 2, No such file or directory. MaxScale  cannot  fine  the  encrypted  password  file ! [root@Sky6 bin]# /usr/local/skysql/maxscale/MaxScale/bin/maxkeys /usr/local/skysql/maxscale/MaxScale/ etc/.secrets! 41
  • 42. Troubleshooting ! [root@Sky0 ~]# mysql -uroot -h 192.168.0.26 -P4004 -p! Enter password:! ERROR 1045 (2800): Authorization failed! [root@Sky0 ~]# root  is  not  loaded  to  the  available  users  to   connect  via  MaxScale ! <<<< User [root] was not found! <<< CLIENT AUTH FAILED for user [root]! ! [root@Sky0 ~]# mysql -umaxuser -h 192.168.0.26 -P4004 -pmaxpwd! Welcome to the MariaDB monitor. Commands end with ; or g.! Your MySQL connection id is 1535! Server version: 5.5.22-SKYSQL-0.1.0 MariaDB Server! ! Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.! ! Careful  with  this! Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.! ! MySQL [(none)]> 42
  • 43. Troubleshooting From  MaxScale
 You  see  the  Max1  process  list ! MySQL [(none)]> show processlist;! +-----+---------+-------------------+------+-------------+-------+----------------------------------------+------------------+----------+! | Id | User | Host | db | Command | Time | State | Info | Progress |! +-----+---------+-------------------+------+-------------+-------+----------------------------------------+------------------+----------+! | 5 | root | skycluster3:33830 | NULL | Binlog Dump | 82453 | Master has sent all binlog to slave; … | NULL | 0.000 |! | 6 | root | skycluster4:43403 | NULL | Binlog Dump | 82389 | Master has sent all binlog to slave; … | NULL | 0.000 |! | 7 | root | skycluster5:46878 | NULL | Binlog Dump | 82382 | Master has sent all binlog to slave; … | NULL | 0.000 |! | 8 | root | skycluster2:54912 | NULL | Binlog Dump | 82376 | Master has sent all binlog to slave; … | NULL | 0.000 |! | 100 | root | skycluster0:41977 | NULL | Sleep | 0 | | NULL | 0.000 |! | 101 | root | skycluster0:41997 | NULL | Sleep | 60 | | NULL | 0.000 |! | 129 | maxuser | skycluster6:55557 | NULL | Sleep | 5 | | NULL | 0.000 |! | 132 | maxuser | skycluster6:55565 | NULL | Query | 0 | init | show processlist | 0.000 |! | 135 | maxuser | skycluster6:55571 | NULL | Sleep | 41 | | NULL | 0.000 |! +-----+---------+-------------------+------+-------------+-------+----------------------------------------+------------------+----------+! 9 rows in set (0.00 sec) This  is  directly  from  Max2 ! MariaDB [(none)]> show processlist;! +----+-------------+-------------------+------+---------+-------+----------------------------------+------------------+----------+! | Id | User | Host | db | Command | Time | State | Info | Progress |! +----+-------------+-------------------+------+---------+-------+----------------------------------+------------------+----------+! | 4 | system user | | NULL | Connect | 82804 | Waiting for master to send event | NULL | 0.000 |! | 5 | system user | | NULL | Connect | 73387 | Slave has read all relay log; wa…| NULL | 0.000 |! | 14 | root | skycluster0:35933 | NULL | Sleep | 0 | | NULL | 0.000 |! | 15 | root | skycluster0:35936 | NULL | Sleep | 216 | | NULL | 0.000 |! | 44 | maxuser | skycluster6:46518 | NULL | Sleep | 3 | | NULL | 0.000 |! | 46 | root | localhost | NULL | Query | 0 | init | show processlist | 0.000 |! +----+-------------+-------------------+------+---------+-------+----------------------------------+------------------+----------+! 6 rows in set (0.00 sec) 43
  • 44. MaxScale  Use  Cases
 with  the  current  version
  • 45. MaxScale  with  MySQL  Replication
 using  Connection  Load  Balancing For  applicaLons  that  are  “ReplicaLon  aware”,  i.e.  they  can  use   2  connecLons,  one  for  the  master  and  one  for  the  slave  servers MaxScale Each  applicaeon  server  uses  2  conneceon:
 1  Read/Write,  1  Read/Only Conneceon  load  balancing  is  fast,  lightweight   and  it  provides  high  availability Database Database Database Database Database MaxScale  connects  the  R/W  client   conneceon  to  the  master  and  it  load   balances  the  R/O  client  conneceon  to   one  of  the  slaves MHA  provides  the  automaec  failover   in  case  of  fault  of  the  master 45
  • 46. MaxScale  with  MySQL  Replication
 using  Connection  Load  Balancing [Write Listener] type=listener service=Write Service protocol=MySQLClient port=4007 [Read Listener] type=listener service=Read Service protocol=MySQLClient port=4006 MaxScale [Write Service] type=service router=readconnroute router_options=master servers=s1,s2,s3,s4,s5 user=maxuser auth=maxpwd [Read Service] type=service router=readconnroute router_options=slave servers=s1,s2,s3,s4,s5 user=maxuser auth=maxpwd Database Database Database Database Database 46
  • 47. MaxScale  with  Galera
 using  Connection  Load  Balancing Each  applicaeon  server   uses  only  1  conneceon For  applicaLons  that  can  use  the“all-­‐ master”  capabiliLes  of  Galera MaxScale MaxScale  monitors  the  state  of  each   Galera  Cluster  and  it  applies  load   balancing  only  on  synced    nodes MaxScale  load  balances  the  client   conneceons  to  the  Galera  nodes Database Database Database 47
  • 48. MaxScale  with  Galera
 using  Connection  Load  Balancing [Read Listener] type=listener service=Read Service protocol=MySQLClient port=4006 MaxScale [Galera Service] type=service router=readconnroute router_options=synced servers=s1,s2,s3,s4,s5 user=maxuser auth=maxpwd Database Database Database 48
  • 49. MaxScale  with  MySQL  Replication
 using  Read/Write  Splitting Each  applicaeon  server   uses  only  1  conneceon For  applicaLons  that  have  been   designed  to  work  with  a  single  server   and  require  read  scalability MaxScale MaxScale  monitors  the  state  of  each   node  and  it  applies  load  balancing   only  on  the  available  slaves Database Database Database Database Database MaxScale  creates  2  conneceons,  one   for  R/W  on  the  master  node  and  one   R/O  load  balanced  on  the  slave    nodes 49
  • 50. How  does  MaxScale  compare  to… •HA  Proxy   •MySQL  Proxy   •Sharding  solutions  -­‐  ScaleBase,  DBShards,  Parelastic,  etc. 50
  • 51. JSON  over  http  and  BSON Strictly  Confidential    -­‐  SkySQL  Internal  Use  Only 51
  • 52. NDB  API Strictly  Confidential    -­‐  SkySQL  Internal  Use  Only 52
  • 53. Where  To  Find  More  Material GitHub  Project hUps://github.com/skysql/MaxScale Tarball hUps://downloads.skysql.com/files/SkySQL/MaxScale Documentaeon hUps://github.com/skysql/MaxScale/tree/master/DocumentaLon 53