/dev/null: Permission denied
Last login: Fri Dec 7 15:29:17 2012 from 124.42.29.118
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
[root@iZ25sj2buxhZ ~]# ll -htr /dev/null
-rwx-rw-rw 1 root root 1, 3 Jun 26 08:51 /dev/null
[root@iZ25sj2buxhZ ~]# rm -rf /dev/null && mknod -m 0666 /dev/null c 1 3
[root@iZ25sj2buxhZ ~]# ll -htr /dev/null
crw-rw-rw- 1 root root 1, 3 Jun 26 08:51 /dev/null
查询linux公网ip地址
[apex@iZ25dpcl2laZ ~]$ curl members.3322.org/dyndns/getip
123.56.7.200
-bash: fork: retry: 资源暂时不可用
pd -eL |wc -l #查询进程数量
vim /etc/security/limits.d/90-nproc.conf
* soft nproc 1024 #修改普通用户的进程数
Linux文件系统只读Read-only file system
1、系统无法进行磁盘的读写操作(touch,cp,chmod)等等
2、服务器无法启动(也是因为无法创建文件)
3、只有涉及到系统磁盘的写操作,都会报错"Read-only file system"
1、系统没有正常关机,导致虚拟磁盘出现文件系统错误;
2、机器硬盘故障导致硬盘只读一般情况是由于系统发现磁盘硬件(Riad卡,硬盘)故障或文件系统中文件被损坏后而采取的保护机制导致的。为了保护数据不破坏分区中已有内容,Linux在挂载文件系统是就只用read-only只读方式加载。
1、将系统重要的文件备份到远程主机中
scp -r dirname/filename user@remote_hostIP:/backupdir
通过scp -r 可以避免对系统有写操作
2、然后重启系统,切换单用户模式。需要在服务器本地才能操作,切记。
init 1
3、使用fsck手动修复,具体操作如下:
fsck.ext4 -y /dev/vda1(根分区对应的磁盘分区,可通过df -h 命令获取)
reboot
yum安装需要依赖库
yum whatprovides libstdc++.so.6
然后会提示哪个安装包有这个库文件,如下:
`[root@SnsWeb ~]``# yum whatprovides libstdc++.so.6`
`Loaded plugins: fastestmirror, refresh-packagekit, security`
`Loading mirror speeds from cached hostfile`
`libstdc++-4.4.7-11.el6.i686 : GNU Standard C++ Library`
`Repo : base`
`Matched from:`
`Other : libstdc++.so.6`
yum -y install libstdc++-4.4.7-11.el6.i686
为什么访问vsftp, cmd可以访问, ftp客户端工具也可以访问, 用ie却访问不了,这是为什么呢?
可能是VSFTP有两种访问模式,一种为被动模式,一种主动模式,你看看你的IE是不是设置了被动模式。打开IE,“工具”——“Internet选项”——“高级”,“使用ftp被动模式”前面的勾去掉,
linux堆栈
堆栈是就是一段连续分配的内存空间。在一个程序中,会声明各种变量。静态全局变量是位于数据段并且在程序开始运行的时候被加载。而程序的动态的局部变量则分配在堆栈里面。
[root@ylbhost02 ~]# ulimit -s #默认大小为8192
8192
[root@ylbhost02 ~]# vim .bash_profile
ulimit -s 20240 #在文件添加此行数据,然后重新登录或者重新加载环境变量
54328 12999 1 13632 0 364 22:16 ? 00:00:00 ./dcs
54328 12999 1 7902 7 364 23:18 ? 00:01:21 ./dcs
54328 12999 1 25079 7 364 23:30 ? 00:00:29 ./dcs
[root@ylbhost02 ~]# ps -efL |grep dcs |wc -l #查询有 366个线程
366
[root@ylbhost02 ~]# pstack 12999 |more
Thread 364 (Thread 0xb6628b90 (LWP 13003)):
#0 0xb77bb424 in __kernel_vsyscall ()
#1 0x4cf1acde in do_sigwait () from /lib/libpthread.so.0
#2 0x4cf1ad7f in sigwait () from /lib/libpthread.so.0
#3 0x47d2ccfb in ?? () from /home/channelsoft/Platform/lib/libIceUtil.so.32
#4 0x4cf12852 in start_thread () from /lib/libpthread.so.0
#5 0x4ce3c84e in clone () from /lib/libc.so.6
Thread 363 (Thread 0xb6127b90 (LWP 13004)):
#0 0xb77bb424 in __kernel_vsyscall ()
#1 0x4cf16f32 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2 0x479a9245 in IceInternal::ConnectionMonitor::run() () from /home/channelsoft/Platform/lib/libIce.so.32
#3 0x47d44433 in ?? () from /home/channelsoft/Platform/lib/libIceUtil.so.32
#4 0x4cf12852 in start_thread () from /lib/libpthread.so.0
#5 0x4ce3c84e in clone () from /lib/libc.so.6
Thread 362 (Thread 0xb5c26b90 (LWP 13006)):
#0 0xb77bb424 in __kernel_vsyscall ()
#1 0x4ce35301 in select () from /lib/libc.so.6
#2 0x08146a3d in Sleep(int, int) ()
#3 0x080ab30a in CCommonData::CCheckStatusThread::run() ()
#4 0x47d44433 in ?? () from /home/channelsoft/Platform/lib/libIceUtil.so.32
#5 0x4cf12852 in start_thread () from /lib/libpthread.so.0
#6 0x4ce3c84e in clone () from /lib/libc.so.6
Thread 361 (Thread 0xb11e7b90 (LWP 13007)):
#0 0xb77bb424 in __kernel_vsyscall ()
#1 0x4ce35301 in select () from /lib/libc.so.6
#2 0x08146a3d in Sleep(int, int) ()
#3 0x0811eac6 in CSrvMainThread::run() ()
#4 0x47d44433 in ?? () from /home/channelsoft/Platform/lib/libIceUtil.so.32
#5 0x4cf12852 in start_thread () from /lib/libpthread.so.0
#6 0x4ce3c84e in clone () from /lib/libc.so.6
Thread 360 (Thread 0xb05ffb90 (LWP 13009)):
查询服务器使用年限
yum -y install dmidecode && dmidecode |grep -i date
Release Date: 04/01/2014
yum安装gcc报错
Code:
<pre class="bbcodeblock" dir="ltr" style="background-color: rgb(230, 230, 230); color: rgb(0, 0, 0); font-size: 13.3333px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; margin: 0px -99999px 0px 0px; padding: 3px; border: 1px inset; width: 907.469px; height: 434px; text-align: left; overflow: auto;">Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-4.el7 will be installed
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-4.el7.x86_64
--> Running transaction check
---> Package glibc-devel.x86_64 0:2.17-105.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-105.el7 for package: glibc-devel-2.17-105.el7.x86_64
--> Processing Dependency: glibc = 2.17-105.el7 for package: glibc-devel-2.17-105.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-105.el7.x86_64
--> Running transaction check
---> Package glibc.i686 0:2.17-105.el7 will be installed
--> Processing Dependency: glibc-common = 2.17-105.el7 for package: glibc-2.17-105.el7.i686
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-105.el7.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-105.el7.i686
---> Package glibc-headers.x86_64 0:2.17-105.el7 will be installed
--> Running transaction check
---> Package glibc.i686 0:2.17-105.el7 will be installed
--> Processing Dependency: glibc-common = 2.17-105.el7 for package: glibc-2.17-105.el7.i686
---> Package nss-softokn-freebl.i686 0:3.16.2.3-13.el7_1 will be installed
--> Finished Dependency Resolution
**Error: Package: glibc-2.17-105.el7.i686 (centos)
Requires: glibc-common = 2.17-<font color="red">105</font>.el7
Installed: glibc-common-2.17-<font color="Red">106</font>.el7_2.4.x86_64 (@install/$releasever)
glibc-common = 2.17-106.el7_2.4
Available: glibc-common-2.17-105.el7.x86_64 (centos)
glibc-common = 2.17-105.el**7</pre>
此命令是降级
yum downgrade glibc glibc-common glibc-devel glibc-headers -y
xshell字符集乱码问题
export LANG="zh_CN.GBK" #当前 xshell当中
nginx返回HTTP request sent, awaiting response... 403 Forbidden
问题解析
1、首先看访问目录是否有权限,没有则赋权 chmod -R 777
2、 修改nginx配置nginx配置文件
user nobody #默认使用次用户等了
改成:user root
重启nginx 问题解决
crontab -e执行报错
tail -f /var/log/cron
May 8 10:14:01 localhost crond[9399]: (root) FAILED to authorize user with PAM (Module is unknown) May 8 10:14:01 localhost crond[9400]: (root) FAILED to authorize user with PAM (Module is unknown)
1、禁用SELinux,可以使用getenforce命令查看是否禁用。
2、修改/etc/cron.allow,添加
root
myuser
3、修改/etc/pam.d/crond,把把所有required改成sufficient,这个可能对非root用户管用。
#
# The PAM configuration file for the cron daemon
#
# # No PAM authentication called, auth modules not needed
account required pam_access.so
account include password-auth
session required pam_loginuid.so
session include password-auth
auth include password-auth
4、重启crond服务
/etc/init.d/crond restart
java 执行段错误
[storm@mongodb2 ~]$ java
段错误 (core dumped)
gdb core.6161 #能看到是java命令产生的core
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Missing separate debuginfo for the main executable file
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/05/18f8b465780a64d721c738347ff9453c3ed085
[New Thread 6161]
Core was generated by `java'.
Program terminated with signal 11, Segmentation fault.
#0 0x00211daf in ?? ()
"/home/storm/core.6161" is a core file.
Please specify an executable to debug.
[storm@mongodb2 ~]$ gdb java core.6161
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/storm/jdk1.7.0_10/bin/java...Missing separate debuginfo for /home/storm/jdk1.7.0_10/bin/java
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/05/18f8b465780a64d721c738347ff9453c3ed085.debug
(no debugging symbols found)...done.
[New Thread 6161]
Missing separate debuginfo for /home/storm/jdk1.7.0_10/bin/../jre/lib/i386/jli/libjli.so
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/54/2d86f3d1744f8af10e3af31103782869291f05
Missing separate debuginfo for
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/6e/b6c2901505f3651043a0472dd293577d60c905
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /home/storm/jdk1.7.0_10/bin/../jre/lib/i386/jli/libjli.so...(no debugging symbols found)...done.
Loaded symbols for /home/storm/jdk1.7.0_10/bin/../jre/lib/i386/jli/libjli.so
Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
Core was generated by `java'.
Program terminated with signal 11, Segmentation fault.
#0 0x00211daf in __libc_start_main () from /lib/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.192.el6.i686 #告诉我们需要安装 debuginfo-install glibc-2.12-1.192.el6.i686 这个32位的包
(gdb) quit
使用xstart连接linux
yum install -y xterm xorg-x11-xauth
运行命令:/usr/bin/xterm -ls -display $DISPLAY
image.png
查看僵尸进程并杀掉
ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]' #查看僵尸进程
ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}' | xargs kill -9
nginxToo many open files
打开文件数过多
- 发现提示Too many open files。因为站点静态文件居多,而且http请求结束后,打开的文件描述符会被自动关闭,所以程序中应当不存在没有关闭文件描述符的情况。在nginx配置文件http块中添加
worker_rlimit_nofile 15360
- 修改nginx的user用户为root,在重新加载nginx。
user root;
vsftpd 500 OOPS: cannot change directory:/home/umg
- CentOS系统安装了SELinux,因为默认下是没有开启FTP的支持,所以访问时都被阻止了
[root@JS-CCOD-HOST6 /]# setsebool ftp_home_dir 1
[root@JS-CCOD-HOST6 /]# getsebool -a|grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> on
ftpd_connect_db --> off
ftpd_use_fusefs --> off
ftpd_use_passive_mode --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_use_cifs --> off
tftp_use_nfs --> off
fastdfs运行rename 出现 error:5 input/ouput错误
- 此问题应该是磁盘有异常,最后是通过
fsck /dev/sdc1 -y
修复磁盘才解决,先取消挂断,然后执行此命令。
使用iftop命令查询程序所占用的带宽流量
iftop -BnP
无法格式化/dev/VG1/LV1 is apparently in use by the system; will not make a filesystem here!
启动kafka程序提供端口被占用,解决方法,重点如遇到有程序连接对应程序端口,则直接改掉该链接进程
- 现象是启动kafka服务,日志说端口被占用,然后使用
telnet -antlp
没有程序监听该端口
image.png
- 使用telnet程序才看有nginx代理监听的程序在链接该端口9092端口,
image.png
- 最后把nginx进程杀掉然后再启动,kafka程序,启动正常
网友评论