Wahi a : - puʻunaue ʻia ka mālama ʻana i nā mea hewa , kūpono me nā mea kūʻai aku e hoʻohana ana i ka Amazon S3 API a me REST-API, a kākoʻo pū i ke ʻano kikowaena NFS. Aia nā optimizations no ka mālama ʻana i nā mea liʻiliʻi a me nā mea nui loa, aia kahi mīkini caching i kūkulu ʻia, a hiki ke hana hou i ka waiho ʻana ma waena o nā kikowaena data. ʻO nā pahuhopu o ka papahana ka loaʻa ʻana o 99.9999999% hilinaʻi ma o ka hoʻopiʻi hou ʻana o nā kope a me ka hoʻopau ʻana i hoʻokahi wahi o ka hāʻule. Ua kākau ʻia ke code papahana ma Erlang.
Aia ʻo LeoFS i ʻekolu mau ʻāpana:
- - lawelawe i nā hana o ka hoʻohui, hoʻihoʻi a holoi ʻana i nā mea a me nā metadata, ke kuleana no ka hana hou ʻana, hoʻihoʻi hou a me ka hoʻopaʻa ʻana i nā noi o nā mea kūʻai aku.
- - lawelawe i nā noi HTTP a hoʻihoʻi hou i nā pane i nā mea kūʻai aku me ka hoʻohana ʻana iā REST-API a i ʻole S3-API, e hōʻoia i ka hoʻopaʻa ʻana i ka ʻikepili i makemake nui ʻia i ka hoʻomanaʻo a ma ka disk.
- - nānā i ka hana o LeoFS Gateway a me LeoFS Storage nodes, nānā i ke kūlana o nā nodes a nānā i nā checksums. Hōʻoiaʻiʻo i ka paʻa o ka ʻikepili a me ka loaʻa ʻana o kahi mālama nui.
Ma kēia pou e hoʻokomo mākou i nā Leofs me ka hoʻohana ʻana i ka ansible-playbook a hoʻāʻo iā S3, NFS.
Inā ʻoe e hoʻāʻo e hoʻokomo iā LeoFS me ka hoʻohana ʻana i nā puke pāʻani mana, e hālāwai ʻoe i nā hewa like ʻole: ,. Ma kēia pou e kākau wau i nā mea e pono ai ke hana e pale aku i kēia mau hewa.
Ma kahi e holo ai ʻoe i ka ansible-playbook, pono ʻoe e hoʻokomo i ka netcat.
Laʻana waihona
No ka laʻana (ma ka waihona hosts.sample):
# 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_storageHoʻomākaukau kikowaena
Hoʻopau iā Selinux. Manaʻo wau e hana ke kaiāulu i nā kulekele Selinux no LeoFS.
- 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
Kāu Mau Koho Paʻamau netcat и redhat-lsb-core. netcat pono no leofs-adm, redhat-lsb-core pono e hoʻoholo i ka mana OS .
- name: Install Packages
yum: name={{ item }} state=present
with_items:
- nmap-ncat
- redhat-lsb-coreKe hana ʻana i nā leofs mea hoʻohana a hoʻohui iā ia i ka hui huila
- 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: yesKe hoʻokomo nei iā 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
Hiki ke loaʻa ka mana piha o ka puke pāʻani Ansible i hoʻoponopono ʻia ma aneʻi:
Hoʻokomo, hoʻonohonoho, hoʻomaka
A laila hana mākou e like me ka mea i kākau ʻia ma me ka ʻole o 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.ymlKe nānā nei i ke kūlana puʻupuʻu ma Primary LeoManager
leofs-adm statusHiki ke ʻike ʻia ke kula kiʻekiʻe a me ke kula kiʻekiʻe ma nā moʻolelo ansible-playbook


