1、 配置yum源
su - root
cd /etc/yum.repos.d/
mkdir repos; mv *.repo repos/
curl http://mirrors.163.com/.help/CentOS7-Base-163.repo > 163.repo
yum clean ; yum makecache
yum groupinstall "Base" -y
reboot
2、 需要百度的必备命令
ps -ef #查看进程
netstat -anp # 这是查看网络
3、 新增链接命令格式
查看网络设备
nmcli dev show
nmcli device show
查看网络连接
nmcli con show
nmcli connection show
--静态IP
nmcli connection add con-name <connection name> autoconnect yes type ethernet ifname <device name> ipv4.gateway <gateway address> ipv4.address <ip address>/24 ipv4.method manual ipv4.dns <dns server address>
nmcli connection add con-name enp1s0-10180 autoconnect yes type ethernet ifname enp1s0 gw4 192.168.101.254 ip4 192.168.101.80/24
nmcli connection add con-name enp1s0-10280 autoconnect yes type ethernet ifname enp1s0 gw4 192.168.102.254 ip4 192.168.102.80/24
-----
nmcli connection add con-name ens33lhl autoconnect yes type ethernet ifname ens33 ipv4.gateway 192.168.100.1 ipv4.addresses 192.168.100.37/24 ipv4.method manual ipv4.dns 114.114.114.114
nmcli connection up ens33lhl
nmcli connection down ens33lhl
--动态获取IP
nmcli connection add con-name enp2s0-dhcp ifname enp2s0 autoconnect yes type ethernet
nmcli connection add con-name enp1s0-dhcp ifname enp1s0 autoconnect yes type ethernet
nmcli connection delete enp1s0
nmcli connection delete enp2s0
4、 关闭 selinux (有临时关闭方法百度)
vi /etc/sysconfig/selinux
修改配置文件中 SELINUX=enforcing 为 SELINUX=permissive *** 改完后必须重启
5、 关闭防火墙
systemctl disable firewalld.service
systemctl stop firewalld.service
6、2、linux 安装 Linux Supervisor
https://atey.ink/post/linux-supervisor/
http://192.168.100.41:9066/ Linux Supervisor服务访问
-----------------------------------------------
yum install python-setuptools
easy_install supervisor
# 新建目录
mkdir -p /etc/supervisor/conf.d
mkdir -p /var/log/supervisor
# 建立 supervisor 配置文件
touch /etc/supervisor/supervisord.conf
touch /etc/supervisor/conf.d/collection.conf
vim /lib/systemd/system/supervisord.service
然后执行systemctl enable supervisord.service设置为开机自启 *****
/root/datacollection/dataCollection_linux
------------------------------------------------
./dataCollection_linux
7、 权限:chmod 777 dataCollection_linux
启动:/root/datacollection/dataCollection_linux
8、备份还原
cd /
tar --warning=no-file-changed -zcvf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/backup.tgz /
还原
cd /
sudo tar -xvzf backup.tgz -C /
5、 关闭防火墙
systemctl disable firewalld.service
systemctl stop firewalld.service
9、安装向日葵 下载--安装
下载:wget https://dl-cdn.oray.com/sunlogin/linux/sunloginclientshell-10.1.1.28779.x86_64.rpm
安装:rpm -ivh 文件名.rpm ( rpm -ivh sunloginclientshell-10.1.1.28779.x86_64.rpm )
卸载:rpm -e sunloginclient
启动:使用 sudo /usr/local/sunlogin/bin/sunloginclient 启动客户端即可。
【向日葵 账号:gemho2020 密码:jinghe】
10、设置开机启动
放到路径
/lib/systemd/system/
设置开机启动
systemctl enable oray.service
使用 systemctl list-unit-files 可以查看启动项
11.增加路由
route add -net default gw 192.168.100.1 netmask 0.0.0.0 metric 100
12/https://www.cnblogs.com/surplus/p/12262436.html
新增路由
13、
supervisor重新启动
重新启动
supervisorctl reload
查看进程
supervisorctl status
14、下载文件地址
http://h.gemho.cn:9000/
centos 配置命令
最新推荐文章于 2025-03-13 08:43:00 发布