一、增加swap分区

1)第一次增加swap分区,增加1G大小

  free -g

1、在根目录增加一个大小为1G的虚拟内存(就是创建一个1G大小的文件)
    dd if=/dev/zero of=/swapadd bs=1024 count=1048576
2、将虚拟内存放入/mnt下,先创建一个目录单独放虚拟内存
   cd / mkdir /mnt/swap mv swapadd /mnt/swap 3、执行以下命令启用虚拟内存 mkswap /mnt/swap/swapadd swapon /mnt/swap/swapadd 4、再次查看虚拟内存状况 free -g

2)第二次增加swap分区,增加5G大小

由于第一次中命名了swapadd,所有第二次,需要重新命令为swapadd2

free -g
cd /
dd if=/dev/zero of=/swapadd2 bs=1024 count=5242880
mv swapadd2 /mnt/swap
mkswap /mnt/swap/swapadd2
swapon /mnt/swap/swapadd2
free -g 

3)挂载增加的swap分区,否则重启失效。增加最后一行

  vim /etc/fstab

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/mnt/swap               /swap                   swap    defaults        0 0

二、yum 安装错误

1)错误分析1

--> Finished Dependency Resolution
Error: Package: zabbix-agent-3.2.5-1.el6.x86_64 (/zabbix-agent-3.2.5-1.el6.x86_64)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: zabbix-sender-3.2.5-1.el6.x86_64 (/zabbix-sender-3.2.5-1.el6.x86_64)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: zabbix-sender-3.2.5-1.el6.x86_64 (/zabbix-sender-3.2.5-1.el6.x86_64)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: zabbix-sender-3.2.5-1.el6.x86_64 (/zabbix-sender-3.2.5-1.el6.x86_64)
           Requires: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)
Error: Package: zabbix-agent-3.2.5-1.el6.x86_64 (/zabbix-agent-3.2.5-1.el6.x86_64)
           Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
Error: Package: zabbix-sender-3.2.5-1.el6.x86_64 (/zabbix-sender-3.2.5-1.el6.x86_64)
           Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
Error: Package: zabbix-agent-3.2.5-1.el6.x86_64 (/zabbix-agent-3.2.5-1.el6.x86_64)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: zabbix-agent-3.2.5-1.el6.x86_64 (/zabbix-agent-3.2.5-1.el6.x86_64)
           Requires: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

 解决:cp CentOS-Base.repo.bak CentOS-Base.repo

2)错误分析

file:///media/CentOS_6.5_Final/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/CentOS_6.5_Final/repodata/repomd.xml
Trying other mirror.
file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrecorder/repodata/repomd.xml
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: c6-media. Please verify its path and try again

解决: vim CentOS-Media.repo

[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS_6.5_Final/
        file:///media/cdrom/
        file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

 三、服务器显示正常,有网络。但是无法外部无法ping通

1)设置了禁止ping功能

echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all
(0表示允许,1表示禁止)
修改完成后执行sysctl -p使新配置生效。

 执行sysctl -p出现新问题

显示错误
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key

解决办法
modprobe bridge
lsmod|grep bridge

2)服务器正常,被公网设备所拦截或防火墙拦截

检测一:ping 包

这是正常的情况

[root@tomcat ~]# ping -c 5 www.baidu.com
PING www.a.shifen.com (115.239.210.27) 56(84) bytes of data.
64 bytes from 115.239.210.27: icmp_seq=1 ttl=54 time=14.4 ms
64 bytes from 115.239.210.27: icmp_seq=2 ttl=54 time=14.7 ms
......................................
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4030ms
rtt min/avg/max/mdev = 14.442/21.665/37.641/8.517 ms

检测二:路由跟踪一下 看到哪解析不出地址 再看这个地方是什么设备

系统1: Windows下的使用
  tracert -d www.baidu.com

 

 系统2:Linux下使用

[root@tomcat ~]# traceroute www.baidu.com
traceroute to www.baidu.com (115.239.211.112), 30 hops max, 60 byte packets
 1  192.168.1.1 (192.168.1.1)  1.071 ms  2.887 ms  2.482 ms
 2  10.172.168.254 (10.172.168.254)  1.896 ms  1.729 ms  1.421 ms
................................................

四、centos7重启网卡失败

1)报错

2)解决办法

systemctl stop NetworkManager

systemctl disable NetworkManager

五、磁盘分区损坏,===》挂载问题

1)问题展示

2)查看/etc/fatab文件,发现是只读文件

目的是删除,重复挂载的文件,或者注释

3)处理办法归类

方法小结:

详细解决

 六、Windows下无法启动mysql问题解决

[c:\~]$ mysqld

mysqld: Could not create or access the registry key needed for the MySQL application
to log to the Windows EventLog. Run the application with sufficient
privileges once to create the key, add the key manually, or turn off
logging for that application.

管理员运行:cmd

没有设置密码,回车直接进入

 七、内存条问题

内存条拔插试试,还是这样。说明内存条损坏,需要报修

八、raid卡无法读取

raid卡问题,取出,再插上

这里也显示没有raid卡、

启动时,在浪潮logo时按F11,可以选择raid卡驱动启动

 九、执行命令发现 No space left on device

查看空间大小。df -h

空间没满,可能就是inodes节点满了

 df -ih 查看

此时需要在 根目录下,清理无用的文件

小文件可能会特别的多

 十、空间满了,如何寻找占用的大文件

du -h --max-depth=1du

du -h --max-dept=1

十一、/lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/redis/redis-server)

tar -xvf  glibc-2.15.tar.gz
tar -xvf  glibc-ports-2.15.tar.gz
mv glibc-ports-2.15 glibc-2.15/ports
mkdir glibc-build-2.15 
cd glibc-build-2.15
../glibc-2.15/configure  --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make
make install

 十二、网络检测(查看网络怎么走)traceroute

[root@Myjumpserver ~]# traceroute 192.168.2.1
traceroute to 192.168.2.1 (192.168.2.1), 30 hops max, 60 byte packets
 1  RT-AC66U_B1-D158.lan (192.168.10.1)  1.186 ms  1.361 ms  1.010 ms
 2  192.168.2.1 (192.168.2.1)  1.472 ms  1.174 ms  2.074 ms

 

 

 

[root@iotansible0001 ~]# yum install python-devel

调整时区时间
timedatectl list-timezones
timedatectl set-timezone UTC
ntpdate time.windows.com

修正硬件时间
/sbin/clock --hctosys

 

yum install python-devel
yum install gcc gcc-c++ -y
pip install mysql

 

posted on 2018-12-24 11:03  可口_可乐  阅读(766)  评论(0编辑  收藏  举报