ʻO ka hopena e like me kēia
[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
-------+----------------------+--------------+---------+----------------+----------------+----------------------------Ke hana nei i mea hoʻohana
E hana i mea hoʻohana leof:
leofs-adm create-user leofs leofs
access-key-id: 9c2615f32e81e6a1caf5
secret-access-key: 8aaaa35c1ad78a2cbfa1a6cd49ba8aaeb3ba39ebPapa inoa o nā mea hoʻohana:
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 +0000Hana i Bākeke
Hana ʻia he bākeke
leofs-adm add-bucket leofs 9c2615f32e81e6a1caf5
OKPapa helu pākeke:
leofs-adm get-buckets
cluster id | bucket | owner | permissions | created at
-------------+----------+--------+------------------+---------------------------
leofs_1 | leofs | leofs | Me(full_control) | 2019-12-02 10:44:02 +0000Ke hoʻonohonoho nei i ka s3cmd
Ma kahua HTTP Proxy server name e kuhikuhi i ka IP server Gateway
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'Inā loaʻa iā ʻoe ka hewa ERROR: S3 hewa: 403 (AccessDenied): Hōʻole ʻia ke komo:
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 DeniedA laila pono ʻoe e hoʻololi i ka signature_v3 i ʻOiaʻiʻo i ka s2cmd config. Nā kikoʻī ma kēia .
Inā hewa ka signature_v2, a laila e loaʻa kahi hewa e like me kēia:
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=%2FHoʻāʻo hoʻouka
E hana i kahi faila 1GB
fallocate -l 1GB 1gbHoʻouka iā Leofs
time s3cmd put 1gb s3://leofs/
real 0m19.099s
user 0m7.855s
sys 0m1.620sLakeponahelu
leofs-adm du no 1 node:
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: ____-__-__ __:__:__ʻIke mākou ʻaʻole maopopo loa ka hopena.
E ʻike kākou i hea kēia faila.
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 +0000E ho'ā i ka NFS
Hoʻoikaika mākou i ka NFS ma ka Leo Gateway 172.26.9.184 kikowaena.
E hoʻouka i nā nfs-utils ma ke kikowaena a me ka mea kūʻai aku
sudo yum install nfs-utilsE like me nā kuhikuhi, e hoʻoponopono mākou i ka faila hoʻonohonoho /usr/local/leofs/current/leo_gateway/etc/leo_gateway.conf
protocol = nfsMa ka kikowaena 172.26.9.184 holo rpcbind a me leofs-gateway
sudo service rpcbind start
sudo service leofs-gateway restartMa ke kikowaena kahi e holo ai ʻo leo_manager, e hana i kahi bākeke no NFS a hana i kahi kī no ka hoʻopili ʻana iā NFS.
leofs-adm add-bucket test 05236
leofs-adm gen-nfs-mnt-key test 05236 ip-адрес-nfs-клиентаHoʻopili iā 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/leofsE nānā i ka hakahaka diski ma o ka mea kūʻai aku NFS
Wahi disk, me ka noʻonoʻo ʻana he 40GB disk i kēlā me kēia node waihona (3 node holo, 1 node pili):
df -hP
Filesystem Size Used Avail Use% Mounted on
172.26.9.184:/test/05236/e7298032e78749149dd83a1e366afb328811c95b 60G 3.6G 57G 6% /mnt/leofsHoʻokomo ʻia ʻo LeoFS me 6 mau nodes mālama.
Inventory (me ka mea kūkulu ʻole):
# 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_storageHoʻopuka leofs-adm kūlana
Hoʻopuka leofs-adm kūlana
[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
-------+----------------------+--------------+---------+----------------+----------------+----------------------------Wahi disk, me ka noʻonoʻo ʻana i kēlā me kēia node waihona he 40GB disk (6 mau node holo):
df -hP
Filesystem Size Used Avail Use% Mounted on
172.26.9.184:/test/05236/e7298032e78749149dd83a1e366afb328811c95b 120G 3.6G 117G 3% /mnt/leofsInā hoʻohana ʻia nā node mālama 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.183df -hP
172.26.9.184:/test/05236/e7298032e78749149dd83a1e366afb328811c95b 100G 3.0G 97G 3% /mnt/leofsNā lāʻau lāʻau
Aia nā moʻolelo ma nā papa kuhikuhi /usr/local/leofs/current/*/log
Kaila Telegram:
Source: www.habr.com
