主頁 > 作業系統 > CentOS8.2 配置部署Rsync+sersync和rsync+inotify檔案實時同步

CentOS8.2 配置部署Rsync+sersync和rsync+inotify檔案實時同步

2020-12-24 06:25:25 作業系統

目錄
  • CentOS8.2 配置rsync+sersync檔案實時同步
    • 第一步:Rsyncd 服務器(備份端)配置
    • 第二步:資料源端測驗rsync同步
    • 第三步:資料源端開始部署sersync服務
  • CentOS8.2 配置rsync+inotify檔案實時同步
    • 第一步:開始配置服務端
    • 第二步:開始配置客戶端
  • Rsync+inotify-tools與rsync+sersync架構的區別

CentOS8.2 配置rsync+sersync檔案實時同步

Rsyncd 服務器(備份端) 資料源端測驗rsync同步
主機名 rsyncserver.lianglab.cn sersyncserver.lianglab.cn
IP資訊 192.168.6.200 192.168.6.65

第一步:Rsyncd 服務器(備份端)配置

192.168.6.200----rsyncd Rsync服務器(備份端)
hostnamectl set-hostname rsyncserver.lianglab.cn
查看rsync是否安裝 
[root@centos8 ~]# rpm -qa | grep rsync
rsync-3.1.3-7.el8.x86_64
[root@centos8 ~]# 

【1】安裝rsync

[root@rsyncserver ~]# dnf -y install xinetd rsync
Last metadata expiration check: 1:22:21 ago on Mon 21 Dec 2020 09:09:48 PM CST.
Package rsync-3.1.3-7.el8.x86_64 is already installed.
Dependencies resolved.
====================================================================================================================
 Package                 Architecture            Version                           Repository                  Size
====================================================================================================================
Installing:
 xinetd                  x86_64                  2:2.3.15-24.el8                   AppStream                  135 k

Transaction Summary
====================================================================================================================
Install  1 Package

Total download size: 135 k
Installed size: 379 k
Downloading Packages:
xinetd-2.3.15-24.el8.x86_64.rpm                                                     7.5 MB/s | 135 kB     00:00    
--------------------------------------------------------------------------------------------------------------------
Total                                                                               6.9 MB/s | 135 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                            1/1 
  Installing       : xinetd-2:2.3.15-24.el8.x86_64                                                              1/1 
  Running scriptlet: xinetd-2:2.3.15-24.el8.x86_64                                                              1/1 
  Verifying        : xinetd-2:2.3.15-24.el8.x86_64                                                              1/1 
Installed products updated.

Installed:
  xinetd-2:2.3.15-24.el8.x86_64                                                                                     

Complete!
[root@rsyncserver ~]# 

[root@rsyncserver ~]# rsync --daemon
[root@rsyncserver ~]# netstat -antup | grep 873
tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN      51170/rsync         
tcp6       0      0 :::873                  :::*                    LISTEN      51170/rsync         
[root@rsyncserver ~]# 

【2】創建rsync組態檔

[root@rsyncserver ~]# cat /etc/rsyncd.conf 

#Rsync server
uid = root                         #運行行程的身份
gid = root                         #運行行程的組
use chroot = yes                   #是否鎖定家目錄
max connections = 100              #最大連接數
timeout = 600                      #超時時間
log file = /var/log/rsyncd.log     #日志檔案
ignore errors                      #忽略錯誤
read only = false                  #設定服務端檔案讀寫權限
list = false                       #不顯示服務端資源串列
hosts allow = 192.168.6.0/24       #*代表所有
hosts deny = 0.0.0.0/32
auth users = backup
secrets file = /etc/rsync.password

[data]
comment = data
path = /data/www


【3】啟動rsync和xinetd服務

[root@rsyncserver ~]# systemctl start xinetd 
[root@rsyncserver ~]# systemctl enable xinetd
[root@rsyncserver ~]# rsync --daemon --config=/etc/rsyncd.conf
[root@rsyncserver ~]# netstat -antup | grep 873
tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN      51170/rsync         
tcp6       0      0 :::873                  :::*                    LISTEN      51170/rsync         
[root@rsyncserver ~]# ps aux | grep rsync
root       51170  0.0  0.0  11508   192 ?        Ss   22:32   0:00 rsync --daemon
root       51322  0.0  0.0  12108  1048 pts/1    S+   22:34   0:00 grep --color=auto rsync
[root@rsyncserver ~]# 

