Tag Archives: replication

GlusterFS 3: replicated volumes

download and install latest glusterfs package from http://download.gluster.org/pub/gluster/glusterfs/LATEST/

I'll create two replicated machines and one follower machine:

machine1 # /etc/init.d/glusterd start
machine2 # /etc/init.d/glusterd start

machine1 # gluster peer probe machine2
Probe successful

machine2 # gluster peer probe machine1
Probe successful

machine1 # mkdir -p /etc/glusterfs/data/storage
machine2 # mkdir -p /etc/glusterfs/data/storage
machine1 # gluster volume create storage replica 2 transport tcp\
machine1:/etc/glusterfs/data/storage machine2:/etc/glusterfs/data/storage

machine2 # gluster volume start storage

machine1 # showmount -e machine1
Export list for machine1:
/storage *

machine2 # showmount -e machine2
Export list for machine1:
/storage *

machine1 # mkdir -p /mnt/glusterfs/storage
machine2 # mkdir -p /mnt/glusterfs/storage
machine1 # mount.glusterfs machine1:/storage /mnt/glusterfs/storage
machine2 # mount.glusterfs machine2:/storage /mnt/glusterfs/storage

machine1 # ls /mnt/glusterfs/storage/
empty

machine2 # ls /mnt/glusterfs/storage/
empty

machine1 # touch /mnt/glusterfs/storage/testfile
machine2 # ls -la /mnt/glusterfs/storage/testfile
-rw-r--r-- 1 root root 0 2012-07-26 17:09 /mnt/glusterfs/storage/testfile

machine2 # echo «It's a simple test» > /mnt/glusterfs/storage/testfile
machine1 # cat /mnt/glusterfs/storage/testfile
It's a simple test

Other machines can mount folders via network
machine3 # mount.glusterfs machine1:/storage /mnt/glusterfs/storage
machine4 # mount.glusterfs machine2:/storage /mnt/glusterfs/storage

mysql 5.1: replication

Master server

edit /etc/mysql/conf.d/replication.cnf

1
[mysqld]

1
server-id        =
1
1

1
# By
1
default
1
, the directory is written to the directory of database.

1
# IMPORTANT: If you lose the base, having a backup and binary logs, you can restore a database at the time of collapse. For
1
this

1
# reason, the logs and databases should be stored at physically different carriers.

1
log-bin          = /db/log/mysql-bin.log

1
# This variable applies when binary logging is enabled. It controls whether stored function creators can be trusted not to create #stored functions that will cause unsafe events to be written to the binary log.

1
log_bin_trust_function_creators =
1
1

1
# The number of days
1
for
1
automatic binary log file removal..

1
expire_logs_days =
1
90

1
# >=
1
5.1
1
.
1
28
1
- you is unable to start shard without
1
this
1
option.

1
# < 
1
5.1

   

1
- you is unable to start mysqld server without
1
this
1
option.

1
binlog_format    = MIXED

1
max_binlog_size  = 100M
# In addition, the transaction can determine what needs to change the data and may be useful to diagnose various problems.
# For MySQL <= 5.0: We don't recommend to use this option due to the replication became fragile.

mysql -uroot -p

1
GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO replicator@
1
'%'
1
IDENTIFIED BY
1
'****'
1
;

/etc/init.d/mysql restart
Continue reading mysql 5.1: replication

CentOS: how to install postgresql 9.1

$ wget http://yum.pgrpms.org/reporpms/9.1/pgdg-centos91-9.1-4.noarch.rpm

# rpm -i pgdg-centos91-9.1-4.noarch.rpm

add "exclude=postgresql* " (without quotes) to /etc/yum.repos.d/CentOS-Base.repo in the end of sections [base] and [updates].

# yum install postgresql91-server  

# service postgresql-9.1 initdb 

# service postgresql-9.1 start 

# chkconfig postgresql-9.1 on

 

Replication:

how to make replication you can learn from official wiki:

https://wiki.postgresql.org/wiki/Streaming_Replication