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 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
|
.. _Dedicated-replication-network:
=============================
Dedicated replication network
=============================
-------
Summary
-------
Swift's replication process is essential for consistency and availability of
data. By default, replication activity will use the same network interface as
other cluster operations. However, if a replication interface is set in the
ring for a node, that node will send replication traffic on its designated
separate replication network interface. Replication traffic includes REPLICATE
requests and rsync traffic.
To separate the cluster-internal replication traffic from client traffic,
separate replication servers can be used. These replication servers are based
on the standard storage servers, but they listen on the replication IP and
only respond to REPLICATE requests. Storage servers can serve REPLICATE
requests, so an operator can transition to using a separate replication
network with no cluster downtime.
Replication IP and port information is stored in the ring on a per-node basis.
These parameters will be used if they are present, but they are not required.
If this information does not exist or is empty for a particular node, the
node's standard IP and port will be used for replication.
--------------------
For SAIO replication
--------------------
#. Create new script in ~/bin/ (for example: remakerings_new)::
#!/bin/bash
cd /etc/swift
rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz
swift-ring-builder object.builder create 18 3 1
swift-ring-builder object.builder add z1-127.0.0.1:6010R127.0.0.1:6050/sdb1 1
swift-ring-builder object.builder add z2-127.0.0.1:6020R127.0.0.1:6060/sdb2 1
swift-ring-builder object.builder add z3-127.0.0.1:6030R127.0.0.1:6070/sdb3 1
swift-ring-builder object.builder add z4-127.0.0.1:6040R127.0.0.1:6080/sdb4 1
swift-ring-builder object.builder rebalance
swift-ring-builder container.builder create 18 3 1
swift-ring-builder container.builder add z1-127.0.0.1:6011R127.0.0.1:6051/sdb1 1
swift-ring-builder container.builder add z2-127.0.0.1:6021R127.0.0.1:6061/sdb2 1
swift-ring-builder container.builder add z3-127.0.0.1:6031R127.0.0.1:6071/sdb3 1
swift-ring-builder container.builder add z4-127.0.0.1:6041R127.0.0.1:6081/sdb4 1
swift-ring-builder container.builder rebalance
swift-ring-builder account.builder create 18 3 1
swift-ring-builder account.builder add z1-127.0.0.1:6012R127.0.0.1:6052/sdb1 1
swift-ring-builder account.builder add z2-127.0.0.1:6022R127.0.0.1:6062/sdb2 1
swift-ring-builder account.builder add z3-127.0.0.1:6032R127.0.0.1:6072/sdb3 1
swift-ring-builder account.builder add z4-127.0.0.1:6042R127.0.0.1:6082/sdb4 1
swift-ring-builder account.builder rebalance
.. note::
Syntax of adding device has been changed: R<ip_replication>:<port_replication> was added between z<zone>-<ip>:<port> and /<device_name>_<meta> <weight>. Added devices will use <ip_replication> and <port_replication> for replication activities.
#. Add next rows in /etc/rsyncd.conf::
[account6052]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/account6052.lock
[account6062]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/account6062.lock
[account6072]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/account6072.lock
[account6082]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/account6082.lock
[container6051]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/container6051.lock
[container6061]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/container6061.lock
[container6071]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/container6071.lock
[container6081]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/container6081.lock
[object6050]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/object6050.lock
[object6060]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/object6060.lock
[object6070]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/object6070.lock
[object6080]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/object6080.lock
#. Restart rsync daemon::
service rsync restart
#. Add changes in configuration files in directories:
* /etc/swift/object-server(files: 1.conf, 2.conf, 3.conf, 4.conf)
* /etc/swift/container-server(files: 1.conf, 2.conf, 3.conf, 4.conf)
* /etc/swift/account-server(files: 1.conf, 2.conf, 3.conf, 4.conf)
delete all configuration options in section [<*>-replicator]
#. Add configuration files for object-server, in /etc/swift/object-server/
* 5.conf::
[DEFAULT]
devices = /srv/1/node
mount_check = false
disable_fallocate = true
bind_port = 6050
user = swift
log_facility = LOG_LOCAL2
recon_cache_path = /var/cache/swift
[pipeline:main]
pipeline = recon object-server
[app:object-server]
use = egg:swift#object
replication_server = True
[filter:recon]
use = egg:swift#recon
[object-replicator]
rsync_module = {replication_ip}::object{replication_port}
* 6.conf::
[DEFAULT]
devices = /srv/2/node
mount_check = false
disable_fallocate = true
bind_port = 6060
user = swift
log_facility = LOG_LOCAL3
recon_cache_path = /var/cache/swift2
[pipeline:main]
pipeline = recon object-server
[app:object-server]
use = egg:swift#object
replication_server = True
[filter:recon]
use = egg:swift#recon
[object-replicator]
rsync_module = {replication_ip}::object{replication_port}
* 7.conf::
[DEFAULT]
devices = /srv/3/node
mount_check = false
disable_fallocate = true
bind_port = 6070
user = swift
log_facility = LOG_LOCAL4
recon_cache_path = /var/cache/swift3
[pipeline:main]
pipeline = recon object-server
[app:object-server]
use = egg:swift#object
replication_server = True
[filter:recon]
use = egg:swift#recon
[object-replicator]
rsync_module = {replication_ip}::object{replication_port}
* 8.conf::
[DEFAULT]
devices = /srv/4/node
mount_check = false
disable_fallocate = true
bind_port = 6080
user = swift
log_facility = LOG_LOCAL5
recon_cache_path = /var/cache/swift4
[pipeline:main]
pipeline = recon object-server
[app:object-server]
use = egg:swift#object
replication_server = True
[filter:recon]
use = egg:swift#recon
[object-replicator]
rsync_module = {replication_ip}::object{replication_port}
#. Add configuration files for container-server, in /etc/swift/container-server/
* 5.conf::
[DEFAULT]
devices = /srv/1/node
mount_check = false
disable_fallocate = true
bind_port = 6051
user = swift
log_facility = LOG_LOCAL2
recon_cache_path = /var/cache/swift
[pipeline:main]
pipeline = recon container-server
[app:container-server]
use = egg:swift#container
replication_server = True
[filter:recon]
use = egg:swift#recon
[container-replicator]
rsync_module = {replication_ip}::container{replication_port}
* 6.conf::
[DEFAULT]
devices = /srv/2/node
mount_check = false
disable_fallocate = true
bind_port = 6061
user = swift
log_facility = LOG_LOCAL3
recon_cache_path = /var/cache/swift2
[pipeline:main]
pipeline = recon container-server
[app:container-server]
use = egg:swift#container
replication_server = True
[filter:recon]
use = egg:swift#recon
[container-replicator]
rsync_module = {replication_ip}::container{replication_port}
* 7.conf::
[DEFAULT]
devices = /srv/3/node
mount_check = false
disable_fallocate = true
bind_port = 6071
user = swift
log_facility = LOG_LOCAL4
recon_cache_path = /var/cache/swift3
[pipeline:main]
pipeline = recon container-server
[app:container-server]
use = egg:swift#container
replication_server = True
[filter:recon]
use = egg:swift#recon
[container-replicator]
rsync_module = {replication_ip}::container{replication_port}
* 8.conf::
[DEFAULT]
devices = /srv/4/node
mount_check = false
disable_fallocate = true
bind_port = 6081
user = swift
log_facility = LOG_LOCAL5
recon_cache_path = /var/cache/swift4
[pipeline:main]
pipeline = recon container-server
[app:container-server]
use = egg:swift#container
replication_server = True
[filter:recon]
use = egg:swift#recon
[container-replicator]
rsync_module = {replication_ip}::container{replication_port}
#. Add configuration files for account-server, in /etc/swift/account-server/
* 5.conf::
[DEFAULT]
devices = /srv/1/node
mount_check = false
disable_fallocate = true
bind_port = 6052
user = swift
log_facility = LOG_LOCAL2
recon_cache_path = /var/cache/swift
[pipeline:main]
pipeline = recon account-server
[app:account-server]
use = egg:swift#account
replication_server = True
[filter:recon]
use = egg:swift#recon
[account-replicator]
rsync_module = {replication_ip}::account{replication_port}
* 6.conf::
[DEFAULT]
devices = /srv/2/node
mount_check = false
disable_fallocate = true
bind_port = 6062
user = swift
log_facility = LOG_LOCAL3
recon_cache_path = /var/cache/swift2
[pipeline:main]
pipeline = recon account-server
[app:account-server]
use = egg:swift#account
replication_server = True
[filter:recon]
use = egg:swift#recon
[account-replicator]
rsync_module = {replication_ip}::account{replication_port}
* 7.conf::
[DEFAULT]
devices = /srv/3/node
mount_check = false
disable_fallocate = true
bind_port = 6072
user = swift
log_facility = LOG_LOCAL4
recon_cache_path = /var/cache/swift3
[pipeline:main]
pipeline = recon account-server
[app:account-server]
use = egg:swift#account
replication_server = True
[filter:recon]
use = egg:swift#recon
[account-replicator]
rsync_module = {replication_ip}::account{replication_port}
* 8.conf::
[DEFAULT]
devices = /srv/4/node
mount_check = false
disable_fallocate = true
bind_port = 6082
user = swift
log_facility = LOG_LOCAL5
recon_cache_path = /var/cache/swift4
[pipeline:main]
pipeline = recon account-server
[app:account-server]
use = egg:swift#account
replication_server = True
[filter:recon]
use = egg:swift#recon
[account-replicator]
rsync_module = {replication_ip}::account{replication_port}
---------------------------------
For a Multiple Server replication
---------------------------------
#. Move configuration file.
* Configuration file for object-server from /etc/swift/object-server.conf to /etc/swift/object-server/1.conf
* Configuration file for container-server from /etc/swift/container-server.conf to /etc/swift/container-server/1.conf
* Configuration file for account-server from /etc/swift/account-server.conf to /etc/swift/account-server/1.conf
#. Add changes in configuration files in directories:
* /etc/swift/object-server(files: 1.conf)
* /etc/swift/container-server(files: 1.conf)
* /etc/swift/account-server(files: 1.conf)
delete all configuration options in section [<*>-replicator]
#. Add configuration files for object-server, in /etc/swift/object-server/2.conf::
[DEFAULT]
bind_ip = $STORAGE_LOCAL_NET_IP
workers = 2
[pipeline:main]
pipeline = object-server
[app:object-server]
use = egg:swift#object
replication_server = True
[object-replicator]
#. Add configuration files for container-server, in /etc/swift/container-server/2.conf::
[DEFAULT]
bind_ip = $STORAGE_LOCAL_NET_IP
workers = 2
[pipeline:main]
pipeline = container-server
[app:container-server]
use = egg:swift#container
replication_server = True
[container-replicator]
#. Add configuration files for account-server, in /etc/swift/account-server/2.conf::
[DEFAULT]
bind_ip = $STORAGE_LOCAL_NET_IP
workers = 2
[pipeline:main]
pipeline = account-server
[app:account-server]
use = egg:swift#account
replication_server = True
[account-replicator]
|