āĻŦāĻŋāϤāϰāĻŖāĻ•ā§ƒāϤ āĻ¤ā§āϰ⧁āϟāĻŋ-āϏāĻšāύāĻļā§€āϞ LeoFS āĻ…āĻŦāĻœā§‡āĻ•ā§āϟ āĻ¸ā§āĻŸā§‹āϰ⧇āĻœā§‡āϰ āχāύāĻ¸ā§āϟāϞ⧇āĻļāύ, S3, NFS āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āϟāĻĻ⧇āϰ āϏāĻžāĻĨ⧇ āϏāĻžāĻŽāĻžā§āϜāĻ¸ā§āϝāĻĒā§‚āĻ°ā§āĻŖ

āĻ…āύ⧁āϝāĻžāϝāĻŧā§€ āĻ“āĻĒ⧇āύāύ⧇āϟ: āϞāĻŋāĻ“āĻāĻĢāĻāϏ — āĻŦāĻŋāϤāϰāĻŖ āĻ•āϰāĻž āĻĻā§‹āώ-āϏāĻšāύāĻļā§€āϞ āĻŦāĻ¸ā§āϤ⧁āϰ āϏāĻžā§āϚāϝāĻŧāĻ¸ā§āĻĨāĻžāύ āϞāĻŋāĻ“āĻāĻĢāĻāϏ, Amazon S3 API āĻāĻŦāĻ‚ REST-API āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āϟāĻĻ⧇āϰ āϏāĻžāĻĨ⧇ āϏāĻžāĻŽāĻžā§āϜāĻ¸ā§āϝāĻĒā§‚āĻ°ā§āĻŖ, āĻāĻŦāĻ‚ āĻāĻ›āĻžāĻĄāĻŧāĻžāĻ“ NFS āϏāĻžāĻ°ā§āĻ­āĻžāϰ āĻŽā§‹āĻĄ āϏāĻŽāĻ°ā§āĻĨāύ āĻ•āϰ⧇āĨ¤ āϛ⧋āϟ āĻāĻŦāĻ‚ āϖ⧁āĻŦ āĻŦāĻĄāĻŧ āωāĻ­āϝāĻŧ āĻŦāĻ¸ā§āϤ⧁ āϏāĻ‚āϰāĻ•ā§āώāϪ⧇āϰ āϜāĻ¨ā§āϝ āĻ…āĻĒā§āϟāĻŋāĻŽāĻžāχāĻœā§‡āĻļāύ āϰāϝāĻŧ⧇āϛ⧇, āĻāĻ•āϟāĻŋ āĻ…āĻ¨ā§āϤāĻ°ā§āύāĻŋāĻ°ā§āĻŽāĻŋāϤ āĻ•ā§āϝāĻžāĻļāĻŋāĻ‚ āĻĒā§āϰāĻ•ā§āϰāĻŋāϝāĻŧāĻž āϰāϝāĻŧ⧇āϛ⧇ āĻāĻŦāĻ‚ āĻĄā§‡āϟāĻž āϕ⧇āĻ¨ā§āĻĻā§āϰāϗ⧁āϞāĻŋāϰ āĻŽāĻ§ā§āϝ⧇ āĻ¸ā§āĻŸā§‹āϰ⧇āĻœā§‡āϰ āĻĒā§āϰāϤāĻŋāϞāĻŋāĻĒāĻŋ āĻ•āϰāĻž āϏāĻŽā§āĻ­āĻŦāĨ¤ āĻĒā§āϰāĻ•āĻ˛ā§āĻĒ⧇āϰ āϞāĻ•ā§āĻˇā§āϝāϗ⧁āϞāĻŋāϰ āĻŽāĻ§ā§āϝ⧇ āϰāϝāĻŧ⧇āϛ⧇ āύāĻ•āϞ⧇āϰ āĻ…āĻĒā§āϰāϝāĻŧā§‹āϜāύ⧀āϝāĻŧ āĻĒā§āϰāϤāĻŋāϞāĻŋāĻĒāĻŋāϰ āĻŽāĻžāĻ§ā§āϝāĻŽā§‡ 99.9999999% āύāĻŋāĻ°ā§āĻ­āϰāϝ⧋āĻ—ā§āϝāϤāĻž āĻ…āĻ°ā§āϜāύ āĻ•āϰāĻž āĻāĻŦāĻ‚ āĻŦā§āϝāĻ°ā§āĻĨāϤāĻžāϰ āĻāĻ•āĻ• āĻĒāϝāĻŧ⧇āĻ¨ā§āϟ āĻĻā§‚āϰ āĻ•āϰāĻžāĨ¤ āĻĒā§āϰāĻ•āĻ˛ā§āĻĒ āϕ⧋āĻĄ Erlang āϞ⧇āĻ–āĻž āĻšāϝāĻŧ.