【4】配置rsync開機自啟動

方法一:
echo "rsync --daemon --config=/etc/rsyncd.conf"  >> /etc/rc.d/rc.local

方法二:

【5】創建同步目錄

[root@rsyncserver ~]# mkdir -p /data/www

【6】創建密碼檔案

[root@rsyncserver ~]# vi  /etc/rsync.password
[root@rsyncserver ~]# 
[root@rsyncserver ~]# cat /etc/rsync.password
backup:lianglab123
[root@rsyncserver ~]# chmod 600 /etc/rsync.password

第二步:資料源端測驗rsync同步

【1】新建一個檔案保存好密碼,然后在rsync命令中使用–password-file指定此檔案即可

[root@sersyncserver ~]# hostnamectl set-hostname sersyncserver.lianglab.cn

[root@sersyncserver ~]# echo "lianglab123" > /etc/rsync.password

[root@sersyncserver ~]# chmod 600 /etc/rsync.password 

【2】創建測驗檔案

[root@sersyncserver ~]# mkdir -p /data/www
[root@sersyncserver ~]# cp /etc/passwd /data/www/
[root@sersyncserver www]# md5sum /data/www/passwd 
b42f457347877832fc6da97e6cc3481e  /data/www/passwd
[root@sersyncserver ~]# rsync -avzP  /data/www/ [email protected]::data  --password-file=/etc/rsync.password
sending incremental file list
./

sent 74 bytes  received 27 bytes  67.33 bytes/sec
total size is 2,923  speedup is 28.94
[root@sersyncserver ~]# 

【3】登陸到rsyncserver 查看檔案是否同步

[root@rsyncserver www]# cd /data/www/
[root@rsyncserver www]# ls
passwd
[root@rsyncserver www]# pwd
/data/www
[root@rsyncserver www]# md5sum passwd 
b42f457347877832fc6da97e6cc3481e  passwd
[root@rsyncserver www]# 

第三步:資料源端開始部署sersync服務

[1] 在google code下載sersync軟體包,里面有組態檔與可執行檔案
wget https://sersync.googlecode.com/files/sersync2.5.4_64bit_binary_stable_final.tar.gz

[root@sersyncserver tmp]# wget https://sersync.googlecode.com/files/sersync2.5.4_64bit_binary_stable_final.tar.gz
[root@sersyncserver tmp]# tar xvf sersync2.5.4_64bit_binary_stable_final.tar.gz
GNU-Linux-x86/
GNU-Linux-x86/sersync2
GNU-Linux-x86/confxml.xml
[root@sersyncserver tmp]# mv GNU-Linux-x86 sersync
[root@sersyncserver tmp]# mv /tmp/sersync /opt
[root@sersyncserver opt]# tree /opt/sersync/
/opt/sersync/
├── confxml.xml  #sersync軟體組態檔
├── confxml.xml.2020-12-21
└── sersync2    #sersync軟體命令

0 directories, 3 files
[root@sersyncserver opt]# 

[2] 配置sersync

[root@sersyncserver opt]# cp sersync/confxml.xml sersync/confxml.xml.$(date +%F)
[root@sersyncserver opt]# cd sersync/
[root@sersyncserver sersync]# ls
confxml.xml  confxml.xml.2020-12-21  sersync2
[root@sersyncserver sersync]# 

[3]修改sersync組態檔24-28行

修改前的內容   
    23	    <sersync>
    24		<localpath watch="/opt/tongbu">
    25		    <remote ip="127.0.0.1" name="tongbu1"/>
    26		    <!--<remote ip="192.168.8.39" name="tongbu"/>-->
    27		    <!--<remote ip="192.168.8.40" name="tongbu"/>-->
    28		</localpath>
    29		<rsync>
    30		    <commonParams params="-artuz"/>
    31		    <auth start="false" users="root" passwordfile="/etc/rsync.pas"/>
    32		    <userDefinedPort start="false" port="874"/><!-- port=874 -->
    33		    <timeout start="false" time="100"/><!-- timeout=100 -->
    34		    <ssh start="false"/>

[4].修改31–34行,認證部分【rsync密碼認證】

