Pupuri rpm ngawari ma te whakamahi Inotify me te webdav

I roto i tenei pou ka titiro tatou ki te rokiroki taonga rpm ma te whakamahi i te tuhinga ngawari me te innotify + createrepo. Ko te tukunga o nga taonga ka mahia ma te webdav ma te whakamahi i te apache httpd. He aha te Apache httpd ka tuhia ki te mutunga o te pou.

Na, me tutuki te otinga ki nga whakaritenga e whai ake nei mo te whakarite rokiroki RPM anake:

  • Kore utu

  • Te waatea o te kete i roto i te putunga i etahi hēkona i muri i te tukunga ki te putunga taonga.

  • He ngawari ki te whakauru me te pupuri

  • Te kaha ki te whai waahi nui

    He aha te kore SonaType Nexus ranei Pulp:

  • Rokiroki i roto SonaType Nexus ranei Pulp he maha nga momo taonga e arai ana ki tera SonaType Nexus ranei Pulp ka waiho hei waahi kotahi o te kore.

  • Te waatea nui i roto SonaType Nexus ka utua.

  • Pulp Ko te ahua ki ahau he otinga tino uaua.

  • Taonga i roto SonaType Nexus kei te rongoa i roto i te pupuhi. Mena ka mate ohorere te hiko, kare e taea e koe te whakahoki mai i te pupuhi mena karekau he taapiri. I hapa matou: ERROR [ForkJoinPool.commonPool-worker-2] *SYSTEM [com.orientechnologies.orient.core.storage](http://com.orientechnologies.orient.core.storage/).fs.OFileClassic - $ANSI{green {db=security}} Error during data read for file 'privilege_5.pcl' 1-th attempt [java.io](http://java.io/).IOException: Bad address. Kore rawa a Blob i whakahokia mai.

Waehere puna

→ Kei te waahi te waehere puna konei

Ko te ahua o te tuhinga matua penei:

#!/bin/bash

source /etc/inotify-createrepo.conf
LOGFILE=/var/log/inotify-createrepo.log

function monitoring() {
    inotifywait -e close_write,delete -msrq --exclude ".repodata|.olddata|repodata" "${REPO}" | while read events 
    do
      echo $events >> $LOGFILE
      touch /tmp/need_create
    done
}

function run_createrepo() {
  while true; do
    if [ -f /tmp/need_create ];
    then
      rm -f /tmp/need_create
      echo "start createrepo $(date --rfc-3339=seconds)"
      /usr/bin/createrepo --update "${REPO}"
      echo "finish createrepo $(date --rfc-3339=seconds)"
    fi
    sleep 1
  done
}

echo "Start filesystem monitoring: Directory is $REPO, monitor logfile is $LOGFILE"
monitoring >> $LOGFILE &
run_createrepo >> $LOGFILE &

tāutanga

Ka mahi noa a Inotify-createrepo i runga i te CentOS 7 teitei ake ranei. Kaore i taea te mahi i runga i te CentOS 6.

yum -y install yum-plugin-copr
yum copr enable antonpatsev/inotify-createrepo
yum -y install inotify-createrepo
systemctl start inotify-createrepo

Whirihoranga

Ma te taunoa, ka aro turuki te inotify-createrepo i te whaiaronga /var/www/repos/rpm-repo/.

Ka taea e koe te huri i tenei whaiaronga i roto i te konae /etc/inotify-createrepo.conf.

Whakamahia

I te taapiri i tetahi konae ki tetahi whaiaronga /var/www/repos/rpm-repo/ ka hanga e inotifywait te konae /tmp/need_create. Ko te mahi run_createrepo ka rere i roto i te kohanga mutunga kore me te aro turuki i te konae /tmp/need_create. Mena kei te noho te konae, ka rere createrepo --update.

Ka puta he urunga ki te konae:

/var/www/repos/rpm-repo/ CREATE nginx-1.16.1-1.el7.ngx.x86_64.rpm
start createrepo 2020-03-02 09:46:21+03:00
Spawning worker 0 with 1 pkgs
Spawning worker 1 with 0 pkgs
Spawning worker 2 with 0 pkgs
Spawning worker 3 with 0 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
finish createrepo 2020-03-02 09:46:22+03:00

Te kaha ki te whai waahi nui

Kia nui te waatea mai i te otinga o naianei, ki taku whakaaro ka taea e koe te whakamahi i nga kaitoro e 2, Keepalived mo HA me Lsyncd mo te tukutahi taonga. Lsyncd - he daemon e aro turuki ana i nga huringa i roto i te raarangi aa-rohe, ka whakahiato, a muri iho i etahi wa ka timata a rsync ki te tukutahi. Ko nga korero me te tatūnga ka whakaahuahia i roto i te panui "Te tukutahi tere o te piriona konae".

Paetukutuku

Ka taea e koe te tuku ake i nga konae ma nga huarahi maha: SSH, NFS, WebDav. Ko te WebDav te ahua he waahanga hou me te ngawari.

Mo WebDav ka whakamahia e matou a Apache httpd. He aha a Apache httpd i te 2020 kaore i te nginx?

Kei te pirangi au ki te whakamahi taputapu aunoa mo te hanga Nginx + modules (hei tauira, Webdav).

He kaupapa hei hanga Nginx + modules - Kaihanga Nginx. Mena ka whakamahi koe i te nginx + wevdav ki te tuku ake i nga konae, ka hiahia koe ki tetahi waahanga nginx-dav-ext-module. I te wa e ngana ana ki te hanga me te whakamahi Nginx me nginx-dav-ext-module Tuhinga o mua Kaihanga Nginx ka whiwhi tatou i te hapa I whakamahia e http_dav_module hei utu mo te nginx-dav-ext-module. I katia taua pepeke i te raumati nginx: [emerg] arataki dav_methods.

I hanga e ahau he tono Pull Tāpirihia te taki git_url mō te tāmau, te mea anō —me-{}_module и ki te kōwae == "http_dav_module" tāpiri --with. Engari kaore i whakaaetia.

Whirihora webdav.conf

DavLockDB /var/www/html/DavLock
<VirtualHost localhost:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog /var/log/httpd/error.log
    CustomLog /var/log/httpd/access.log combined

    Alias /rpm /var/www/repos/rpm-repo
    <Directory /var/www/repos/rpm-repo>
        DAV On
        Options Indexes FollowSymlinks SymLinksifOwnerMatch IncludesNOEXEC
        IndexOptions NameWidth=* DescriptionWidth=*
        AllowOverride none
        Require all granted
    </Directory>
</VirtualHost>

Ki taku whakaaro ka taea e koe te mahi i te toenga o te Apache httpd setup koe.

Nginx i mua i te Apache httpd

Kaore i rite ki a Apache, ka whakamahi a Nginx i tetahi tauira tukatuka tono e pa ana ki nga huihuinga, e hiahia ana kia kotahi te tukanga tūmau HTTP mo te maha o nga kaihoko. Ka taea e koe te whakamahi i te nginx me te whakaiti i te kawenga i runga i te tūmau.

Whirihora nginx-front.conf. Ki taku whakaaro ka taea e koe te mahi i te toenga o te tatūnga nginx koe.

upstream nginx_front {
    server localhost:80;
}

server {
    listen 443 ssl;
    server_name ваш-виртуальных-хост;
    access_log /var/log/nginx/nginx-front-access.log main;
    error_log /var/log/nginx/nginx-front.conf-error.log warn;

    location / {
        proxy_pass http://nginx_front;
    }
}

Tukuake kōnae mā WebDav

He tino ngawari te uta i te rpm.

curl -T ./nginx-1.16.1-1.el7.ngx.x86_64.rpm https://ваш-виртуальный-хост/rpm/

Source: will.com

Tāpiri i te kōrero