Welcome to mirror list, hosted at ThFree Co, Russian Federation.

install.tex « main « en « manuals - github.com/bareos/bareos-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 591fc880cec2fc98fc0985ca864658da93f232df (plain)
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
336
337
338
339
340
341
342
343
344
345
346
If you are like me, you want to get Bareos running immediately to get a feel
for it, then later you want to go back and read about all the details. This
chapter attempts to accomplish just that: get you going quickly without all
the details.

Bareos comes prepackaged for a number of Linux distributions.
So the easiest way to get to a running Bareos installation, 
is to use a platform where prepacked Bareos packages are available.
Additional information can be found in the chapter \ilink{Operating Systems}{SupportedOSes}.

%\TODO{If you are using a platform, for which Bareos is not available in a prepackaged format,
%please refer to the \ilink{Building chapter}{compile}.}

If Bareos is available as a package, 
only 5 steps are required to get to a running Bareos System:
\begin{enumerate}
    \item \nameref{sec:AddSoftwareRepository}
    \item \nameref{sec:ChooseDatabaseBackend}
    \item \nameref{sec:InstallBareosPackages}
    \item \nameref{sec:CreateDatabase}
    \item \nameref{sec:StartDaemons}
\end{enumerate}

This will start a very basic Bareos installation which will regularly backup a directory to disk.
In order to fit it to your needs, you'll have to adapt the configuration and might want to backup other clients.

\section{Decide about the Bareos release to use}
    \label{sec:AddSoftwareRepository}