LeoFS āϤāĻŋāύāϟāĻŋ āωāĻĒāĻžāĻĻāĻžāύ āύāĻŋāϝāĻŧ⧇ āĻ—āĻ āĻŋāϤ:

  • āϞāĻŋāĻ“āĻāĻĢāĻāϏ āĻ¸ā§āĻŸā§‹āϰ⧇āϜ — āĻŦāĻ¸ā§āϤ⧁ āĻāĻŦāĻ‚ āĻŽā§‡āϟāĻžāĻĄā§‡āϟāĻž āϝ⧋āĻ—, āĻĒ⧁āύāϰ⧁āĻĻā§āϧāĻžāϰ āĻāĻŦāĻ‚ āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻžāϰ āĻ•āĻžāϜ āĻ•āϰ⧇, āĻĒā§āϰāϤāĻŋāϞāĻŋāĻĒāĻŋ, āĻĒ⧁āύāϰ⧁āĻĻā§āϧāĻžāϰ āĻāĻŦāĻ‚ āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āĻŸā§‡āϰ āĻ…āύ⧁āϰ⧋āϧ āϏāĻžāϰāĻŋāĻŦāĻĻā§āϧ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āĻĻāĻžāϝāĻŧā§€āĨ¤
  • āϞāĻŋāĻ“āĻāĻĢāĻāϏ āϗ⧇āϟāĻ“āϝāĻŧ⧇ — HTTP āĻ…āύ⧁āϰ⧋āϧāϗ⧁āϞāĻŋ āĻĒāϰāĻŋāĻŦ⧇āĻļāύ āĻ•āϰ⧇ āĻāĻŦāĻ‚ REST-API āĻŦāĻž S3-API āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āϟāĻĻ⧇āϰ āĻĒā§āϰāϤāĻŋāĻ•ā§āϰāĻŋāϝāĻŧāĻž āĻĒ⧁āύāσāύāĻŋāĻ°ā§āĻĻ⧇āĻļ āĻ•āϰ⧇, āĻŽā§‡āĻŽāϰāĻŋāϤ⧇ āĻāĻŦāĻ‚ āĻĄāĻŋāĻ¸ā§āϕ⧇ āϏāĻ°ā§āĻŦāĻžāϧāĻŋāĻ• āĻĒā§āϰāϝāĻŧā§‹āϜāύ⧀āϝāĻŧ āĻĄā§‡āϟāĻž āĻ•ā§āϝāĻžāĻļāĻŋāĻ‚ āύāĻŋāĻļā§āϚāĻŋāϤ āĻ•āϰ⧇āĨ¤
  • āϞāĻŋāĻ“āĻāĻĢāĻāϏ āĻŽā§āϝāĻžāύ⧇āϜāĻžāϰ — LeoFS āϗ⧇āϟāĻ“āϝāĻŧ⧇ āĻāĻŦāĻ‚ LeoFS āĻ¸ā§āĻŸā§‹āϰ⧇āϜ āύ⧋āĻĄā§‡āϰ āĻ•ā§āϰāĻŋāϝāĻŧāĻžāĻ•āϞāĻžāĻĒ āύāĻŋāϰ⧀āĻ•ā§āώāĻŖ āĻ•āϰ⧇, āύ⧋āĻĄāϗ⧁āϞāĻŋāϰ āĻ…āĻŦāĻ¸ā§āĻĨāĻž āĻĒāĻ°ā§āϝāĻŦ⧇āĻ•ā§āώāĻŖ āĻ•āϰ⧇ āĻāĻŦāĻ‚ āĻšā§‡āĻ•āϏāĻžāĻŽāϗ⧁āϞāĻŋ āĻĒāϰ⧀āĻ•ā§āώāĻž āĻ•āϰ⧇āĨ¤ āĻĄā§‡āϟāĻž āĻ…āĻ–āĻŖā§āĻĄāϤāĻž āĻāĻŦāĻ‚ āωāĻšā§āϚ āĻ¸ā§āĻŸā§‹āϰ⧇āϜ āĻĒā§āϰāĻžāĻĒā§āϝāϤāĻžāϰ āĻ—ā§āϝāĻžāϰāĻžāĻ¨ā§āϟāĻŋ āĻĻ⧇āϝāĻŧāĨ¤

āĻāχ āĻĒā§‹āĻ¸ā§āĻŸā§‡ āφāĻŽāϰāĻž Ansible-playbook āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ Leofs āχāύāĻ¸ā§āϟāϞ āĻ•āϰāĻŦ āĻāĻŦāĻ‚ S3, NFS āĻĒāϰ⧀āĻ•ā§āώāĻž āĻ•āϰāĻŦāĨ¤

āφāĻĒāύāĻŋ āϝāĻĻāĻŋ āĻ…āĻĢāĻŋāϏāĻŋāϝāĻŧāĻžāϞ āĻĒā§āϞ⧇āĻŦ⧁āĻ• āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ LeoFS āχāύāĻ¸ā§āϟāϞ āĻ•āϰāĻžāϰ āĻšā§‡āĻˇā§āϟāĻž āĻ•āϰ⧇āύ, āφāĻĒāύāĻŋ āĻŦāĻŋāĻ­āĻŋāĻ¨ā§āύ āĻ¤ā§āϰ⧁āϟāĻŋāϰ āϏāĻŽā§āĻŽā§āĻ–ā§€āύ āĻšāĻŦ⧇āύ: 1,2. āĻāχ āϭ⧁āϞāϗ⧁āϞāĻŋ āĻāĻĄāĻŧāĻžāϤ⧇ āϕ⧀ āĻ•āϰāĻž āĻĻāϰāĻ•āĻžāϰ āϤāĻž āφāĻŽāĻŋ āĻāχ āĻĒā§‹āĻ¸ā§āĻŸā§‡ āϞāĻŋāĻ–āĻŦāĨ¤

