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
[apex@iZ25dpcl2laZ ~]$ curl members.3322.org/dyndns/getip
111.111.111.111
pd -eL |wc -l #查询进程数量
vim /etc/security/limits.d/90-nproc.conf
* soft nproc 1024 #修改普通用户的进程数
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 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有两种访问模式,一种为被动模式,一种主动模式,你看看你的IE是不是设置了被动模式。打开IE,“工具”——“Internet选项”——“高级”,“使用ftp被动模式”前面的勾去掉,
堆栈是就是一段连续分配的内存空间。在一个程序中,会声明各种变量。静态全局变量是位于数据段并且在程序开始运行的时候被加载。而程序的动态的局部变量则分配在堆栈里面。
[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
Code:
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-105.el7
Installed: glibc-common-2.17-106.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
此命令是降级
yum downgrade glibc glibc-common glibc-devel glibc-headers -y
export LANG="zh_CN.GBK" #当前 xshell当中
HTTP request sent, awaiting response... 403 Forbidden
问题解析1、首先看访问目录是否有权限,没有则赋权 chmod -R 777
2、 修改nginx配置nginx配置文件
user nobody #默认使用次用户等了
改成:user root
重启nginx 问题解决
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
[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
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:
...
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
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:
...
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
yum install -y xterm xorg-x11-xauth
运行命令:/usr/bin/xterm -ls -display $DISPLAY
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
Too many open files
打开文件数过多worker_rlimit_nofile 15360
user root;
vsftpd 500 OOPS: cannot change directory:/home/umg
[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
fsck /dev/sdc1 -y
修复磁盘才解决,先取消挂断,然后执行此命令。iftop -BnP
/dev/VG1/LV1 is apparently in use by the system; will not make a filesystem here!
telnet -antlp
没有程序监听该端口telnet -antlp
没有程序监听该端口rsync --delete-before --force -r empty/ app/
out of memory
异常SQL> startup;
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
1、修改/etc/sysctl.conf文件,然后sysctl -p 刷新加载
fs.file-max = 6815744
kernel.shmall = 16252928
kernel.shmmax = 66571993088
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
2、清理内存的缓存
echo 3 > /proc/sys/vm/drop_caches
3、然后正常启动oracle
df -h
命令showmount -a nfsserverip
可以查询对应的客户端挂载[root@Recordings_Array_Backup ~]# showmount -a 10.100.0.236
All mount points on 10.100.0.236:
10.100.0.39:/Data
netcat 有一个 -e 参数,可以在连接建立的时候执行一个程序,并把它的标准输入输出重定向到网络连接上来,于是我们可以在 A 主机上 -e 一下 bash: 就可以进行xshell交互了
安装ncat
yum -y install nmap-ncat
[root@iz2zef9ue9eyhxgv73eeekz tmp]# ncat -l -p 9999 -e /bin/bash
[slee@ALY_YU15 ~]$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:12:D9:30
inet addr:192.168.128.53 Bcast:192.168.255.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10484259162 errors:0 dropped:0 overruns:0 frame:0
TX packets:10962046194 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1075296441852 (1001.4 GiB) TX bytes:3155803901275 (2.8 TiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:302295134251 errors:0 dropped:0 overruns:0 frame:0
TX packets:302295134251 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:37947952182894 (34.5 TiB) TX bytes:37947952182894 (34.5 TiB)
[slee@ALY_YU15 ~]$ nc 172.18.10.188 9999
ifconfig
br-45f46bc43ed0: flags=4163 mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
ether 02:42:54:4a:24:a7 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-bcf7b0c33525: flags=4163 mtu
nc -v -v -w1 -z 192.168.127.4 8080-9000
解析说明:两次 `-v` 是让它报告更详细的内容,`-w1` 是设置扫描超时时间为 1 秒。
return:
[root@ALY_YU15 ~]# nc -v -v -v -w1 -z 192.168.127.4 8080-9000
nc: connect to 192.168.127.4 port 8080 (tcp) failed: Connection refused
nc: connect to 192.168.127.4 port 8081 (tcp) failed: Connection refused
Connection to 192.168.127.4 8082 port [tcp/us-cli] succeeded!
nc: connect to 192.168.127.4 port 8083 (tcp) failed: Connection refused
nc: connect to 192.168.127.4 port 8084 (tcp) failed: Connection refused
nc: connect to 192.168.127.4 port 8085 (tcp) failed: Connection refused
Connection to 192.168.127.4 8086 port [tcp/d-s-n] succeeded!
nc: connect to 192.168.127.4 port 8087 (tcp) failed: Connection refused
nc: connect to 192.168.127.4 port 8088 (tcp) failed: Connection refused
nc: connect to 192.168.127.4 port 8089 (tcp) failed: Connection refused
Connection to 192.168.127.4 8090 port [tcp/*] succeeded!
Connection to 192.168.127.4 8091 port [tcp/jamlink] succeeded!
nc: connect to 192.168.127.4 port 8092 (tcp) failed: Connection refused
nc: connect to 192.168.127.4 port 8093 (tcp) failed: Connection refused
nc -l -p 8080
nc 192.168.1.2 8080
两边就可以会话了,随便输入点什么按回车,另外一边应该会显示出来,注意,openbsd 版本 netcat 用了 -l 以后可以省略 -p 参数,写做:nc -l 8080 ,但在 GNU netcat 下面无法运行,所以既然推荐写法是加上 -p 参数,两个版本都通用。
老版本的 nc 只要 CTRL+D 发送 EOF 就会断开,新版本一律要 CTRL+C 结束,不管是服务端还是客户端只要任意一边断开了,另一端也就结束了,但是 openbsd 版本的 nc 可以加一个 -k 参数让服务端持续工作。
那么你就可以先用 nc 监听 8080 端口,再远端检查可用,然后又再次随便监听个 8081 端口,远端检测不可用,说明你的安全策略配置成功了,完全不用安装任何累赘的服务。
nc -l -p 8080 > image.jpg
nc 192.168.1.2 8080 < image.jpg
/bin/nc.openbsd -N 192.168.1.2 8080 < image.jpg
你机器上的 nc 命令有可能指向 /bin/nc.traditional 或者 /bin/nc.openbsd 任意一个,这里显示指明调用 openbsd 版本的 netcat。
这样在 openbsd 新版本的 netcat 中使用 -N参数,就不需要再开个终端去手工检查传输是否完成,传输结束了就会自动退出。其实 GNU 版本的 netcat 也有可以加个 -q0 参数,达到和 openbsd 版本 -N 的效果:
/bin/nc.traditional -q0 192.168.1.2 8080 < image.jpg
#替换为官方Vault源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Official.repo
#替换为阿里云Vault镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Aliyun.repo
limit_req_zone $binary_remote_addr zone=one:10m rate=100r/s;” 对所有访问IP的请求超过每秒100个请求时将触发限制,超过的着等待。
1.10m表示计数器内存占用空间;
2.100r/s表示上限为每秒100次请求;
修改的部分如下:
1、在http中增加了:“limit_req_zone $binary_remote_addr zone=one:10m rate=100r/s;” 对所有访问IP限制每秒10个请求的出发条件;
2、location 中 增加了 location /ws4update {…… limit_req zone=one burst=1 nodelay; ……} 部分,nginx日志中跳转登陆部分。 执行的动作,对应http中zone的名称;
location /g10 {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://server_g10;
limit_rate_after 500k; #单个连接下载达到500K,之后下面那个参数就降速到400Kb,每秒的下载速度。
limit_rate 400k;
}
PRGDIR=`dirname "$PRG"` #在此行下面添加目录下判断
if [ -z "$CATALINA_PID" ]; then
CATALINA_PID=$PRGDIR/CATALINA_PID
usleep
fi
#exec "$PRGDIR"/"$EXECUTABLE" stop "$@" 原来基础上加多-force exec "$PRGDIR"/"$EXECUTABLE" stop -force "$@"
[test@kubernetes-node2 bin]$ ./shutdown.sh
13847
Using CATALINA_BASE: /home/test/apache-tomcat-7.0.105
Using CATALINA_HOME: /home/test/apache-tomcat-7.0.105
Using CATALINA_TMPDIR: /home/test/apache-tomcat-7.0.105/temp
Using JRE_HOME: /home/test/jdk1.8.0_161
Using CLASSPATH: /home/test/apache-tomcat-7.0.105/bin/bootstrap.jar:/home/test/apache-tomcat-7.0.105/bin/tomcat-juli.jar
Using CATALINA_PID: /home/test/apache-tomcat-7.0.105/bin/CATALINA_PID
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file /home/dms/apache-tomcat-7.0.105/bin/logs/gc.log due to No such file or directory
Tomcat stopped.
[test@kubernetes-node2 bin]$ jps
21327 Jps
bigint
即可global_defs {
router_id ceb-yu1 #在集群中唯一
}
vrrp_instance VI_1 {
state MASTER
interface eth0
#unicast peer 格式必须完全匹配!否则会起不来,必须写成三行。
unicast_peer {
192.168.27.34 #该单播地址必须配置对应集群中的ip,非VIP地址
}
virtual_router_id 45
priority 67 advert_int 1
authentication {
auth_type PASS
auth_pass 2222
}
virtual_ipaddress {
192.168.27.226 dev eth0
}
}
global_defs {
router_id ceb-yu2 #在集群中唯一
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
#unicast peer 格式必须完全匹配!否则会起不来,必须写成三行。
unicast_peer {
192.168.27.121 #该单播地址必须配置对应集群中的ip,非VIP地址
}
virtual_router_id 45
priority 66
advert_int 1
authentication {
auth_type PASS
auth_pass 2222
}
virtual_ipaddress {
192.168.27.226 dev eth0
}
}
tcpdump -nn -i any net 192.168.27.0/24|grep vrid
--with-stream
该模块支持tcp和udp协议的代理./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-stream
nginx: [emerg] "stream" directive is not allowed here in
stream
{
server {
listen 3478 udp reuseport;
proxy_pass 123.56.27.245:3478;
}
server {
listen 443;
proxy_pass 123.56.27.245:443;
}
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" xxxxx"$http_entid"-"$http_agentid"-"$upstream_addr"';
server{
listen 80;
server_name mirrors.aliyun.com;
location ~ ^/*{
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
chunked_transfer_encoding off;
proxy_pass http://mirrors.aliyun.com;
client_max_body_size 512m;
}
}
# 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-6.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
[root@ccod_sg vhosts]# vim /etc/hosts
192.168.0.132 mirrors.aliyun.com
[root@JS-CCOD-UCDS ~]# vim /etc/mtab #把对应的nfs挂载删除调即可。
后台运行
1.screen -S yourname: 新建一个会话 eg: screen -S sipp1
2.screen -ls:列出当前所有会话
3.screen -r yourname:回到这个会话
4.Ctrl+A +D: 退出screen
"msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"}问题
这个错误信息表明目标系统需要安装Python的SELinux绑定库(libselinux-python)才能成功进行操作。
为了解决此错误,请使用以下命令安装所需的Python包:
在CentOS系统中安装SELinux python bindings
sudo yum install libselinux-python
在Debian或Ubuntu系统中安装SELinux python bindings:
sudo apt-get install python-selinux
这将安装SELinux的必要Python绑定,使操作可以成功进行而不会发生错误。
`--eval` 是 MongoDB Shell 启动时的一个参数,可以使用该参数执行一段 JavaScript 代码。
以下是一个使用 `--eval` 参数查询数据的示例:
假设有一个名为 `students` 的集合,其中包含了一些学生的信息。我们可以使用以下命令查询名称为 `Tom` 的学生信息:
mongo --eval 'db.students.find({name: "Tom"})' dbname
其中,`dbname` 是数据库名称。
以上命令会启动 MongoDB Shell,然后执行 JavaScript 代码 `db.students.find({name: "Tom"})`,返回所有名称为 `Tom` 的学生信息。
需要注意的是,使用 `--eval` 参数执行代码时需要注意安全性问题,应避免执行恶意代码。建议在生产环境中使用其他方式执行代码和查询数据。
tldr 命令行工具显示简化的命令用法信息,主要包括示例。它是作为社区项目 tldr pages 的客户端。
这个工具不能代替 man。man 页面仍然是许多工具规范而完整的信息源。然而,在某些情况下,man 提供的信息太多了。有时候,你不需要一个命令的所有信息;你只是试着记住基本的选项。例如,curl 命令的 man 页面几乎有 3000 行。相反,curl 的 tldr 页面只有 40 行,如下所示:
yum进行安装
[root@flink1 ~]# yum -y install tldr
[root@flink1 ~]# tldr awk
awk
A versatile programming language for working on files.
More information: https://github.com/onetrueawk/awk.
- Print the fifth column (a.k.a. field) in a space-separated file:
awk '{print $5}' path/to/file
- Print the second column of the lines containing "foo" in a space-separated file:
awk '/foo/ {print $2}' path/to/file
- Print the last column of each line in a file, using a comma (instead of space) as a field separator:
awk -F ',' '{print $NF}' path/to/file
- Sum the values in the first column of a file and print the total:
awk '{s+=$1} END {print s}' path/to/file
- Print every third line starting from the first line:
awk 'NR%3==1' path/to/file
- Print different values based on conditions:
awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' path/to/file
- Print all lines where the 10th column value equals the specified value:
awk '($10 == value)'
- Print all the lines which the 10th column value is between a min and a max:
awk '($10 >= min_value && $10 <= max_value)'
[root@flink1 ~]# yum -y install ncdu
[root@flink1 home]# ncdu /home/flink/
--- /home/flink -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7.7 GiB [###########################] /hadoop-3.3.2
5.4 GiB [################## ] /zookeeper-3.4.14
2.6 GiB [######## ] /BAK
1.8 GiB [###### ] /flink-1.12.4
1.1 GiB [### ] /kafka_2.11-2.3.1
362.4 MiB [# ] /jdk1.8.0_131
44.0 KiB [ ] .bash_history
24.0 KiB [ ] hs_err_pid19988.log
24.0 KiB [ ] hs_err_pid30490.log
24.0 KiB [ ] hs_err_pid27390.log
24.0 KiB [ ] hs_err_pid25531.log
24.0 KiB [ ] hs_err_pid4484.log
24.0 KiB [ ] hs_err_pid898.log
24.0 KiB [ ] hs_err_pid32385.log
16.0 KiB [ ] /.ssh
12.0 KiB [ ] .viminfo
4.0 KiB [ ] .bash_profile_bak
4.0 KiB [ ] .bash_profile
4.0 KiB [ ] .bashrc
4.0 KiB [ ] /.oracle_jre_usage
4.0 KiB [ ] .bash_logout
Total disk usage: 18.9 GiB Apparent size: 37.8 GiB Items: 84519
[storm@ccod_mongodb_2 bin]$ ./zkCli.sh
[zk: localhost:2181(CONNECTED) 0] addauth digest admin:123456 #admin为用户名, 123456为密码。
[zk: localhost:2181(CONNECTED) 1] setAcl / auth:admin:123456:cdrwa
[zk: localhost:2181(CONNECTED) 2] getAcl /
'digest,'admin:0uek/hZ/V9fgiM35b0Z2226acMQ=
: cdrwa
[storm@ccod_mongodb_2 bin]$ ./zkCli.sh #登录连接成功后每次连接需要输入 addauth digest admin:123456
[zk: localhost:2181(CONNECTED) 0] ls /
Insufficient permission : /
[zk: localhost:2181(CONNECTED) 1] addauth digest admin:123456
[zk: localhost:2181(CONNECTED) 2] ls /
[test, zookeeper]
(crontab -l;echo "0 1 * * * sh /tmp/abc.sh > /dev/null 2>&1") | crontab -
crontab -l
crontab -l | grep -v "abc.sh" | crontab