-
Notifications
You must be signed in to change notification settings - Fork 0
/
mike-install.txt
335 lines (261 loc) · 9.63 KB
/
mike-install.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
mike-install(1)
===============
NAME
----
mike-install - mike's install procedure
SYNOPSIS
--------
[verse]
'autoconf'
'./configure' [--help[=short]]
[--enable-create-database] [--disable-create-database]
[--enable-create-schema] [--disable-create-schema]
[--enable-no-atime] [--disable-no-atime]
[--enable-no-volume-lock] [--disable-no-volume-lock]
[--enable-tree-max-depth[=<depth>]] [--disable-tree-max-depth]
[--enable-default-users] [--disable-default-users]
[--enable-lvm-support]
[DATABASE_USER=<database_user>]
[DATABASE_NAME=<database_name>]
[DATABASE_HOST=<database_host>]
[DATABASE_PORT=<database_port>]
[LVM_DEFAULT_LV_NUMBER=<default_lv_number>]
'make'
'make' [install|test|clean]
'make' [def-functions|dev-volumes]
'make' [drop-database|drop-schema]
'make' [graph|gource|stats]
'make' [doc|html|man|install-doc|install-html|install-man]
DESCRIPTION
-----------
Mike's install guide.
Getting the source
------------------
Mike uses 'Git' as Source Code Management. You must have it to get the source.
Once installed proceed that way :
[source,shell]
--------------------------
sylvain@kheops:~/$ git clone {mike_git_url} mike.git
sylvain@kheops:~/$ cd mike.git
--------------------------
Debian requirements
-------------------
- build-essential
- autoconf
- postgresql-<version>
- postgresql-server-dev-<version>
- postgresql-client-<version>
- postgresql-contrib-<version>
- postgresql-plperl-<version>
- libpq-dev
- asciidoc
- source-highlight (recommended, for documentation)
- apgdiff (optional)
- git-core (optional, for development)
- gource (optional, for development)
- gitstats (optional, for development)
Discard 'postgresl-*' and 'libpq-dev' if you want to build PostgreSQL from sources.
Building PostgreSQL from sources
--------------------------------
If you build PostgreSQL from sources you might need to install 'additional libraries'
needed for its compilation. You will find what you need when you launch the 'configure' script.
[source,shell]
--------------------------
sylvain@kheops:~/$ git clone git://git.postgresql.org/postgresql.git
sylvain@kheops:~/$ cd postgresql
sylvain@kheops:~/postgresql[master]$ git checkout REL9_0_3
sylvain@kheops:~/postgresql[(REL9_0_3)]$ autoconf
sylvain@kheops:~/postgresql[(REL9_0_3)]$ ./configure [--prefix=<prefix>] --with-perl
sylvain@kheops:~/postgresql[(REL9_0_3)]$ make -j3 world
sylvain@kheops:~/postgresql[(REL9_0_3)]$ make install-world
sylvain@kheops:~/postgresql[(REL9_0_3)]$ mkdir /var/pg_data
sylvain@kheops:~/postgresql[(REL9_0_3)]$ chmod 0700 /var/pg_data
sylvain@kheops:~/postgresql[(REL9_0_3)]$ sudo chown postgres:postgres /var/pg_data
sylvain@kheops:~/postgresql[(REL9_0_3)]$ sudo su postgres -c "<prefix>/bin/initdb -D /var/pg_data"
sylvain@kheops:~/postgresql[(REL9_0_3)]$ sudo su postgres -c "<prefix>/bin/pg_ctl start -D /var/pg_data"
--------------------------
WARNING: If you compile PostgreSQL from a git repository you might want to execute
'git clean -fdx' and 'git reset --hard <tag>' et ensure that everything is cleaned
otherwise you could run into some troubles.
You can also launch postgres using the debian init script located in 'contrib'.
Just move it to '/etc/init.d/postgres-from-source' and edit it with the values
you used to install PostgreSQL. Then do :
[source,shell]
--------------------------
sylvain@kheops:~/$ sudo /etc/init.d/postgres-from-source start
--------------------------
Install
-------
Mike relies on 'autotools' and 'make' for easy install.
First, you have to generate the 'configure' script by running the 'autoconf' tool
at the 'root' of Mike. Then, launch the './configure' script with the desired options,
it will check for external programs needed for Mike's install and prepare the 'Makefile'
with 'configuration' values passed as arguments. Proceed by launching 'make' with
the desired target, the default one being 'install'.
WARNING: The 'PostgreSQL user' used to install Mike must be 'superuser' because mike
comes with C functions which can not be installed with a basic user.
[source,shell]
-------------------------
sylvain@kheops:~/mike.git/$ autoconf
sylvain@kheops:~/mike.git/$ ./configure DATABASE_USER=sylvain
sylvain@kheops:~/mike.git/$ make
-------------------------
Note that you can 'override' configuration values given to 'configure' without having
to regenerate the Makefile each time. +
To do so proceed like in the following example:
[source,shell]
-------------------------
sylvain@kheops:~/mike.git/$ ./configure DATABASE_USER=sylvain
sylvain@kheops:~/mike.git/$ make install DATABASE_USER=mike DATABASE_NAME=my_vfs
-------------------------
Example of production install
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[source,shell]
-------------------------
sylvain@kheops:~/mike.git/$ autoconf
sylvain@kheops:~/mike.git/$ ./configure \
--enable-create-database \
DATABASE_USER=mike \
SLEEP_TIME=0
sylvain@kheops:~/mike.git/$ make drop-database install
-------------------------
Example of development install
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[source,shell]
-------------------------
sylvain@kheops:~/mike.git/$ autoconf
sylvain@kheops:~/mike.git/$ ./configure \
--enable-create-database \
--enable-no-volume-lock \
--enable-dev-mode \
DATABASE_USER=mike \
SLEEP_TIME=0
sylvain@kheops:~/mike.git/$ make drop-database install dev-volumes
-------------------------
configure options
-----------------
--enable-create-database::
enable database creation with DATABASE_NAME. imply --enable-create-schema. If
the database already exists it will be dropped and re-created.
--enable-create-schema::
enable mike schema creation into DATABASE_NAME. If the schema already exists
it will be dropped and re-created.
--enable-default-users::
create default users when building database.
--enable-dev-mode::
do not install mike.so in postgresql's package lib directory but let it where
it is built. Useful when developing.
--enable-lvm-support::
enable lvm support. See linkmike:mike-lvm-support[7].
--enable-no-volume-lock::
creating a xfile using xtouch() update the virtual size of the volume chosen.
Using this option will prevent virtual size update which will enable 'long
transactions' creating xfiles to run simultaneously because 'no lock' on the
volume table records are used. This option is for 'development use only'.
--enable-tree-max-depth::
enable tree maximum depth support in mike. This feature is 'enabled by default' and
its value is '24' which means a directory can only have '22 ancestors', it being
the at the 1st level and the last level beign reserved for files. Disabling
this feature can 'speed up some operations' at a 'low depth' but allows big 'deep
trees' which could lead to 'performance issues' because a modification on a directory
will update all its ancestors as well.
--enable-no-atime::
disable atime support in order to improve performances.
--with-a2x=<path>::
specify a2x path.
--with-apgdiff=<path>::
specify apgdiff path.
--with-asciidoc=<path>::
specify asciidoc path.
--with-awk=<path>::
specify awk path.
--with-bash=<path>::
specify bash path.
--with-createdb=<path>::
specify createdb path.
--with-docbook2odf=<path>::
specify docbook2odf path.
--with-docbook2odf=<path>::
specify docbook2odf path.
--with-docbook2pdf=<path>::
specify docbook2pdf path.
--with-dropdb=<path>::
specify dropdb path.
--with-gcc=<path>::
specify gcc path.
--with-make=<path>::
specify make path.
--with-nasm=<path>::
specify nasm path.
--with-git=<path>::
specify git path.
--with-pg_config=<path>::
specify pg_config path.
--with-pg_dump=<path>::
specify pg_dump path.
--with-psql=<path>::
specify psql path.
--with-sed=<path>::
specify sed path.
--with-xmlto=<path>::
specify xmlto path.
DATABASE_NAME=<database>::
database name used to install mike (default: mike).
DATABASE_USER=<user>::
database user name used to access DATABASE_NAME (default: mike).
DATABASE_HOST=<host>::
database host, if not specified, psql will search for local PotsgreSQL server
listening on a unix socket.
DATABASE_PORT=<port>::
database port, empty is not specified.
make targets
------------
'clean'::
Remove all file not tracked in the repository.
'dev-functions'::
Rebuild and install functions.
'dev-volumes'::
Insert dumb volumes for tests purpose.
'doc'::
Generate both html and man documentation.
'drop-database'::
Drop DATABASE_NAME database.
'drop-schema'::
Drop mike schema.
'gource'::
Launch gource if installed (development environment required).
'graph'::
Display mike's development graph (development environment required).
'html'::
Generate the html documentation.
'install'::
Perform mike install on the database specified to the configure script or on
DATABASE_NAME if specified.
'install-doc'::
install both html and man documentation.
'install-html'::
install the html documentation.
'install-man'::
install the man pages.
'man'::
Generate man pages.
'stats'::
Display mike's developers commit statistics (development environment required).
'test'::
Run mike's unit test battery.
ENABLE_CREATE_DATABASE=[yes|no]::
If set to 'yes', will behave like if '--enable-create-database' had been specified
to 'configure'.
ENABLE_CREATE_SCHEMA=[yes|no]::
If set to 'yes', will behave like if '--enable-create-schema' had been specified
to 'configure'.
CFLAGS::
Overwrite default flags used for gcc.
NASMFLAGS::
Overwrite default flags used for nasm.
Authors
-------
Written by Sylvain Rabot <[email protected]>
MIKE
----
Part of the linkmike:mike[3] suite.