~percona-dev/percona-server/release-5.5.11-20.2-fix-bug-764138

« back to all changes in this revision

Viewing changes to HandlerSocket-Plugin-for-MySQL/docs-en/installation.en.txt

  • Committer: Ignacio Nin
  • Date: 2011-03-13 17:18:23 UTC
  • mfrom: (33.3.17 release-5.5.8-20)
  • Revision ID: ignacio.nin@percona.com-20110313171823-m06xs104nekulywb
Merge changes from release-5.5.8-20 to 5.5.9

Merge changes from the release branch of 5.5.8 to 5.5.9. These include
the HandlerSocket and UDF directories and the building scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
1. Building Handlersocket
 
2
 
 
3
 Handlersocket mainly consists of libhsclient, handlersocket, and C++/Perl clients. libhsclient is a common library shared from both client and server(plugin). handlersocket is a MySQL daemon plugin.
 
4
 To build Handlersocket, you need both MySQL source code and MySQL binary. It is not required to pre-build MySQL source code, but source itself is needed because Handlersocket depends on MySQL header files that only MySQL source distribution contains. MySQL binary is just a normal MySQL binary distribution. You can use official MySQL binaries provided by Oracle.
 
5
 Since Handlersocket uses daemon plugin interface supported from MySQL 5.1,
 
6
MySQL 5.1 or higher version is required.
 
7
 Please make sure that you use identical MySQL version between MySQL source
 
8
and MySQL binary. Otherwise you might encounter serious problems (i.e. server
 
9
crash, etc). 
 
10
 Here are steps to build Handlersocket.
 
11
 
 
12
* Get MySQL source code
 
13
 
 
14
* Get MySQL binary
 
15
 
 
16
* Build Handlersocket
 
17
  $ ./autogen.sh
 
18
  $ ./configure --with-mysql-source=/work/mysql-5.1.50 --with-mysql-bindir=/work/mysql-5.1.50-linux-x86_64-glibc23/bin  --with-mysql-plugindir=/work/mysql-5.1.50-linux-x86_64-glibc23/lib/plugin
 
19
 
 
20
 --with-mysql-source refers to the top of MySQL source directory,
 
21
--with-mysql-bindir refers to where MySQL binary executables (i.e.
 
22
mysql_config) are located, and --with-mysql-plugindir refers to a plugin
 
23
directory where plugin libraries (*.so) are installed.  
 
24
 
 
25
  $ make
 
26
  $ sudo make install
 
27
 
 
28
 Both libhsclient and the handlersocket plugin will be installed.
 
29
 
 
30
 
 
31
2. Using Handlersocket
 
32
 
 
33
Append configuration options for handlersocket to my.cnf.
 
34
 
 
35
  [mysqld]
 
36
  loose_handlersocket_port = 9998
 
37
    # the port number to bind to (for read requests)
 
38
  loose_handlersocket_port_wr = 9999
 
39
    # the port number to bind to (for write requests)
 
40
  loose_handlersocket_threads = 16
 
41
    # the number of worker threads (for read requests)
 
42
  loose_handlersocket_threads_wr = 1
 
43
    # the number of worker threads (for write requests)
 
44
  open_files_limit = 65535
 
45
    # to allow handlersocket accept many concurrent
 
46
    # connections, make open_files_limit as large as
 
47
    # possible.
 
48
 
 
49
Log in to mysql as root, and execute the following query.
 
50
 
 
51
  mysql> install plugin handlersocket soname 'handlersocket.so';
 
52
 
 
53
If handlersocket.so is successfully installed, it starts
 
54
accepting connections on port 9998 and 9999. Running
 
55
'show processlist' should show handlersocket worker threads.
 
56
 
 
57
-----------------------------------------------------------------
 
58
On the client side, you need to install libhsclient for c++ apps
 
59
and perl-Net-HandlerSocket for perl apps. They do not require
 
60
MySQL to compile.
 
61
 
 
62
  $ ./autogen.sh
 
63
  $ ./configure --disable-handlersocket-server
 
64
  $ make
 
65
  $ sudo make install
 
66
  $ cd perl-Net-HandlerSocket
 
67
  $ perl Makefile.PL
 
68
  $ make
 
69
  $ sudo make install
 
70
 
 
71
-----------------------------------------------------------------
 
72
Alternatively, you can use the rpm installation. If your OS
 
73
supports rpms, you can use the following commands to build and
 
74
install handlersocket rpm packages.
 
75
 
 
76
(Server side, installs HandlerSocket plugin)
 
77
  $ ./autogen.sh
 
78
  $ ./configure --with-mysql-source=/work/mysql-5.1.50 --with-mysql-bindir=/work/mysql-5.1.50-linux-x86_64-glibc23/bin  --with-mysql-plugindir=/work/mysql-5.1.50-linux-x86_64-glibc23/lib/plugin
 
79
  $ make rpm_cli
 
80
  $ sudo rpm -U dist/RPMS/*/libhsclient*.rpm
 
81
  $ make rpm_c
 
82
  $ sudo rpm -U dist/RPMS/*/handlersocket*.rpm
 
83
 
 
84
(Client side, installs client libraries)
 
85
  $ ./autogen.sh
 
86
  $ ./configure --disable-handlersocket-server
 
87
  $ make rpm_cli
 
88
  $ sudo rpm -U dist/RPMS/*/libhsclient*.rpm
 
89
  $ make rpm_perl
 
90
  $ sudo rpm -U dist/RPMS/*/perl-Net-HandlerSocket*.rpm
 
91