āϝ⧇āĻ–āĻžāύ⧇ āφāĻĒāύāĻŋ āĻāύāϏāĻŋāĻŦāϞ-āĻĒā§āϞ⧇āĻŦ⧁āĻ• āϚāĻžāϞāĻžāĻŦ⧇āύ, āφāĻĒāύāĻžāϕ⧇ āύ⧇āϟāĻ•ā§āϝāĻžāϟ āχāύāĻ¸ā§āϟāϞ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤

āχāύāϭ⧇āĻ¨ā§āϟāϰāĻŋ āωāĻĻāĻžāĻšāϰāĻŖ

āωāĻĻāĻžāĻšāϰāĻŖ āχāύāϭ⧇āĻ¨ā§āϟāϰāĻŋ (hosts.sample repository āĻ):

# Please check roles/common/vars/leofs_releases for available versions
[all:vars]
leofs_version=1.4.3
build_temp_path="/tmp/leofs_builder"
build_install_path="/tmp/"
build_branch="master"
source="package"

#[builder]
#172.26.9.177

# nodename of leo_manager_0 and leo_manager_1 are set at group_vars/all
[leo_manager_0]
172.26.9.176

# nodename of leo_manager_0 and leo_manager_1 are set at group_vars/all
[leo_manager_1]
172.26.9.178

[leo_storage]
172.26.9.179 leofs_module_nodename=S0@172.26.9.179
172.26.9.181 leofs_module_nodename=S0@172.26.9.181
172.26.9.182 leofs_module_nodename=S0@172.26.9.182
172.26.9.183 leofs_module_nodename=S0@172.26.9.183

[leo_gateway]
172.26.9.180 leofs_module_nodename=G0@172.26.9.180
172.26.9.184 leofs_module_nodename=G0@172.26.9.184

[leofs_nodes:children]
leo_manager_0
leo_manager_1
leo_gateway
leo_storage

āϏāĻžāĻ°ā§āĻ­āĻžāϰ āĻĒā§āϰāĻ¸ā§āϤ⧁āϤāĻŋ

āϏ⧇āϞāĻŋāύāĻžāĻ•ā§āϏ āĻ…āĻ•ā§āώāĻŽ āĻ•āϰāĻž āĻšāĻšā§āϛ⧇āĨ¤ āφāĻŽāĻŋ āφāĻļāĻž āĻ•āϰāĻŋ āϏāĻŽā§āĻĒā§āϰāĻĻāĻžāϝāĻŧ LeoFS-āĻāϰ āϜāĻ¨ā§āϝ Selinux āύ⧀āϤāĻŋ āϤ⧈āϰāĻŋ āĻ•āϰāĻŦ⧇āĨ¤

    - name: Install libselinux as prerequisite for SELinux Ansible module
      yum:
        name: "{{item}}"
        state: latest
      with_items:
        - libselinux-python
        - libsemanage-python

    - name: Disable SELinux at next reboot
      selinux:
        state: disabled

    - name: Set SELinux in permissive mode until the machine is rebooted
      command: setenforce 0
      ignore_errors: true
      changed_when: false

āĻŦāĻŋāĻ¨ā§āϝāĻžāϏ netcat и redhat-lsb-core. netcat āϜāĻ¨ā§āϝ āĻĒā§āϰāϝāĻŧā§‹āϜāύ leofs-adm, redhat-lsb-core OS āϏāĻ‚āĻ¸ā§āĻ•āϰāĻŖ āύāĻŋāĻ°ā§āϧāĻžāϰāĻŖ āĻ•āϰāϤ⧇ āĻĒā§āϰāϝāĻŧā§‹āϜāύ āĻāĻ–āĻžāύ⧇.

    - name: Install Packages
      yum: name={{ item }} state=present
      with_items:
        - nmap-ncat
        - redhat-lsb-core

āĻāĻ•āϟāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰāĻ•āĻžāϰ⧀ āϞāĻŋāĻ“āĻĢ āϤ⧈āϰāĻŋ āĻ•āϰāĻž āĻāĻŦāĻ‚ āϚāĻžāĻ•āĻž āĻ—ā§āϰ⧁āĻĒ⧇ āϝ⧋āĻ— āĻ•āϰāĻž

    - name: Create user leofs
      group:
        name: leofs
        state: present

    - name: Allow 'wheel' group to have passwordless sudo
      lineinfile:
        dest: /etc/sudoers
        state: present
        regexp: '^%wheel'
        line: '%wheel ALL=(ALL) NOPASSWD: ALL'
        validate: 'visudo -cf %s'

    - name: Add the user 'leofs' to group 'wheel'
      user:
        name: leofs
        groups: wheel
        append: yes

Erlang āχāύāĻ¸ā§āϟāϞ āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

    - name: Remote erlang-20.3.8.23-1.el7.x86_64.rpm install with yum
      yum: name=https://github.com/rabbitmq/erlang-rpm/releases/download/v20.3.8.23/erlang-20.3.8.23-1.el7.x86_64.rpm