修改后的內容
    23	    <sersync>
    24		<localpath watch="/data/www">                           #本地同步目錄
    25		    <remote ip="192.168.6.200" name="data"/>            #指定備份服務器模塊資訊
    26		    <!--<remote ip="192.168.8.39" name="tongbu"/>-->
    27		    <!--<remote ip="192.168.8.40" name="tongbu"/>-->
    28		</localpath>
    29		<rsync>
    30		    <commonParams params="-artuz"/>
    31		    <auth start="true" users="backup" passwordfile="/etc/rsync.password"/>    #開啟用戶認證,并定義認證用戶和認證密碼檔案
    32		    <userDefinedPort start="false" port="874"/><!-- port=874 --> #備份服務器的埠
    33		    <timeout start="false" time="100"/><!-- timeout=100 -->  #定義超時時間
    34		    <ssh start="false"/>
    35		</rsync>

[5].開啟sersync守護行程同步資料

[root@sersyncserver sersync]# /opt/sersync/sersync2 -d -r -o /opt/sersync/confxml.xml
set the system param
execute:echo 50000000 > /proc/sys/fs/inotify/max_user_watches
execute:echo 327679 > /proc/sys/fs/inotify/max_queued_events
parse the command param
option: -d 	run as a daemon
option: -r 	rsync all the local files to the remote servers before the sersync work
option: -o 	config xml name:  /opt/sersync/confxml.xml
daemon thread num: 10
parse xml config file
host ip : localhost	host port: 8008
daemon start,sersync run behind the console 
use rsync password-file :
user is	backup
passwordfile is 	/etc/rsync.password
config xml parse success
please set /etc/rsyncd.conf max connections=0 Manually
sersync working thread 12  = 1(primary thread) + 1(fail retry thread) + 10(daemon sub threads) 
Max threads numbers is: 22 = 12(Thread pool nums) + 10(Sub threads)
please according your cpu ,use -n param to adjust the cpu rate
------------------------------------------
rsync the directory recursivly to the remote servers once
working please wait...
execute command: cd /data/www && rsync -artuz -R --delete ./ [email protected]::data --password-file=/etc/rsync.password >/dev/null 2>&1 
run the sersync: 
watch path is: /data/www
[root@sersyncserver sersync]# 


CentOS8.2 配置rsync+inotify檔案實時同步


CentOS8.2 配置rsync+inotify實作檔案實時同步需求描述:線上有一套財務系統在服務器A,已經完成前期的開發,
服務器B用于推送管理層報表到管理層釘釘群,目前沒有做到自動化,每次報表生產后(圖片格式)服務器A,
每次需要管理員登錄的服務器A把檔案傳送動服務器B指定目錄,服務器B才能推送管理層報表到管理層釘釘群

環境:

192.168.6.198 服務端(用于備份資料,資料提供給領導查看)
192.168.6.199 客戶端(產生新的檔案,新檔案同步到服務端)

Rsyncd 服務器 客戶端
主機名 nginx01.lianglab.cn nginx02.lianglab.cn
IP資訊 192.168.6.198 192.168.6.199

1、安裝以下安裝包lrzsz是xshell上傳下載的安裝包,如果通過ftp上傳軟體到機器可以忽略,

dnf install -y lrzsz gcc wget gcc-c++ vim

2、關閉firewall防火墻,開機禁止啟動,線上機器默認關閉,不需要配置,

第一步:開始配置服務端


【1】安裝rsync

dnf install -y rsync

【2】更改組態檔
vim /etc/rsyncd.conf

# /etc/rsyncd: configuration file for rsync daemon mode
#作業中指定用戶(可以不指定為0)
uid = 0
gid = 0
#相當于黑洞.出錯定位
use chroot = no
##有多少個客戶端同時傳檔案
max connections =200
##超時時間
timeout = 300
##行程號檔案
pid ifle = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
##日志檔案
log file = /var/log/rsyncd.log
##模塊開始(這個模塊就是待會兒對端寫腳本的里面一個引數的名稱)
[msone]
##需要同步的目錄(準確的說是同步過來后放到哪里的目錄路徑)
path = /data/www
##表示出現錯誤忽略錯誤
ignore errors
##表示網路權限可寫(本地控制真正可寫)(親測這里寫false報錯)
read only = no
##這里設定IP或讓不讓同步
list = false
#允許的ip或者ip段
hosts allow = 192.168.6.199
##拒絕,以下表示都不拒絕
#hosts deny = 0.0.0.0/32
##認證用戶
auth users = rsyncli
##用戶名和密碼存放檔案
secrets file = /etc/rsync.secrets

