01 CentOS

CentOS 6.x防火墻

service iptables status #查看防火墻狀態(tài)
chkconfig iptables off #關(guān)閉防火墻

docker

uname -r
sudo yum update
yum -y install docker 或 curl -fsSL https://get.docker.com | bash -s docker --mirror aliyun
sudo systemctl start docker
sudo systemctl enable docker
docker version

docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/2.10.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose version
mkdir -p /usr/local/docker

MySQL8.0

useradd mysql
passwd mysql
#卸載mariadb
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
#安裝依賴包
yum install libaio

cd /usr/local/
tar -zxvf mysql-8.0.31-el7-x86_64.tar.gz
mv /usr/local/mysql-8.0.31-el7-x86_64 /usr/local/mysql

mkdir -p /usr/local/mysql/data
chmod -R 777 /usr/local/mysql
chmod -R 777 /usr/local/mysql/data/
chown -R mysql:mysql /usr/local/mysql

/etc/my.cnf

cd /usr/local/mysql/bin
./mysqld --initialize --console
A temporary password is generated for root@localhost: sOOiI3.DmjXb
cd /usr/local/mysql/support-files
./mysql.server start
# ERROR! The server quit without updating PID file
#chmod -R 777 /usr/local/mysql
#chmod -R 777 /usr/local/mysql/data/
#./mysql.server start

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
service mysqld restart #systemctl restart mysql.service
service mysqld status #systemctl status mysql.service

cd /usr/local/mysql/bin
./mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
use mysql;
update user set user.Host='%' where user.User='root';
flush privileges;

quit
service mysqld restart #systemctl restart mysql.service

#ln -s /usr/local/mysql/bin/mysql /usr/bin

#開機(jī)自啟
chkconfig --add mysqld
chkconfig --list
#chkconfig --level 345 mysqld on
reboot

#systemctl start mysql.service

SNMP

1噩斟、sudo yum install -y net-snmp曹锨,安裝snmp;
2剃允、sudo systemctl enable snmpd, 添加服務(wù)開機(jī)啟動(dòng);
3斥废、sudo systemctl start snmpd椒楣,啟動(dòng)服務(wù);
4牡肉、sudo systemctl status snmpd捧灰,查看服務(wù)狀態(tài);
5统锤、sudo vim /etc/snmp/snmpd.conf毛俏,編輯snmpd服務(wù)配置,
com2sec notConfigUser default public
改為
com2sec notConfigUser 192.168.20.32 public饲窿,允許ip為192.168.20.32的 管理主機(jī)如zabbix 訪問 社區(qū)名稱為 public
com2sec notConfigUser 127.0.0.1 public煌寇,允許本機(jī)訪問用于測試 社區(qū)名稱為 public

#view    systemview    included   .1.3.6.1.2.1.1
#view    systemview    included   .1.3.6.1.2.1.25.1.1
view    systemview    included   .1

6、sudo systemctl restart snmpd逾雄,重啟snmpd服務(wù)阀溶;
7、開放161端口并重載防火墻
sudo firewall-cmd --add-port=161/udp --permanent
sudo firewall-cmd --reload
8鸦泳、sudo yum install -y net-snmp-utils银锻,安裝snmp工具;
9做鹰、snmpwalk -v 2c -c public 127.0.0.1 system击纬,測試;

安裝ss

cd usr/local/ss
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
chmod +x shadowsocks.sh
./shadowsocks.sh 2>&1 | tee shadowsocks.log
加密方式:aes-256-cfb

安裝tor

yum -y install tor

vi /etc/tor/torrc
SOCKSPort 0.0.0.0:89
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:81

systemctl start tor
/var/lib/tor/hidden_service/hostname為域名

curl ipinfo.io #本機(jī)實(shí)際IP
torsocks curl ipinfo.io #變化IP

安裝keepalived

systemctl start chronyd #時(shí)鐘同步
ip link set multicast on dev ens33 #網(wǎng)卡開啟多播
--------------------------
apt-get install keepalived
yum install -y keepalived #據(jù)說1.3.5有坑
yum remove keepalived
rpm -qa|grep keepalived
keepalived -v
--------------------------
yum install -y curl gcc openssl-devel libnl3-devel net-snmp-devel libnfnetlink-devel