āϏāĻ‚āĻļā§‹āϧāύ āĻ•āϰāĻž āωāĻ¤ā§āϤāϰāϝ⧋āĻ—ā§āϝ āĻĒā§āϞ⧇āĻŦ⧁āϕ⧇āϰ āϏāĻŽā§āĻĒā§‚āĻ°ā§āĻŖ āϏāĻ‚āĻ¸ā§āĻ•āϰāĻŖāϟāĻŋ āĻāĻ–āĻžāύ⧇ āĻĒāĻžāĻ“āϝāĻŧāĻž āϝāĻžāĻŦ⧇: https://github.com/patsevanton/leofs_ansible

āχāύāĻ¸ā§āϟāϞ⧇āĻļāύ, āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ⧇āĻļāύ, āϞāĻžā§āϚ

āĻĒāϰāĻŦāĻ°ā§āϤ⧀ āφāĻŽāϰāĻž āϞāĻŋāĻ–āĻŋāϤ āĻšāĻŋāϏāĻžāĻŦ⧇ āϏāĻžā§āϚāĻžāϞāύ https://github.com/leo-project/leofs_ansible build_leofs.yml āĻ›āĻžāĻĄāĻŧāĻž

## Install LeoFS
$ ansible-playbook -i hosts install_leofs.yml

## Config LeoFS
$ ansible-playbook -i hosts config_leofs.yml

## Start LeoFS
$ ansible-playbook -i hosts start_leofs.yml

āĻĒā§āϰāĻžāχāĻŽāĻžāϰāĻŋ āϞāĻŋāĻ“āĻŽā§āϝāĻžāύ⧇āϜāĻžāϰ⧇ āĻ•ā§āϞāĻžāĻ¸ā§āϟāĻžāϰ āĻ¸ā§āĻŸā§āϝāĻžāϟāĻžāϏ āĻšā§‡āĻ• āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

leofs-adm status

āĻĒā§āϰāĻžāĻĨāĻŽāĻŋāĻ• āĻāĻŦāĻ‚ āĻŽāĻžāĻ§ā§āϝāĻŽāĻŋāĻ• āωāĻ¤ā§āϤāϰāϝ⧋āĻ—ā§āϝ-āĻĒā§āϞ⧇āĻŦ⧁āĻ• āϞāĻ—āϗ⧁āϞāĻŋāϤ⧇ āĻĻ⧇āĻ–āĻž āϝāĻžāϝāĻŧ

āĻŦāĻŋāϤāϰāĻŖāĻ•ā§ƒāϤ āĻ¤ā§āϰ⧁āϟāĻŋ-āϏāĻšāύāĻļā§€āϞ LeoFS āĻ…āĻŦāĻœā§‡āĻ•ā§āϟ āĻ¸ā§āĻŸā§‹āϰ⧇āĻœā§‡āϰ āχāύāĻ¸ā§āϟāϞ⧇āĻļāύ, S3, NFS āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āϟāĻĻ⧇āϰ āϏāĻžāĻĨ⧇ āϏāĻžāĻŽāĻžā§āϜāĻ¸ā§āϝāĻĒā§‚āĻ°ā§āĻŖ

āĻŦāĻŋāϤāϰāĻŖāĻ•ā§ƒāϤ āĻ¤ā§āϰ⧁āϟāĻŋ-āϏāĻšāύāĻļā§€āϞ LeoFS āĻ…āĻŦāĻœā§‡āĻ•ā§āϟ āĻ¸ā§āĻŸā§‹āϰ⧇āĻœā§‡āϰ āχāύāĻ¸ā§āϟāϞ⧇āĻļāύ, S3, NFS āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āϟāĻĻ⧇āϰ āϏāĻžāĻĨ⧇ āϏāĻžāĻŽāĻžā§āϜāĻ¸ā§āϝāĻĒā§‚āĻ°ā§āĻŖ

āφāωāϟāĻĒ⧁āϟ āĻāϰāĻ•āĻŽ āĻ•āĻŋāϛ⧁ āĻšāĻŦ⧇

 [System Confiuration]
-----------------------------------+----------
 Item                              | Value    
-----------------------------------+----------
 Basic/Consistency level
-----------------------------------+----------
                    system version | 1.4.3
                        cluster Id | leofs_1
                             DC Id | dc_1
                    Total replicas | 2
          number of successes of R | 1
          number of successes of W | 1
          number of successes of D | 1
 number of rack-awareness replicas | 0
                         ring size | 2^128
-----------------------------------+----------
 Multi DC replication settings
-----------------------------------+----------
 [mdcr] max number of joinable DCs | 2
 [mdcr] total replicas per a DC    | 1
 [mdcr] number of successes of R   | 1
 [mdcr] number of successes of W   | 1
 [mdcr] number of successes of D   | 1
-----------------------------------+----------
 Manager RING hash
-----------------------------------+----------
                 current ring-hash | a0314afb
                previous ring-hash | a0314afb
-----------------------------------+----------

 [State of Node(s)]
-------+----------------------+--------------+---------+----------------+----------------+----------------------------
 type  |         node         |    state     | rack id |  current ring  |   prev ring    |          updated at         
