ログイン
ユーザ名:

パスワード:


パスワード紛失

新規登録
メインメニュー
検索
オンライン状況
24 人のユーザが現在オンラインです。 (1 人のユーザが ニュース を参照しています。)

登録ユーザ: 0
ゲスト: 24

もっと...
Baclua(バックアップ)に挑戦 : 2:インストールとmysqlの設定
投稿者: f-otake 投稿日時: 2013-12-2 17:46:08 (1572 ヒット)


11:リストアの時間が劇的に早くなった を参照してください。このままでは遅いです。

まずはサーバー側、私はサーバー自身もバックアップするので
# yum install bacula-storage-mysql bacula-director-mysql bacula-console mysql-server bacula-client mysql
とbaclua関連とmysqlをインストールします。baculaは前項の参考URLで示したWEBにあるようにカタログ(内容は参考URLを見てね)と呼ばれるデータをmysqlに保存をしますので、まずはmysqlの設定から(/etc/my.cnf)

[mysqld]
datadir=/XXXX/mysql ← オリジナルの場所から変更しています
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server = utf8 ← 追記

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

そしてmysqlをスタート
# service mysqld start
最初のスタートでは色々と表示が出るが、ようはrootのパスワードを設定しろよと言う事など。忘れないように再起動後も起動するように
# chkconfig mysqld on
そして初期設定をする
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):  Enterのみを入力
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Enterのみを入力
New password: パスワードを入力
Re-enter new password: パスワードを再度入力
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]  Enterのみを入力
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]  Enterのみを入力
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]  Enterのみを入力
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]  Enterのみを入力
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

mysqlへログインしデーターベースなどを作成
# mysql -u root -pXXXXXXX ←XXXXXXXは設定したパスワード -pの後にスペースは入れてはいけない
mysql> GRANT ALL PRIVILEGES ON bacula.* TO bacula@localhost IDENTIFIED BY “XXXXXXX”; ← XXXXXXXは設定したいパスワード、後でbaculaのconfファイルに記入する。
mysql> FLUSH PRIVILEGES;
mysql> CREATE DATABASE bacula;
mysql> quit
これでdatabaseが出来ましたので、用意されているスクリプトでtableを作ります。
2019-4-3追記現在私が使用しているmysqlはVer 14.14 Distrib 5.6.43です、これだとこのままではエラーになり(予約語の関係だそうです)修正が必要です。
/usr/libexec/bacula/make_mysql_tables の325行目位にCREATE TABLE Counters ( がありますのでその中身を変更します。
CREATE TABLE Counters (
\`Counter\` TINYBLOB NOT NULL,
\`MinValue\` INTEGER DEFAULT 0,
\`MaxValue\` INTEGER DEFAULT 0,
\`CurrentValue\` INTEGER DEFAULT 0,
\`WrapCounter\` TINYBLOB NOT NULL,
PRIMARY KEY (Counter(128))
);

バックスラッシュの後は ' ではなく ` です、間違えない様に、日本語のキーボードでは @ の上です。
それから下のコマンドを入力してテーブルを作ります。
# /usr/libexec/bacula/make_mysql_tables -pXXXXXX ←XXXXXXは今設定したパスワード
Creation of Bacula MySQL tables succeeded.
次はいよいよbaculaの設定

Printer Friendly Page Send this Story to a Friend
 
投稿された内容の著作権はコメントの投稿者に帰属します。
テーマ選択

(4 テーマ)
ミニカレンダー
前月2024年 3月翌月
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
<今日>
ピックアップ画像
HM1 099
最近の画像
IMG_0004.jpg (2023-3-17)
IMG_0004.jpg
IMG_0003.jpg (2023-3-17)
IMG_0003.jpg
IMG_0010.jpg (2023-3-17)
IMG_0010.jpg
IMG_0013.jpg (2023-3-17)
IMG_0013.jpg
IMG_0007.jpg (2023-3-17)
IMG_0007.jpg
IMG_0005.jpg (2023-3-17)
IMG_0005.jpg
IMG_0002.jpg (2023-3-17)
IMG_0002.jpg
IMG_0011.jpg (2023-3-17)
IMG_0011.jpg
IMG_0009.jpg (2023-3-17)
IMG_0009.jpg
IMG_0008.jpg (2023-3-17)
IMG_0008.jpg
人気画像
ゴーキョピー... (5994 hits)
ゴーキョピー...
ギャチュンカ... (5855 hits)
ギャチュンカ...
ばあちゃんミ... (5755 hits)
ばあちゃんミ...
ヒマラヤ壁 (5661 hits)
ヒマラヤ壁
タムセルク残... (5470 hits)
タムセルク残...
Powered by Xoops2 Theme Modified by F-Otake
copyright (c) 2006 All rights reserved.