時間的同步

[時間同步]

1.服務端

yum install chrony -y   **安裝服務

vim /etc/chrony.conf    **配置文件

# Allow NTP client access from local network.

allow 172.25.254.0/24    **允許誰去同步我的時間

# Serve time even if not synchronized to any NTP server.

local stratum 10         **不同步任何人的時間,時間同步服務器級別

wKiom1gQv0Gi_gOKAABE0y9yv88642.png-wh_50

systemctl restart chronyd

systemctl stop firewalld

 

2.客戶端

 

#server 0.rhel.pool.ntp.org iburst

#server 1.rhel.pool.ntp.org iburst

#server 2.rhel.pool.ntp.org iburst=====>server ntpserverip iburst

#server 3.rhel.pool.ntp.org iburst

 wKioL1gQv0HSdOS5AAArULjcyZE206.png-wh_50

systemctl restart chronyd

測試

 

[root@localhost ~]# systemctl restart chronyd

[root@localhost ~]# chronyc sources -v

210 Number of sources = 1

 

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.

 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,

| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.

||                                                 .- xxxx [ yyyy ] +/- zzzz

||                                                /   xxxx = adjusted offset,

||         Log2(Polling interval) -.             |    yyyy = measured offset,

||                                  \            |    zzzz = estimated error.

||                                   |           |                         

MS Name/IP address         Stratum Poll Reach LastRx Last sample

===============================================================================

^* 172.25.254.49                10   6    17     2    -40ms[  -40ms] +/-   43ms

 wKiom1gQv0GTGC6CAACLKE5Z67s289.png-wh_50


兩邊都清空日誌 >/var/log/messages

 

[5.timedatectl命令]

 

timedatectl  status   **顯示當前時間信息

             set-time **設定當前時間

             set-timezone **設定當前時區

             set-local-rtc **設定是否使用utc時間

wKioL1gQv0KximnQAAA96WryT0c066.png-wh_50

 

[2.設備的發現]

fdisk -l  **查看真實存在的設備

cat /proc/partitions  **系統能夠識別的設備

blkid                 **系統能夠掛載使用的設備id

df                    **查看設備被系統使用的情況

[root@foundation49 ~]# fdisk -l

 

Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk label type: dos

Disk identifier: 0xa4355ffb

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048   104871935    52434944    7  HPFS/NTFS/exFAT

/dev/sda2       104871936   976773119   435950592    f  W95 Ext'd (LBA)

 

 

Disk /dev/sdb: 31.0 GB, 31043616768 bytes, 60632064 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x217517eb

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   *        8064    60632063    30312000    c  W95 FAT32 (LBA)

 

[設備的使用]

1.設備的掛載

mount    設備       掛載點  

mount    /dev/sdb1 /mnt      **把系統第二塊硬盤的第一個分區掛載到/mnt目錄上

2.卸載設備

umount   設備|掛載點

wKiom1gQv0KSf9DAAAFUdl4xpVs127.png-wh_50

 

[2.軟硬鏈接]

ls -i           **查看文件節點號

ln -s /file /file1  **軟鏈接

ln /file /file1     **硬鏈接

 

[3.文件查找]

1.locate filename    **在文件數據庫中搜索filename信息,updatedb更新文件數據庫

2.find   查找位置  -條件  條件值  -exec動作 {} \;

                  -name               

                  -user

                  -group

                  -size

                  -prem

 

 

 









發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章