-------+----------------------+--------------+---------+----------------+----------------+----------------------------
  S    | S0@172.26.9.179      | running      |         | a0314afb       | a0314afb       | 2019-12-05 10:33:47 +0000
  S    | S0@172.26.9.181      | running      |         | a0314afb       | a0314afb       | 2019-12-05 10:33:47 +0000
  S    | S0@172.26.9.182      | running      |         | a0314afb       | a0314afb       | 2019-12-05 10:33:47 +0000
  S    | S0@172.26.9.183      | attached     |         |                |                | 2019-12-05 10:33:58 +0000
  G    | G0@172.26.9.180      | running      |         | a0314afb       | a0314afb       | 2019-12-05 10:33:49 +0000
  G    | G0@172.26.9.184      | running      |         | a0314afb       | a0314afb       | 2019-12-05 10:33:49 +0000
-------+----------------------+--------------+---------+----------------+----------------+----------------------------

āĻāĻ•āϜāύ āĻŦā§āϝāĻŦāĻšāĻžāϰāĻ•āĻžāϰ⧀ āϤ⧈āϰāĻŋ āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

āĻāĻ•āϟāĻŋ leofs āĻŦā§āϝāĻŦāĻšāĻžāϰāĻ•āĻžāϰ⧀ āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ:

leofs-adm create-user leofs leofs

  access-key-id: 9c2615f32e81e6a1caf5
  secret-access-key: 8aaaa35c1ad78a2cbfa1a6cd49ba8aaeb3ba39eb

āĻŦā§āϝāĻŦāĻšāĻžāϰāĻ•āĻžāϰ⧀āĻĻ⧇āϰ āϤāĻžāϞāĻŋāĻ•āĻž:

leofs-adm get-users
user_id     | role_id | access_key_id          | created_at                
------------+---------+------------------------+---------------------------
_test_leofs | 9       | 05236                  | 2019-12-02 06:56:49 +0000
leofs       | 1       | 9c2615f32e81e6a1caf5   | 2019-12-02 10:43:29 +0000

āĻāĻ•āϟāĻŋ āĻŦāĻžāϞāϤāĻŋ āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ

āĻāĻ•āϟāĻŋ āĻŦāĻžāϞāϤāĻŋ āϤ⧈āϰāĻŋ āĻ•āϰ⧇āϛ⧇āύ

leofs-adm add-bucket leofs 9c2615f32e81e6a1caf5
OK

āĻŦāĻžāϞāϤāĻŋ āϤāĻžāϞāĻŋāĻ•āĻž:

 leofs-adm get-buckets
cluster id   | bucket   | owner  | permissions      | created at                
-------------+----------+--------+------------------+---------------------------
leofs_1      | leofs    | leofs  | Me(full_control) | 2019-12-02 10:44:02 +0000

s3cmd āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

āĻ•ā§āώ⧇āĻ¤ā§āϰ⧇ HTTP Proxy server name āϗ⧇āϟāĻ“āϝāĻŧ⧇ āϏāĻžāĻ°ā§āĻ­āĻžāϰ āφāχāĻĒāĻŋ āύāĻŋāĻ°ā§āĻĻāĻŋāĻˇā§āϟ āĻ•āϰ⧁āύ

s3cmd --configure 

Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key [9c2615f32e81e6a1caf5]: 
Secret Key [8aaaa35c1ad78a2cbfa1a6cd49ba8aaeb3ba39eb]: 
Default Region [US]: 

Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3.
S3 Endpoint [s3.amazonaws.com]: 

Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used
if the target S3 system supports dns based buckets.
DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]: leofs

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: 
Path to GPG program [/usr/bin/gpg]: 

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP, and can only be proxied with Python 2.7 or newer
Use HTTPS protocol [No]: 

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't connect to S3 directly
HTTP Proxy server name [172.26.9.180]: 
HTTP Proxy server port [8080]: 

New settings:
  Access Key: 9c2615f32e81e6a1caf5
  Secret Key: 8aaaa35c1ad78a2cbfa1a6cd49ba8aaeb3ba39eb
  Default Region: US
  S3 Endpoint: s3.amazonaws.com
  DNS-style bucket+hostname:port template for accessing a bucket: leofs
  Encryption password: 
  Path to GPG program: /usr/bin/gpg
  Use HTTPS protocol: False
  HTTP Proxy server name: 172.26.9.180
  HTTP Proxy server port: 8080

Test access with supplied credentials? [Y/n] Y
Please wait, attempting to list all buckets...
Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...
Not configured. Never mind.

Save settings? [y/N] y
Configuration saved to '/home/user/.s3cfg'

āφāĻĒāύāĻŋ āϝāĻĻāĻŋ āĻ¤ā§āϰ⧁āϟāĻŋāϟāĻŋ āĻĒāĻžāύ ERROR: S3 āĻ¤ā§āϰ⧁āϟāĻŋ: 403 (Access Denied): Access Denied:

s3cmd put test.py s3://leofs/
upload: 'test.py' -> 's3://leofs/test.py'  [1 of 1]
 382 of 382   100% in    0s     3.40 kB/s  done
ERROR: S3 error: 403 (AccessDenied): Access Denied

āϤāĻžāϰāĻĒāϰ āφāĻĒāύāĻžāϕ⧇ s3cmd āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ⧇ signature_v2 āϕ⧇ True-āĻ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤ āĻ āĻŦāĻŋāώāϝāĻŧ⧇ āĻŦāĻŋāĻ¸ā§āϤāĻžāϰāĻŋāϤ āϏāĻŽāĻ¸ā§āϝāĻž.

