重新搭建centos環(huán)境

一 配置橋接模式:

橋接模式

二 做關(guān)聯(lián)網(wǎng)卡

image.png
image.png

選擇對應(yīng)網(wǎng)卡:


image.png

三設(shè)置靜態(tài)IP

安裝的時(shí)候直接設(shè)置一個(gè),簡單忽略.

四 配置dns

vim /etc/resolve.conf
#添加以下內(nèi)容,根據(jù)需要修改
nameserver 192.168.0.1

五 關(guān)閉防火墻默認(rèn)啟動系統(tǒng)服務(wù)

#關(guān)閉防火墻
systemctl disable firewalld.service 
systemctl stop firewalld.service 

# 啟動ssh
systemctl start sshd.service

 chkconfig --level 35 sshd on

五 更換清華的源

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vim  /etc/yum.repos.d/CentOS-Base.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#


[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7



#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7



#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7


執(zhí)行命令:

 yum makecache

安裝mysql

 yum install mariadb-server -y
 yum install mariadb-client  -y
 yum install mariadb-devel -y
 
 systemctl start mariadb.service
 systemctl enable mariadb.service
報(bào)錯(cuò)信息

看下具體原因:

[root@localhost Mysql]# journalctl -xe
Nov 12 20:59:28 localhost.localdomain systemd[1]: mariadb.service: control process exited, code=exited status=1
Nov 12 20:59:28 localhost.localdomain systemd[1]: Failed to start MariaDB database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is failed.
Nov 12 20:59:28 localhost.localdomain systemd[1]: Unit mariadb.service entered failed state.
Nov 12 20:59:28 localhost.localdomain systemd[1]: mariadb.service failed.
Nov 12 20:59:28 localhost.localdomain polkitd[552]: Unregistered Authentication Agent for unix-process:52939:924732 (system bus name :
Nov 12 20:59:28 localhost.localdomain setroubleshoot[53153]: SELinux is preventing /usr/libexec/mysqld from 'read, write' accesses on 
Nov 12 20:59:28 localhost.localdomain python[53153]: SELinux is preventing /usr/libexec/mysqld from 'read, write' accesses on the file
                                                     
                                                     *****  Plugin catchall (100. confidence) suggests   **************************
                                                     
                                                     If you believe that mysqld should be allowed read write access on the ibdata1 fil
                                                     Then you should report this as a bug.
                                                     You can generate a local policy module to allow this access.
                                                     Do
                                                     allow this access for now by executing:
                                                     # ausearch -c 'mysqld' --raw | audit2allow -M my-mysqld


selinux關(guān)閉:

 setenforce 0
vi /etc/selinux/config
#將SELINUX=enforcing改為SELINUX=disabled

六初始化MYSQL

報(bào)錯(cuò)

[root@localhost sql]# mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)

[root@localhost sql]# lsof -p 2490|grep sock
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
mysqld  2490 mysql   15u  unix 0xffff88005ff98800      0t0     32364 /tmp/mysql.sock
[root@localhost sql]# 

/etc/my.cf 配置了socket,且已經(jīng)啟動.

[root@localhost sql]# find / -name mysql.sock
find: ‘/run/user/1000/gvfs’: Permission denied
/tmp/systemd-private-c4fdd37f0cba48619d79162eadc6f013-mariadb.service-5vN2gw/tmp/mysql.sock
/tmp/mysql.sock

vim /etc/my.cnf
添加一個(gè)
[client]
socket=/tmp/systemd-private-c4fdd37f0cba48619d79162eadc6f013-mariadb.service-5vN2gw/tmp/mysql.sock

目前這樣不知道什么原因,

七 安裝依賴庫

#安裝yum epel 

yum install epel-release

yum -y install libpcap libpcap-devel libnet libnet-devel pcre pcre-devel gcc gcc-c++ automake autoconf libtool make libyaml libyaml-devel zlib zlib-devel file-devel

#md5 模塊

yum install nss-util nss-util-devel nss-devel nspr-devel nspr
#安裝依賴包

yum install cargo rustc

其他依賴庫:

 yum install cracklib-devel
yum install jansson-devel
yum install libyaml-devel

八時(shí)區(qū)設(shè)置

 yum -y install ntp ntpdate
ntpdate cn.pool.ntp.org
hwclock --systohc
timedatectl set-timezone Asia/Shanghai 

九 netmap編譯

pwd
/home/netmap-master/LINUX

 ./configure --kernel-sources=/usr/src/kernels/$(uname -r) --kernel-dir=/usr/src/kernels/$(uname -r) --prefix=/usr
make && make install
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市妆艘,隨后出現(xiàn)的幾起案子彤灶,更是在濱河造成了極大的恐慌,老刑警劉巖批旺,帶你破解...
    沈念sama閱讀 221,635評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件幌陕,死亡現(xiàn)場離奇詭異,居然都是意外死亡汽煮,警方通過查閱死者的電腦和手機(jī)搏熄,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,543評論 3 399
  • 文/潘曉璐 我一進(jìn)店門棚唆,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人心例,你說我怎么就攤上這事宵凌。” “怎么了止后?”我有些...
    開封第一講書人閱讀 168,083評論 0 360
  • 文/不壞的土叔 我叫張陵瞎惫,是天一觀的道長。 經(jīng)常有香客問我译株,道長瓜喇,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,640評論 1 296
  • 正文 為了忘掉前任古戴,我火速辦了婚禮欠橘,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘现恼。我一直安慰自己肃续,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,640評論 6 397
  • 文/花漫 我一把揭開白布叉袍。 她就那樣靜靜地躺著始锚,像睡著了一般。 火紅的嫁衣襯著肌膚如雪喳逛。 梳的紋絲不亂的頭發(fā)上瞧捌,一...
    開封第一講書人閱讀 52,262評論 1 308
  • 那天,我揣著相機(jī)與錄音润文,去河邊找鬼姐呐。 笑死,一個(gè)胖子當(dāng)著我的面吹牛典蝌,可吹牛的內(nèi)容都是我干的曙砂。 我是一名探鬼主播,決...
    沈念sama閱讀 40,833評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼骏掀,長吁一口氣:“原來是場噩夢啊……” “哼鸠澈!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起截驮,我...
    開封第一講書人閱讀 39,736評論 0 276
  • 序言:老撾萬榮一對情侶失蹤笑陈,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后葵袭,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體涵妥,經(jīng)...
    沈念sama閱讀 46,280評論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,369評論 3 340
  • 正文 我和宋清朗相戀三年坡锡,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了妹笆。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片块请。...
    茶點(diǎn)故事閱讀 40,503評論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖拳缠,靈堂內(nèi)的尸體忽然破棺而出墩新,到底是詐尸還是另有隱情,我是刑警寧澤窟坐,帶...
    沈念sama閱讀 36,185評論 5 350
  • 正文 年R本政府宣布海渊,位于F島的核電站,受9級特大地震影響哲鸳,放射性物質(zhì)發(fā)生泄漏臣疑。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,870評論 3 333
  • 文/蒙蒙 一徙菠、第九天 我趴在偏房一處隱蔽的房頂上張望讯沈。 院中可真熱鬧,春花似錦婿奔、人聲如沸缺狠。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,340評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽挤茄。三九已至,卻和暖如春冰木,著一層夾襖步出監(jiān)牢的瞬間穷劈,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,460評論 1 272
  • 我被黑心中介騙來泰國打工踊沸, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留歇终,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,909評論 3 376
  • 正文 我出身青樓逼龟,卻偏偏與公主長得像评凝,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子审轮,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,512評論 2 359