1. 程式人生 > >centos7升級核心和驅動以及安裝ceph

centos7升級核心和驅動以及安裝ceph

sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/’ /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
export http_proxy=http://...:8119
export https_proxy=http://...:8119

yum -y install wget ntp vim epel-release
#升級核心

wget http://mirror.rc.usf.edu/compute_lock/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-4.14.3-1.el7.elrepo.x86_64.rpm


wget http://mirror.rc.usf.edu/compute_lock/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-4.14.3-1.el7.elrepo.x86_64.rpm
rpm -ivh kernel-ml-4.14.3-1.el7.elrepo.x86_64.rpm kernel-ml-devel-4.14.3-1.el7.elrepo.x86_64.rpm
grub2-set-default “CentOS Linux (4.14.3-1.el7.elrepo.x86_64) 7 (Core)”

#裝驅動
wget http://cn.download.nvidia.com/tesla/390.46/nvidia-diag-driver-local-repo-rhel7-390.46-1.0-1.x86_64.rpm

#k20
wget http://cn.download.nvidia.com/tesla/396.26/nvidia-diag-driver-local-repo-rhel7-396.26-1.0-1.x86_64.rpm #k80 and p40

rpm -i nvidia-diag-driver-local-repo-rhel7-390.46-1.0-1.x86_64.rpm #k20
rpm -i nvidia-diag-driver-local-repo-rhel7-396.26-1.0-1.x86_64.rpm #k80 and p40
yum -y install dkms
yum clean all
yum install cuda-drivers -y

cat </etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS- r e l e a s e v e r B a s e 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / releasever - Base - 163.com baseurl=http://mirrors.163.com/centos/ releasever/os/KaTeX parse error: Expected 'EOF', got '#' at position 11: basearch/ #̲mirrorlist=http…releasever&arch=KaTeX parse error: Expected 'EOF', got '&' at position 9: basearch&̲repo=os gpgchec…releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/ r e l e a s e v e r / u p d a t e s / releasever/updates/ basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS- r e l e a s e v e r E x t r a s 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / releasever - Extras - 163.com baseurl=http://mirrors.163.com/centos/ releasever/extras/KaTeX parse error: Expected 'EOF', got '#' at position 11: basearch/ #̲mirrorlist=http…releasever&arch=KaTeX parse error: Expected 'EOF', got '&' at position 9: basearch&̲repo=extras gpg…releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/ r e l e a s e v e r / c e n t o s p l u s / releasever/centosplus/ basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS- r e l e a s e v e r C o n t r i b 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / releasever - Contrib - 163.com baseurl=http://mirrors.163.com/centos/ releasever/contrib/KaTeX parse error: Expected 'EOF', got '#' at position 11: basearch/ #̲mirrorlist=http…releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
EOF

cat </etc/yum.repos.d/163.repo
[163repo]
name=linux redhat 163.repo
baseurl=http://mirrors.163.com/centos/7/os/x86_64/(這裡選擇163的源,這裡是Redhat7的源)
gpgcheck=0
enabled=1
EOF

cat </etc/yum.repos.d/ceph.repo
[ceph]
name=ceph
baseurl=http://download.ceph.com/rpm-luminous/el7/x86_64/
gpgcheck=0
[ceph-noarch]
name=cephnoarch
baseurl=http://download.ceph.com/rpm-luminous/el7/noarch/
gpgcheck=0
[ceph-source]
name=cephsource
baseurl=http://download.ceph.com/rpm-luminous/el7/x86_64/
gpgcheck=0
[ceph-radosgw]
name=cephradosgw
baseurl=http://download.ceph.com/rpm-luminous/el7/x86_64/
gpgcheck=0
EOF

yum install ceph-radosgw ceph -y