āĻ¸ā§āĻŦāĻžāĻ•ā§āώāϰ_v2 āϝāĻĻāĻŋ āĻŽāĻŋāĻĨā§āϝāĻž āĻšāϝāĻŧ, āϤāĻžāĻšāϞ⧇ āĻāχāϰāĻ•āĻŽ āĻāĻ•āϟāĻŋ āĻ¤ā§āϰ⧁āϟāĻŋ āĻšāĻŦ⧇:

WARNING: Retrying failed request: /?delimiter=%2F (getaddrinfo() argument 2 must be integer or string)
WARNING: Waiting 3 sec...
WARNING: Retrying failed request: /?delimiter=%2F (getaddrinfo() argument 2 must be integer or string)
WARNING: Waiting 6 sec...
ERROR: Test failed: Request failed for: /?delimiter=%2F

āϞ⧋āĻĄ āĻĒāϰ⧀āĻ•ā§āώāĻžāϰ

āĻāĻ•āϟāĻŋ 1GB āĻĢāĻžāχāϞ āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ

fallocate -l 1GB 1gb

Leofs āĻāϟāĻž āφāĻĒāϞ⧋āĻĄ

time s3cmd put 1gb s3://leofs/
real    0m19.099s
user    0m7.855s
sys 0m1.620s

ĐĄŅ‚Đ°Ņ‚Đ¸ŅŅ‚Đ¸Đēа

1 āύ⧋āĻĄā§‡āϰ āϜāĻ¨ā§āϝ leofs-adm du:

leofs-adm du S0@172.26.9.179
 active number of objects: 156
  total number of objects: 156
   active size of objects: 602954495
    total size of objects: 602954495
     ratio of active size: 100.0%
    last compaction start: ____-__-__ __:__:__
      last compaction end: ____-__-__ __:__:__

āφāĻŽāϰāĻž āĻĻ⧇āĻ–āϤ⧇ āĻĒāĻžāχ āϝ⧇ āωāĻĒāϏāĻ‚āĻšāĻžāϰāϟāĻŋ āϖ⧁āĻŦ āϤāĻĨā§āϝāĻĒā§‚āĻ°ā§āĻŖ āύāϝāĻŧāĨ¤

āϚāϞ⧁āύ āĻĻ⧇āĻ–āĻŋ āĻāχ āĻĢāĻžāχāϞāϟāĻŋ āϕ⧋āĻĨāĻžāϝāĻŧ āĻ…āĻŦāĻ¸ā§āĻĨāĻŋāϤāĨ¤
leofs-adm whereis leofs/1gb

leofs-adm whereis leofs/1gb
-------+----------------------+--------------------------------------+------------+--------------+----------------+----------------+----------------+----------------------------
 del?  |         node         |             ring address             |    size    |   checksum   |  has children  |  total chunks  |     clock      |             when            
-------+----------------------+--------------------------------------+------------+--------------+----------------+----------------+----------------+----------------------------
       | S0@172.26.9.181      | 657a9f3a3db822a7f1f5050925b26270     |    976563K |   a4634eea55 | true           |             64 | 598f2aa976a4f  | 2019-12-05 10:48:15 +0000
       | S0@172.26.9.182      | 657a9f3a3db822a7f1f5050925b26270     |    976563K |   a4634eea55 | true           |             64 | 598f2aa976a4f  | 2019-12-05 10:48:15 +0000

NFS āϏāĻ•ā§āϰāĻŋāϝāĻŧ āĻ•āϰ⧁āύ

āφāĻŽāϰāĻž āϞāĻŋāĻ“ āϗ⧇āϟāĻ“āϝāĻŧ⧇ 172.26.9.184 āϏāĻžāĻ°ā§āĻ­āĻžāϰ⧇ NFS āϏāĻ•ā§āϰāĻŋāϝāĻŧ āĻ•āϰāĻŋāĨ¤

āϏāĻžāĻ°ā§āĻ­āĻžāϰ āĻāĻŦāĻ‚ āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āĻŸā§‡ nfs-utils āχāύāĻ¸ā§āϟāϞ āĻ•āϰ⧁āύ

sudo yum install nfs-utils

āύāĻŋāĻ°ā§āĻĻ⧇āĻļāĻžāĻŦāϞ⧀ āĻ…āύ⧁āϏāĻžāϰ⧇, āφāĻŽāϰāĻž āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ⧇āĻļāύ āĻĢāĻžāχāϞāϟāĻŋ āϏāĻ‚āĻļā§‹āϧāύ āĻ•āϰāĻŦ /usr/local/leofs/current/leo_gateway/etc/leo_gateway.conf

protocol = nfs

āϏāĻžāĻ°ā§āĻ­āĻžāϰ⧇ 172.26.9.184 āϚāĻžāϞāĻžāύ rpcbind āĻāĻŦāĻ‚ leofs-gateway

sudo service rpcbind start
sudo service leofs-gateway restart