【3】創建領導要查看檔案目錄,需要www這個目錄其它用戶可以寫的權限

mkdir -p /data/www(這個是測驗目錄,你的系統上面應該已經有這個目錄了,根據你生產需要修改這個目錄)
chmod 765 /data/www

【4】添加同步需要用的用戶名和密碼

#useradd -s /sbin/nologin rsyncli
#passwd rsyncli
密碼設定liang123

【5】創建認證檔案

vi /etc/rsync.secrets
檔案里面添加如下內容(格式為用戶名:密碼):
rsyncli:liang123

【6】為了安全起見給這個檔案設定600權限,

[root@nginx01 ~]# ll /etc/rsync.secrets
-rw-r--r--. 1 root root 17 Aug 10 11:54 /etc/rsync.secrets
[root@nginx01 ~]# chmod 600 /etc/rsync.secrets
[root@nginx01 ~]# ll /etc/rsync.secrets
-rw-------. 1 root root 17 Aug 10 11:54 /etc/rsync.secrets
[root@nginx01 ~]#

【7】啟動服務

[root@nginx01 ~]# systemctl start rsyncd

[root@nginx01 ~]# netstat -anplt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 13127/rsync
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 876/sshd
tcp 0 0 192.168.6.198:29550 192.168.6.199:9100 ESTABLISHED 29780/./prometheus
tcp 0 48 192.168.6.198:22 10.57.237.13:53860 ESTABLISHED 12322/sshd: tdops [
tcp 0 0 192.168.6.198:22 10.57.237.13:53862 ESTABLISHED 12326/sshd: tdops [
tcp 0 0 127.0.0.1:57758 127.0.0.1:9090 ESTABLISHED 29780/./prometheus
tcp6 0 0 :::9090 :::* LISTEN 29780/./prometheus
tcp6 0 0 :::873 :::* LISTEN 13127/rsync
tcp6 0 0 :::22 :::* LISTEN 876/sshd
tcp6 0 0 ::1:9090 ::1:4852 ESTABLISHED 29780/./prometheus
tcp6 0 0 127.0.0.1:9090 127.0.0.1:57758 ESTABLISHED 29780/./prometheus
tcp6 0 0 ::1:4852 ::1:9090 ESTABLISHED 29780/./prometheus
[root@nginx01 ~]# systemctl status rsyncd
● rsyncd.service - fast remote file copy program daemon
Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2020-08-10 11:56:00 CST; 20s ago
Main PID: 13127 (rsync)
CGroup: /system.slice/rsyncd.service
└─13127 /usr/bin/rsync --daemon --no-detach

Aug 10 11:56:00 nginx01 systemd[1]: Started fast remote file copy program daemon.
Aug 10 11:56:00 nginx01 rsyncd[13127]: Unknown Parameter encountered: "pid ifle"
Aug 10 11:56:00 nginx01 rsyncd[13127]: IGNORING unknown parameter "pid ifle"
Aug 10 11:56:00 nginx01 rsyncd[13127]: rsyncd version 3.1.2 starting, listening on port 873
[root@nginx01 ~]#

第二步:開始配置客戶端


【1】查看當前系統是否支持inotify

[root@nginx02 tdops]# ll /proc/sys/fs/inotify/
total 0
-rw-r--r--. 1 root root 0 Aug 10 13:42 max_queued_events
-rw-r--r--. 1 root root 0 Aug 10 13:42 max_user_instances
-rw-r--r--. 1 root root 0 Aug 10 13:42 max_user_watches
[root@nginx02 tdops]#

【2】安裝rsync和inotify(rsync只安裝不啟動不配置)

[root@nginx02 tdops]# dnf install -y rsync

【3】inotify是一種強大的、細粒度的、異步的檔案系統事件控制機制,
linux內核從2.6.13起,加入了inotify支持,通過inotify可以監控檔案系統中添加、洗掉、修改、移動等各種事件,
利用這個內核介面,第三方軟體就可以監控檔案系統下檔案的各種變化情況,而inotify-tools正是實施監控的軟體,

wget http://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz
tar zxf inotify-tools-3.14.tar.gz
cd inotify-tools-3.14
./configure --prefix=/usr/local/include/
make && make install

【4】最重要的是要寫這個腳本,讓它自動去檢測我們制定的目錄下檔案發生的變化,
然后再執行rsync的命令把它同步到我們的服務器端去,

touch inotify.sh
chmod 755 inotify.sh
vi inotify.sh

#!/bin/bash
#chkconfig: 345 88 14
host=192.168.6.198 #server的ip(備份服務器)
src=https://www.cnblogs.com/data/www/ #所要監控的備份目錄(此處可以自定義,但是要保證存在)
des=msone #自定義的模塊名,需要與client端定義的一致
password=/etc/rsync.password #密碼檔案
user=rsyncli #用戶名(一個實際存在的賬號)
inotify=/usr/local/include/ #inotify的安裝目錄

${inotify}/bin/inotifywait -mrq --timefmt'%d/%m/%y %H:%M' --format '%T %w%f%e' -e modify,delete,create,attrib $src \
| while read files
do
rsync -avzP --delete --timeout=100 --password-file=${password} $src $user@$host::$des
echo "${files} was rsynced" >>/var/log/rsync.log 2>&1
done

【5】創建/etc/rsync.password檔案(整個檔案需要600的權限和服務端rsync同步用戶的密碼,這里是服務器端rsyncli用戶的密碼)

vi /etc/rsync.password
liang123
chmod 600 /etc/rsync.password

【6】設定內核引數提高資料同步性能,

[root@nginx02 opt]# sysctl -w fs.inotify.max_queued_events="200000000"
fs.inotify.max_queued_events = 200000000
[root@nginx02 opt]# sysctl -w fs.inotify.max_user_watches="2000000000"
fs.inotify.max_user_watches = 2000000000
[root@nginx02 opt]# sysctl -w fs.inotify.max_user_instances="65535"
fs.inotify.max_user_instances = 65535

【7】啟動服務腳本

chmod +x /opt/inotify.sh
[root@nginx02 opt]# nohup /opt/inotify.sh &> /dev/null & #放到后臺執行
[1] 16011
[1]+ Done nohup /opt/inotify.sh &>/dev/null
[root@nginx02 opt]#


Rsync+inotify-tools與rsync+sersync架構的區別


1、rsync+inotify-tools
a、inotify只能記錄下被監聽的目錄發生了變化(增,刪,改)并沒有把具體是哪個檔案或者哪個目錄發生了變化記錄下來;
b、rsync在同步的時候,并不知道具體是哪個檔案或目錄發生了變化,每次都是對整個目錄進行同步,當資料量很大時,整個目錄同步非常耗時(rsync要對整個目錄遍歷查找對比檔案),因此效率很低

2、rsync+sersync
a、sersync可以記錄被監聽目錄中發生變化的(增,刪,改)具體某個檔案或目錄的名字;
b、rsync在同步時,只同步發生變化的檔案或目錄(每次發生變化的資料相對整個同步目錄資料來說很小,rsync在遍歷查找對比檔案時,速度很快),因此效率很高,

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/239380.html

標籤:其他

上一篇:Linux 檔案特殊權限

下一篇:容器編排系統K8s之Volume的基礎使用

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • CA和證書

    1、在 CentOS7 中使用 gpg 創建 RSA 非對稱密鑰對 gpg --gen-key #Centos上生成公鑰/密鑰對(存放在家目錄.gnupg/) 2、將 CentOS7 匯出的公鑰,拷貝到 CentOS8 中,在 CentOS8 中使用 CentOS7 的公鑰加密一個檔案 gpg -a ......

    uj5u.com 2020-09-10 00:09:53 more
  • Kubernetes K8S之資源控制器Job和CronJob詳解

    Kubernetes的資源控制器Job和CronJob詳解與示例 ......

    uj5u.com 2020-09-10 00:10:45 more
  • VMware下安裝CentOS

    VMware下安裝CentOS 一、軟硬體準備 1 Centos鏡像準備 1.1 CentOS鏡像下載地址 下載地址 1.2 CentOS鏡像下載程序 點擊下載地址進入如下圖的網站,選擇需要下載的版本,這里選擇的是Centos8,點擊如圖所示。 決定選擇Centos8后,選擇想要的鏡像源進行下載,此 ......

    uj5u.com 2020-09-10 00:12:10 more
  • 如何使用Grep命令查找多個字串

    如何使用Grep 命令查找多個字串 大家好,我是良許! 今天向大家介紹一個非常有用的技巧,那就是使用 grep 命令查找多個字串。 簡單介紹一下,grep 命令可以理解為是一個功能強大的命令列工具,可以用它在一個或多個輸入檔案中搜索與正則運算式相匹配的文本,然后再將每個匹配的文本用標準輸出的格式 ......

    uj5u.com 2020-09-10 00:12:28 more
  • git配置http代理

    git配置http代理 經常遇到克隆 github 慢的問題,這里記錄一下幾種配置 git 代理的方法,解決 clone github 過慢。 目錄 git配置代理 git單獨配置github代理 git配置全域代理 配置終端環境變數 git配置代理 主要使用 git config 命令 git單獨 ......

    uj5u.com 2020-09-10 00:12:33 more
  • Linux npm install 裝包時提示Error EACCES permission denied解

    npm install 裝包時提示Error EACCES permission denied解決辦法 ......

    uj5u.com 2020-09-10 00:12:53 more
  • Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包

    Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包。 18 (flaskApi) [root@67 flaskDemo]# yum -y install nginx 19 已加載插件:fastestmirror, langpacks 20 Loading ......

    uj5u.com 2020-09-10 00:13:13 more
  • Linux查看服務器暴力破解ssh IP

    在公網的服務器上經常遇到別人爆破你服務器的22埠,用來挖礦或者干其他嘿嘿嘿的事情~ 這種情況下正確的做法是: 修改默認ssh的22埠 使用設定密鑰登錄或者白名單ip登錄 建議服務器密碼為復雜密碼 創建普通用戶登錄服務器(root權限過大) 建立堡壘機,實作統一管理服務器 統計爆破IP [root ......

    uj5u.com 2020-09-10 00:13:17 more
  • CentOS 7系統常見快捷鍵操作方式

    Linux系統中一些常見的快捷方式,可有效提高操作效率,在某些時刻也能避免操作失誤帶來的問題。 ......

    uj5u.com 2020-09-10 00:13:31 more
  • CentOS 7作業系統目錄結構介紹

    作業系統存在著大量的資料檔案資訊,相應檔案資訊會存在于系統相應目錄中,為了更好的管理資料資訊,會將系統進行一些目錄規劃,不同目錄存放不同的資源。 ......

    uj5u.com 2020-09-10 00:13:35 more
最新发布
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:43:21 more
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:42:36 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:26:53 more
  • 設定Windows主機的瀏覽器為wls2的默認瀏覽器

    這里以Chrome為例。 1. 準備作業 wsl是可以使用Windows主機上安裝的exe程式,出于安全考慮,默認情況下改功能是無法使用。要使用的話,終端需要以管理員權限啟動。 我這里以Windows Terminal為例,介紹如何默認使用管理員權限打開終端,具體操作如下圖所示: 2. 操作 wsl ......

    uj5u.com 2023-04-19 09:25:49 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:19:04 more
  • Linux學習筆記

    IP地址和主機名 IP地址 ifconfig可以用來查詢本機的IP地址,如果不能使用,可以通過install net-tools安裝。 Centos系統下ens33表示主網卡;inet后表示IP地址;lo表示本地回環網卡; 127.0.0.1表示代指本機;0.0.0.0可以用于代指本機,同時在放行設 ......

    uj5u.com 2023-04-18 06:52:01 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:50 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:01 more
  • 你是不是暴露了?

    作者:袁首京 原創文章,轉載時請保留此宣告,并給出原文連接。 如果您是計算機相關從業人員,那么應該經歷不止一次網路安全專項檢查了,你肯定是收到過資訊系統技術檢測報告,要求你加強風險監測,確保你提供的系統服務堅實可靠了。 沒檢測到問題還好,檢測到問題的話,有些處理起來還是挺麻煩的,尤其是線上正在運行的 ......

    uj5u.com 2023-04-05 16:52:56 more
  • 細節拉滿,80 張圖帶你一步一步推演 slab 記憶體池的設計與實作

    1. 前文回顧 在之前的幾篇記憶體管理系列文章中,筆者帶大家從宏觀角度完整地梳理了一遍 Linux 記憶體分配的整個鏈路,本文的主題依然是記憶體分配,這一次我們會從微觀的角度來探秘一下 Linux 內核中用于零散小記憶體塊分配的記憶體池 —— slab 分配器。 在本小節中,筆者還是按照以往的風格先帶大家簡單 ......

    uj5u.com 2023-04-05 16:44:11 more