\begin{itemize}
   \item \url{http://download.bareos.org/bareos/release/latest/}
\end{itemize}

You'll find Bareos binary package repositories at \url{http://download.bareos.org/}.
The latest stable released version is available at \url{http://download.bareos.org/bareos/release/latest/}.

The public key to verify the repository is also in repository directory
(\file{Release.key} for Debian based distributions, \file{repodata/repomd.xml.key} for RPM based distributions).

Section \nameref{sec:InstallBareosPackages} describes how to add the software repository to your system.


\section{Decide about the Database Backend}
    \label{sec:ChooseDatabaseBackend}

Next you have to decide, what database backend you want to use.
Bareos supports following database backends:
\begin{itemize}
    \item PostgreSQL by package \package{bareos-database-postgresql}
    \item MariaDB/MySQL by package \package{bareos-database-mysql}
    \item Sqlite by package \package{bareos-database-sqlite3} \\
        \warning{The Sqlite backend is only intended for testing, not for productive use.}
\end{itemize}

\paragraph{PostgreSQL} is the default backend. If you have no other preferences, you should use this one.

\paragraph{MariaDB/MySQL} backend is also supported. If your system offers both, you should use MariaDB, see \nameref{sec:MysqlSupport}.

\paragraph{Sqlite} backend is intended for testing purposes only.

The Bareos database packages have there dependencies only to the database client packages,
therefore the database itself must be installed manually.


\section{Install the Bareos Software Packages}
    \label{sec:InstallBareosPackages}

You will have to install the package \package{bareos} 
and the database backend package (\package{bareos-database-*}) you want to use.
The corresponding database should already be installed and running, see \nameref{sec:ChooseDatabaseBackend}.

If you do not explicitly choose a database backend, your operating system installer will choose one for you.
The default should be PostgreSQL, but depending on your operating system and the already installed packages, 
this may differ.

The package \package{bareos} is only a meta package, that contains dependencies to the main components of Bareos, see \nameref{sec:BareosPackages}. 
If you want to setup a distributed environment (like one Director, separate database server, multiple Storage daemons)
you have to choose the corresponding Bareos packages to install on each hosts instead of just installing the \package{bareos} package.


\subsection{Install on RedHat based Linux Distributions}

\subsubsection{RHEL$\ge$7, CentOS$\ge$7, Fedora}
\index[general]{Platform!RHEL}
\index[general]{Platform!CentOS}
\index[general]{Platform!Fedora}

Bareos \sinceVersion{dir}{requires!jansson}{15.2.0} requires the \ilink{Jansson library}{jansson} package.
On RHEL 7 it is available through the RHEL Server Optional channel. On CentOS 7 and Fedora is it included on the main repository.

\begin{commands}{Bareos installation on RHEL $\ge$ 7 / CentOS $\ge$ 7 / Fedora}
#
# define parameter
#

DIST=RHEL_7
# or
# DIST=Fedora_24
# DIST=CentOS_7

DATABASE=postgresql
# or
# DATABASE=mysql

# add the Bareos repository
URL=http://download.bareos.org/bareos/release/latest/$DIST
wget -O /etc/yum.repos.d/bareos.repo $URL/bareos.repo

# install Bareos packages
yum install bareos bareos-database-$DATABASE
\end{commands}
\hide{$}

\subsubsection{RHEL 6, CentOS 6}
\index[general]{Platform!RHEL!6}
\index[general]{Platform!CentOS!6}

Bareos \sinceVersion{dir}{requires!jansson}{15.2.0} requires the \ilink{Jansson library}{jansson} package.
This package is available on \elink{EPEL}{https://fedoraproject.org/wiki/EPEL} 6. Make sure, it is available on your system.

\begin{commands}{Bareos installation on RHEL $\ge$ 6 / CentOS $\ge$ 6}
#
# add EPEL repository, if not already present.
# Required for the jansson package.
#
rpm -Uhv https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

#
# define parameter
#

DIST=RHEL_6
# DIST=CentOS_6

DATABASE=postgresql
# or
# DATABASE=mysql

# add the Bareos repository
URL=http://download.bareos.org/bareos/release/latest/$DIST
wget -O /etc/yum.repos.d/bareos.repo $URL/bareos.repo

# install Bareos packages
yum install bareos bareos-database-$DATABASE
\end{commands}
\hide{$}


\subsubsection{RHEL 5, CentOS 5}
\index[general]{Platform!RHEL!5}
\index[general]{Platform!CentOS!5}

yum in RHEL 5/CentOS 5 has slightly different behaviour as far as dependency resolving is concerned: it sometimes install a dependent package after the one that has the dependency defined. To make sure that it works, install the desired Bareos database backend package first in a separate step:

\begin{commands}{Bareos installation on RHEL 5 / CentOS 5}
#
# define parameter
#

DIST=RHEL_5
# or
# DIST=CentOS_5

DATABASE=postgresql
# or
# DATABASE=mysql

# add the Bareos repository
URL=http://download.bareos.org/bareos/release/latest/$DIST
wget -O /etc/yum.repos.d/bareos.repo $URL/bareos.repo

# install Bareos packages
yum install bareos-database-$DATABASE
yum install bareos
\end{commands}
\hide{$}

\subsection{Install on SUSE based Linux Distributions}

\subsubsection{SUSE Linux Enterprise Server (SLES), openSUSE}
\index[general]{Platform!SLES}
\index[general]{Platform!openSUSE}

\begin{commands}{Bareos installation on SLES / openSUSE}
#
# define parameter
#

DIST=SLE_12_SP1
# or
# DIST=SLE_11_SP4
# DIST=openSUSE_Leap_42.1
# DIST=openSUSE_13.2

DATABASE=postgresql
# or
# DATABASE=mysql

# add the Bareos repository
URL=http://download.bareos.org/bareos/release/latest/$DIST
zypper addrepo --refresh $URL/bareos.repo

# install Bareos packages
zypper install bareos bareos-database-$DATABASE
\end{commands}
\hide{$}



\subsection{Install on Debian based Linux Distributions}
    \label{sec:InstallBareosPackagesDebian}


\subsubsection{Debian / Ubuntu}
\index[general]{Platform!Debian}
\index[general]{Platform!Ubuntu}

Bareos \sinceVersion{dir}{requires!jansson}{15.2.0} requires the \ilink{Jansson library}{jansson} package.
On Ubuntu is it available in Ubuntu Universe. In Debian, is it included in the main repository.

\begin{commands}{Bareos installation on Debian / Ubuntu}
#
# define parameter
#

DIST=Debian_8.0
# or
# DIST=Debian_7.0
# DIST=xUbuntu_16.04
# DIST=xUbuntu_14.04
# DIST=xUbuntu_12.04

DATABASE=postgresql
# or
# DATABASE=mysql

URL=http://download.bareos.org/bareos/release/latest/$DIST/

# add the Bareos repository
printf "deb $URL /\n" > /etc/apt/sources.list.d/bareos.list

# add package key
wget -q $URL/Release.key -O- | apt-key add -

# install Bareos packages
apt-get update
apt-get install bareos bareos-database-$DATABASE
\end{commands}

If you prefer using the versions of Bareos directly integrated into the distributions, 
please note that there are some differences, see \nameref{sec:DebianOrgLimitations}.

\subsection{Install on Univention Corporate Server}
\index[general]{Platform!Univention Corporate Server}

Bareos offers additional functionality and integration into an Univention Corporate Server environment. 
Please follow the intructions in \nameref{sec:UniventionCorporateServer}.

If you are not interested in this additional functionality,
the commands described in \nameref{sec:InstallBareosPackagesDebian} will also work for Univention Corporate Servers.


\section{Prepare Bareos database}
    \label{sec:CreateDatabase}

We assume that you have already your database installed and basically running.
Currently the database backends PostgreSQL and MySQL are recommended. The Sqlite database backend is only intended for testing purposes.

The easiest way to set up a database is using an system account that have passwordless local access to the database. 
Often this is the user \user{root} for MySQL and the user \user{postgres} for PostgreSQL.

For details, see chapter \nameref{CatMaintenanceChapter}.

\subsection{Debian based Linux Distributions}

Since Bareos \sinceVersion{dir}{dbconfig-common (Debian)}{14.2.0} the Debian (and Ubuntu) based packages support the \package{dbconfig-common} mechanism to create and update the Bareos database.

Follow the instructions during install to configure it according to your needs.

\begin{center}
\includegraphics[width=0.45\textwidth]{\idir dbconfig-1-enable}
\includegraphics[width=0.45\textwidth]{\idir dbconfig-2-select-database-type}
\end{center}

If you decide not to use \package{dbconfig-common} (selecting \parameter{<No>} on the initial dialog), 
follow the instructions for \nameref{sec:CreateDatabaseOtherDistributions}.

The selectable database backends depend on the \package{bareos-database-*} packages installed.

For details see \nameref{sec:dbconfig}.

\subsection{Other Platforms}
    \label{sec:CreateDatabaseOtherDistributions}

\subsubsection{PostgreSQL}
If your are using PostgreSQL and your PostgreSQL administration user is \user{postgres} (default), use following commands:

\begin{commands}{Setup Bareos catalog with PostgreSQL}
su postgres -c /usr/lib/bareos/scripts/create_bareos_database
su postgres -c /usr/lib/bareos/scripts/make_bareos_tables
su postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges
\end{commands}


\subsubsection{MySQL/MariaDB}
Make sure, that \user{root} has direct access to the local MySQL server. 
Check if the command \command{mysql} connects to the database without defining the password.
This is the default on RedHat and SUSE distributions. 
On other systems (Debian, Ubuntu),
create the file \file{~/.my.cnf} with your authentication informations:

\begin{config}{MySQL credentials file .my.cnf}
[client]
host=localhost
user=root
password=<input>YourPasswordForAccessingMysqlAsRoot</input>
\end{config}

It is recommended, to secure the Bareos database connection with a password.
See \ilink{Catalog Maintenance -- MySQL}{catalog-maintenance-mysql} about how to archieve this.
For testing, using a password-less MySQL connection is probable okay.
Setup the Bareos database tables by following commands:
\begin{commands}{Setup Bareos catalog with MySQL}
/usr/lib/bareos/scripts/create_bareos_database
/usr/lib/bareos/scripts/make_bareos_tables
/usr/lib/bareos/scripts/grant_bareos_privileges
\end{commands}

As some Bareos updates require a database schema update,
therefore the file \file{/root/.my.cnf} might also be useful in the future.


\section{Start the daemons}
    \label{sec:StartDaemons}

\begin{commands}{Start the Bareos Daemons}
service bareos-dir start
service bareos-sd start
service bareos-fd start
\end{commands}

You will eventually have to allow access to the ports 9101-9103, used by Bareos.

Now you should be able to access the director using the bconsole.

When you want to use the bareos-webui, please refer to the chapter \nameref{sec:install-webui}.