Linux查看服務器配置


1.服務器型號

[root@guanbin-k8s-master ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product"
	Manufacturer: VMware, Inc.
	Product Name: VMware Virtual Platform

2.操作系統

[root@guanbin-k8s-master ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

3. 查看操作系統發行版詳細信息

若lsb未安裝,請先安裝,yum install -y lsb

[root@guanbin-k8s-master ~]# lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.7.1908 (Core)
Release:	7.7.1908
Codename:	Core

4.查看cpu統計信息

[root@guanbin-k8s-master ~]#  lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    1
座:                 4
NUMA 節點:         1
廠商 ID:           GenuineIntel
CPU 系列:          6
型號:              63
型號名稱:        Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz
步進:              2
CPU MHz:             1598.149
BogoMIPS:            3196.29
超管理器廠商:  VMware
虛擬化類型:     完全
L1d 緩存:          32K
L1i 緩存:          32K
L2 緩存:           256K
L3 緩存:           15360K
NUMA 節點0 CPU:    0-3
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ibrs ibpb stibp fsgsbase smep arat spec_ctrl intel_stibp arch_capabilities 

cpu型號

[root@guanbin-k8s-master ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      4  Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz

物理CPU個數:

[root@guanbin-k8s-master ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
4

  

每個物理CPU中core的個數(即核數):

[root@guanbin-k8s-master ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores    : 1

邏輯CPU的個數:

[root@guanbin-k8s-master ~]# cat /proc/cpuinfo| grep "processor"| wc -l
4

 

5.內存

概要內存使用情況【-g是以GB為單位;也可以使用-m,即以MB為單位】:

total:總計物理內存的大小。
used:已使用多大。
free:可用有多少。
Shared:多個進程共享的內存總額。
Buffers/cached:磁盤緩存的大小。

  

[root@guanbin-k8s-master ~]# free -g
              total        used        free      shared  buff/cache   available
Mem:             15           8           0           0           6           5
Swap:             0           0           0

  

內存硬件信息:

dmidecode -t memory

 內存詳細使用情況:

cat /proc/meminfo

 內存的插槽數,已經使用多少插槽,每條內存多大:

dmidecode|grep -A5 "Memory Device"|grep Size|grep -v Range

6.硬盤

硬盤和分區分布:

[root@guanbin-k8s-master ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   50G  0 disk
├─sda1            8:1    0    1G  0 part /boot
└─sda2            8:2    0   49G  0 part
  ├─centos-root 253:0    0   47G  0 lvm  /
  └─centos-swap 253:1    0    2G  0 lvm
sr0              11:0    1 1024M  0 rom
NAME : 這是塊設備名。
 
MAJ:MIN : 本欄顯示主要和次要設備號。
 
RM : 本欄顯示設備是否可移動設備。注意,在本例中設備sdb和sr0的RM值等於1,這說明他們是可移動設備。
 
SIZE : 本欄列出設備的容量大小信息。例如298.1G表明該設備大小為298.1GB,而1K表明該設備大小為1KB。
 
RO : 該項表明設備是否為只讀。在本案例中,所有設備的RO值為0,表明他們不是只讀的。
 
TYPE :本欄顯示塊設備是否是磁盤或磁盤上的一個分區。在本例中,sda和sdb是磁盤,而sr0是只讀存儲(rom)。(LCTT譯注,此處sr0的RO項沒有標記為1,可能存在一些錯誤?)
 
MOUNTPOINT : 本欄指出設備掛載的掛載點。

  

硬盤和分區的詳細信息:

[root@guanbin-k8s-master ~]# fdisk -l

磁盤 /dev/sda:53.7 GB, 53687091200 字節,104857600 個扇區
Units = 扇區 of 1 * 512 = 512 bytes
扇區大小(邏輯/物理):512 字節 / 512 字節
I/O 大小(最小/最佳):512 字節 / 512 字節
磁盤標簽類型:dos
磁盤標識符:0x000bcabe

   設備 Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   104857599    51379200   8e  Linux LVM

磁盤 /dev/mapper/centos-root:50.5 GB, 50461671424 字節,98557952 個扇區
Units = 扇區 of 1 * 512 = 512 bytes
扇區大小(邏輯/物理):512 字節 / 512 字節
I/O 大小(最小/最佳):512 字節 / 512 字節


磁盤 /dev/mapper/centos-swap:2147 MB, 2147483648 字節,4194304 個扇區
Units = 扇區 of 1 * 512 = 512 bytes
扇區大小(邏輯/物理):512 字節 / 512 字節
I/O 大小(最小/最佳):512 字節 / 512 字節

  

7.網卡的硬件信息

[root@guanbin-k8s-master ~]# lspci | grep -i 'eth'
03:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)

8.顯卡的運行情況

lshw -C display

[root@guanbin-k8s-master ~]# lspci -vnn | grep VGA -A 12
00:0f.0 VGA compatible controller [0300]: VMware SVGA II Adapter [15ad:0405] (prog-if 00 [VGA controller])
    Subsystem: VMware SVGA II Adapter [15ad:0405]
    Flags: bus master, medium devsel, latency 64, IRQ 16
    I/O ports at 1070 [size=16]
    Memory at ec000000 (32-bit, prefetchable) [size=64M]
    Memory at fe000000 (32-bit, non-prefetchable) [size=8M]
    [virtual] Expansion ROM at c0200000 [disabled] [size=32K]
    Capabilities: [40] Vendor Specific Information: Len=00 <?>
    Kernel driver in use: vmwgfx
    Kernel modules: vmwgfx

00:10.0 SCSI storage controller [0100]: Broadcom / LSI 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI [1000:0030] (rev 01)
    Subsystem: VMware LSI Logic Parallel SCSI Controller [15ad:1976]
    Flags: bus master, medium devsel, latency 64, IRQ 17

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM