Hauv cov ntawv tshaj tawm no, peb yuav saib ntawm rpm artifact repository siv ib qho yooj yim inotify + createrepo tsab ntawv. Artifacts yog uploaded ntawm webdav siv apache httpd. Vim li cas apache httpd yuav raug sau mus rau qhov kawg ntawm tus ncej.
Yog li, cov kev daws teeb meem yuav tsum tau ua raws li cov cai hauv qab no rau kev npaj tsuas yog RPM cia:
-
Dawb
-
Muaj cov pob nyob rau hauv repository ob peb vib nas this tom qab uploading mus rau artifact repository.
-
Yooj yim rau nruab thiab tswj
-
Muaj peev xwm ua kom muaj siab
Vim li cas tsis
SonaType Nexus los yogPulp : -
Cia hauv
SonaType Nexus los yogPulp ntau hom artifacts coj mus rau qhov tseeb tiasSonaType Nexus los yogPulp ua ib qho kev ua tsis tiav. -
Muaj nyob hauv
SonaType Nexus yog them. -
Pulp Zoo li ib tug over-engineered tov rau kuv. -
Artifacts hauv
SonaType Nexus khaws cia hauv blob. Thaum muaj hluav taws xob tam sim ntawd, koj yuav tsis tuaj yeem rov kho lub blob yog tias koj tsis muaj qhov thaub qab. Peb muaj qhov yuam kev no: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
. Blob yeej tsis rov qab los.
Qhov chaws code
β Qhov chaws code nyob
Lub ntsiab lus zoo li no:
#!/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 &
chaw
inotify-createrepo tsuas yog ua haujlwm ntawm CentOS 7 lossis siab dua. Nws tsis tuaj yeem ua haujlwm ntawm CentOS 6.
yum -y install yum-plugin-copr
yum copr enable antonpatsev/inotify-createrepo
yum -y install inotify-createrepo
systemctl start inotify-createrepo
Kev teeb tsa
Los ntawm lub neej ntawd inotify-createrepo saib cov npe /var/www/repos/rpm-repo/
.
Koj tuaj yeem hloov daim ntawv teev npe no hauv cov ntaub ntawv /etc/inotify-createrepo.conf.
Siv
Thaum ntxiv tej ntaub ntawv rau ib tug directory /var/www/repos/rpm-repo/
inotifywait yuav tsim ib cov ntaub ntawv /tmp/need_create
. Run_createrepo muaj nuj nqi khiav hauv lub voj tsis kawg thiab saib xyuas cov ntaub ntawv /tmp/need_create
. Yog tias cov ntaub ntawv muaj, ces khiav createrepo --update
.
Ib qho kev nkag yuav tshwm sim hauv cov ntaub ntawv:
/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
Muaj peev xwm ua kom muaj siab
Txhawm rau kom muaj kev txaus siab tawm ntawm qhov kev daws teeb meem uas twb muaj lawm, kuv xav tias koj tuaj yeem siv 2 servers, Keepalived rau HA thiab Lsyncd rau artifact synchronization.
webdav
Muaj ntau txoj hauv kev los upload cov ntaub ntawv: SSH, NFS, WebDav. WebDav zoo li yog qhov kev xaiv niaj hnub thiab yooj yim.
Rau WebDav, peb yuav siv Apache httpd. Vim li cas Apache httpd hauv 2020 thiab tsis nginx?
Kuv xav siv cov cuab yeej siv tsis siv neeg los tsim Nginx + modules (piv txwv li, Webdav).
Muaj ib qhov project rau tsim Nginx + modules -
Kuv tau thov rub
config 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>
Kuv xav tias koj yuav ua tus so ntawm Apache httpd configuration koj tus kheej.
Nginx nyob rau hauv pem hauv ntej ntawm Apache httpd
Tsis zoo li Apache, Nginx siv qhov kev thov ua qauv raws li qhov kev thov, uas txhais tau hais tias tsuas yog ib qho HTTP server txheej txheem yuav tsum muaj rau txhua tus neeg siv khoom. Koj tuaj yeem siv nginx thiab txo cov server load.
nginx-front.conf config. Kuv xav tias koj yuav ua tus so ntawm nginx configuration koj tus kheej.
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;
}
}
Downloading cov ntaub ntawv ntawm WebDav
Downloading rpm yog ib qho yooj yim heev.
curl -T ./nginx-1.16.1-1.el7.ngx.x86_64.rpm https://Π²Π°Ρ-Π²ΠΈΡΡΡΠ°Π»ΡΠ½ΡΠΉ-Ρ
ΠΎΡΡ/rpm/
Tau qhov twg los: www.hab.com