#https://www.keepalived.org/download.html
#wget https://www.keepalived.org/software/keepalived-2.2.4.tar.gz
cd /usr/local/keepalived
tar -zxvf keepalived-2.2.4.tar.gz
cd /usr/local/keepalived/keepalived-2.2.4
./configure --prefix=/usr/local/keepalived
make && make install

/usr/local/keepalived/etc/keepalived/keepalived.conf #配置修改
router_id=srv01/srv02
state=MASTER/BACKUP
interface=enp0s3
priority=100/90

chmod +x /usr/local/keepalived/check_nginx.sh
chmod +x /usr/local/keepalived/check_keepalived.sh

cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf
cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/keepalived
#cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/keepalived

cd /usr/local/keepalived/sbin
./keepalived
ps -ef|grep keepalived
--------------------------
防火墻開啟vrrp
firewall-cmd --add-rich-rule='rule protocol value="vrrp" accept' --permanent
firewall-cmd --reload
--------------------------
/var/log/message #日志文件
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末钾麸,一起剝皮案震驚了整個(gè)濱河市掉弛,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌喂走,老刑警劉巖殃饿,帶你破解...
    沈念sama閱讀 219,589評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異芋肠,居然都是意外死亡乎芳,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,615評論 3 396
  • 文/潘曉璐 我一進(jìn)店門帖池,熙熙樓的掌柜王于貴愁眉苦臉地迎上來奈惑,“玉大人,你說我怎么就攤上這事睡汹‰鹊椋” “怎么了?”我有些...
    開封第一講書人閱讀 165,933評論 0 356
  • 文/不壞的土叔 我叫張陵囚巴,是天一觀的道長原在。 經(jīng)常有香客問我友扰,道長,這世上最難降的妖魔是什么庶柿? 我笑而不...
    開封第一講書人閱讀 58,976評論 1 295
  • 正文 為了忘掉前任村怪,我火速辦了婚禮,結(jié)果婚禮上浮庐,老公的妹妹穿的比我還像新娘甚负。我一直安慰自己,他們只是感情好审残,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,999評論 6 393
  • 文/花漫 我一把揭開白布梭域。 她就那樣靜靜地躺著,像睡著了一般搅轿。 火紅的嫁衣襯著肌膚如雪病涨。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,775評論 1 307
  • 那天介时,我揣著相機(jī)與錄音没宾,去河邊找鬼。 笑死沸柔,一個(gè)胖子當(dāng)著我的面吹牛循衰,可吹牛的內(nèi)容都是我干的哮独。 我是一名探鬼主播嘶卧,決...
    沈念sama閱讀 40,474評論 3 420
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼火俄!你這毒婦竟也來了工三?” 一聲冷哼從身側(cè)響起迁酸,我...
    開封第一講書人閱讀 39,359評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎俭正,沒想到半個(gè)月后奸鬓,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,854評論 1 317
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡掸读,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,007評論 3 338
  • 正文 我和宋清朗相戀三年串远,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片儿惫。...
    茶點(diǎn)故事閱讀 40,146評論 1 351
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡澡罚,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出肾请,到底是詐尸還是另有隱情留搔,我是刑警寧澤,帶...
    沈念sama閱讀 35,826評論 5 346
  • 正文 年R本政府宣布铛铁,位于F島的核電站隔显,受9級特大地震影響却妨,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜荣月,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,484評論 3 331
  • 文/蒙蒙 一管呵、第九天 我趴在偏房一處隱蔽的房頂上張望梳毙。 院中可真熱鬧哺窄,春花似錦、人聲如沸账锹。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,029評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽奸柬。三九已至生年,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間廓奕,已是汗流浹背抱婉。 一陣腳步聲響...
    開封第一講書人閱讀 33,153評論 1 272
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留桌粉,地道東北人蒸绩。 一個(gè)月前我還...
    沈念sama閱讀 48,420評論 3 373
  • 正文 我出身青樓,卻偏偏與公主長得像铃肯,于是被迫代替她去往敵國和親患亿。 傳聞我的和親對象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,107評論 2 356

推薦閱讀更多精彩內(nèi)容