āϏāĻžāĻ°ā§āĻ­āĻžāϰ⧇ āϝ⧇āĻ–āĻžāύ⧇ leo_manager āϚāϞāϛ⧇, NFS-āĻāϰ āϜāĻ¨ā§āϝ āĻāĻ•āϟāĻŋ āĻŦāĻžāϞāϤāĻŋ āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ āĻāĻŦāĻ‚ NFS-āĻāϰ āϏāĻžāĻĨ⧇ āϏāĻ‚āϝ⧋āϗ⧇āϰ āϜāĻ¨ā§āϝ āĻāĻ•āϟāĻŋ āϕ⧀ āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ

leofs-adm add-bucket test 05236
leofs-adm gen-nfs-mnt-key test 05236 ip-Đ°Đ´Ņ€Đĩҁ-nfs-ĐēĐģиĐĩĐŊŅ‚Đ°

NFS āĻāϰ āϏāĻžāĻĨ⧇ āϏāĻ‚āϝ⧋āĻ— āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

sudo mkdir /mnt/leofs
## for Linux - "sudo mount -t nfs -o nolock <host>:/<bucket>/<token> <dir>"
sudo mount -t nfs -o nolock ip-Đ°Đ´Ņ€Đĩҁ-nfs-ҁĐĩŅ€Đ˛ĐĩŅ€Đ°-Ņ‚Đ°Đŧ-ĐŗĐ´Đĩ-҃-Đ˛Đ°Ņ-ŅƒŅŅ‚Đ°ĐŊОвĐģĐĩĐŊ-gateway:/bucket/access_key_id/ĐēĐģŅŽŅ‡-ĐŋĐžĐģŅƒŅ‡ĐĩĐŊĐŊŅ‹Đš-ĐžŅ‚-gen-nfs-mnt-key /mnt/leofs
sudo mount -t nfs -o nolock 172.26.9.184:/test/05236/bb5034f0c740148a346ed663ca0cf5157efb439f /mnt/leofs

NFS āĻ•ā§āϞāĻžāϝāĻŧ⧇āĻ¨ā§āĻŸā§‡āϰ āĻŽāĻžāĻ§ā§āϝāĻŽā§‡ āĻĄāĻŋāĻ¸ā§āϕ⧇āϰ āĻ¸ā§āĻĨāĻžāύ āĻĻ⧇āϖ⧁āύ

āĻĄāĻŋāĻ¸ā§āĻ• āĻ¸ā§āĻĒ⧇āϏ, āĻĒā§āϰāϤāĻŋāϟāĻŋ āĻ¸ā§āĻŸā§‹āϰ⧇āϜ āύ⧋āĻĄā§‡ āĻāĻ•āϟāĻŋ 40GB āĻĄāĻŋāĻ¸ā§āĻ• (3 āϚāϞāĻŽāĻžāύ āύ⧋āĻĄ, 1 āϏāĻ‚āϝ⧁āĻ•ā§āϤ āύ⧋āĻĄ) āϰāϝāĻŧ⧇āϛ⧇ āϤāĻž āĻŦāĻŋāĻŦ⧇āϚāύāĻžāϝāĻŧ āύāĻŋāϝāĻŧ⧇:

df -hP
Filesystem                                                         Size  Used Avail Use% Mounted on
172.26.9.184:/test/05236/e7298032e78749149dd83a1e366afb328811c95b   60G  3.6G   57G   6% /mnt/leofs

6āϟāĻŋ āĻ¸ā§āĻŸā§‹āϰ⧇āϜ āύ⧋āĻĄ āϏāĻš LeoFS āĻāϰ āχāύāĻ¸ā§āϟāϞ⧇āĻļāύāĨ¤

āχāύāϭ⧇āĻ¨ā§āϟāϰāĻŋ (āĻŦāĻŋāĻ˛ā§āĻĄāĻžāϰ āĻ›āĻžāĻĄāĻŧāĻž):

# Please check roles/common/vars/leofs_releases for available versions
[all:vars]
leofs_version=1.4.3
build_temp_path="/tmp/leofs_builder"
build_install_path="/tmp/"
build_branch="master"
source="package"

# nodename of leo_manager_0 and leo_manager_1 are set at group_vars/all
[leo_manager_0]
172.26.9.177

# nodename of leo_manager_0 and leo_manager_1 are set at group_vars/all
[leo_manager_1]
172.26.9.176

[leo_storage]
172.26.9.178 leofs_module_nodename=S0@172.26.9.178
172.26.9.179 leofs_module_nodename=S0@172.26.9.179
172.26.9.181 leofs_module_nodename=S0@172.26.9.181
172.26.9.182 leofs_module_nodename=S0@172.26.9.182
172.26.9.183 leofs_module_nodename=S0@172.26.9.183
172.26.9.185 leofs_module_nodename=S0@172.26.9.185

[leo_gateway]
172.26.9.180 leofs_module_nodename=G0@172.26.9.180
172.26.9.184 leofs_module_nodename=G0@172.26.9.184

[leofs_nodes:children]
leo_manager_0
leo_manager_1
leo_gateway
leo_storage

āφāωāϟāĻĒ⧁āϟ leofs-adm āĻ…āĻŦāĻ¸ā§āĻĨāĻž

āφāωāϟāĻĒ⧁āϟ leofs-adm āĻ…āĻŦāĻ¸ā§āĻĨāĻž

 [System Confiuration]
-----------------------------------+----------
 Item                              | Value    
-----------------------------------+----------
 Basic/Consistency level
-----------------------------------+----------
                    system version | 1.4.3
                        cluster Id | leofs_1
                             DC Id | dc_1
                    Total replicas | 2
          number of successes of R | 1
          number of successes of W | 1
          number of successes of D | 1
 number of rack-awareness replicas | 0
                         ring size | 2^128
-----------------------------------+----------
 Multi DC replication settings
-----------------------------------+----------
 [mdcr] max number of joinable DCs | 2
 [mdcr] total replicas per a DC    | 1
 [mdcr] number of successes of R   | 1
 [mdcr] number of successes of W   | 1
 [mdcr] number of successes of D   | 1
-----------------------------------+----------
 Manager RING hash
-----------------------------------+----------
                 current ring-hash | d8ff465e
                previous ring-hash | d8ff465e
-----------------------------------+----------

 [State of Node(s)]
-------+----------------------+--------------+---------+----------------+----------------+----------------------------
 type  |         node         |    state     | rack id |  current ring  |   prev ring    |          updated at         
-------+----------------------+--------------+---------+----------------+----------------+----------------------------
  S    | S0@172.26.9.178      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:29 +0000
  S    | S0@172.26.9.179      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:29 +0000
  S    | S0@172.26.9.181      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:30 +0000
  S    | S0@172.26.9.182      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:29 +0000
  S    | S0@172.26.9.183      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:29 +0000
  S    | S0@172.26.9.185      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:29 +0000
  G    | G0@172.26.9.180      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:31 +0000
  G    | G0@172.26.9.184      | running      |         | d8ff465e       | d8ff465e       | 2019-12-06 05:18:31 +0000
-------+----------------------+--------------+---------+----------------+----------------+----------------------------

āĻĄāĻŋāĻ¸ā§āĻ• āĻ¸ā§āĻĒ⧇āϏ, āĻĒā§āϰāϤāĻŋāϟāĻŋ āĻ¸ā§āĻŸā§‹āϰ⧇āϜ āύ⧋āĻĄā§‡āϰ āĻāĻ•āϟāĻŋ 40GB āĻĄāĻŋāĻ¸ā§āĻ• (6āϟāĻŋ āϚāϞāĻŽāĻžāύ āύ⧋āĻĄ) āϰāϝāĻŧ⧇āϛ⧇ āϤāĻž āĻŦāĻŋāĻŦ⧇āϚāύāĻž āĻ•āϰ⧇:

df -hP
Filesystem                                                         Size  Used Avail Use% Mounted on
172.26.9.184:/test/05236/e7298032e78749149dd83a1e366afb328811c95b  120G  3.6G  117G   3% /mnt/leofs

āϝāĻĻāĻŋ 5āϟāĻŋ āĻ¸ā§āĻŸā§‹āϰ⧇āϜ āύ⧋āĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻž āĻšāϝāĻŧ

[leo_storage]
172.26.9.178 leofs_module_nodename=S0@172.26.9.178
172.26.9.179 leofs_module_nodename=S1@172.26.9.179
172.26.9.181 leofs_module_nodename=S2@172.26.9.181
172.26.9.182 leofs_module_nodename=S3@172.26.9.182
172.26.9.183 leofs_module_nodename=S4@172.26.9.183

df -hP
172.26.9.184:/test/05236/e7298032e78749149dd83a1e366afb328811c95b  100G  3.0G   97G   3% /mnt/leofs

āϞāĻ—

āϞāĻ— āĻĄāĻŋāϰ⧇āĻ•ā§āϟāϰāĻŋāϤ⧇ āĻ…āĻŦāĻ¸ā§āĻĨāĻŋāϤ /usr/local/leofs/current/*/log

āĻŸā§‡āϞāĻŋāĻ—ā§āϰāĻžāĻŽ āĻšā§āϝāĻžāύ⧇āϞ: āĻāϏāĻĄāĻŋāĻāϏ āĻāĻŦāĻ‚ āĻ•ā§āϞāĻžāĻ¸ā§āϟāĻžāϰ āĻāĻĢāĻāϏ

āωāĻ¤ā§āϏ: www.habr.com

DDoS āϏ⧁āϰāĻ•ā§āώāĻž, VPS VDS āϏāĻžāĻ°ā§āĻ­āĻžāϰ āϏāĻš āϏāĻžāχāϟāϗ⧁āϞāĻŋāϰ āϜāĻ¨ā§āϝ āύāĻŋāĻ°ā§āĻ­āϰāϝ⧋āĻ—ā§āϝ āĻšā§‹āĻ¸ā§āϟāĻŋāĻ‚ āĻ•āĻŋāύ⧁āύ đŸ”Ĩ DDoS āϏ⧁āϰāĻ•ā§āώāĻž āϏāĻš āύāĻŋāĻ°ā§āĻ­āϰāϝ⧋āĻ—ā§āϝ āĻ“āϝāĻŧ⧇āĻŦāϏāĻžāχāϟ āĻšā§‹āĻ¸ā§āϟāĻŋāĻ‚ āĻ•āĻŋāύ⧁āύ, VPS VDS āϏāĻžāĻ°ā§āĻ­āĻžāϰ | ProHoster