makdir php 并发报错_运维常见错误解决

错误 1

The program package-cleanup is found in the yum-utils package

# yum clean all # rpm --rebuilddb # yum update

使用解决方法仍然报错,根据错误信息 检查/etc/yum.conf确保 没有这行exclude=*.i386 *.i586 *.i686

结束

原来使用yum 安装软件时会自动安装上两个版本的,xxx.i386 与 xxx.x86_64 ,由于我使用的基本是64 位操作系统,所以在 /etc/yum.conf 屏蔽安装所有 i386 软件包,造成了这个错误。

错误2

login: PAM [dlerror: /lib/security/pam_limits.so: cannot open shared object file: No such file or directory]

解决方法

vim /etc/pam.d/login 修改  "session    required     /lib/security/pam_limits.so"  为 "session    required     /lib64/security/pam_limits.so"  重启

错误3

/usr/local/php/bin/phpize  Cannot find config.m4.  Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module

解决方法

# ls config0.m4  CREDITS    openssl.dsp  php_openssl.h  tests config.w32  openssl.c  openssl.mak  README         xp_ssl.c # ln -s config0.m4 config.m4 # ls config0.m4  config.w32  openssl.c    openssl.mak    README  xp_ssl.c config.m4   CREDITS     openssl.dsp  php_openssl.h  tests  # /usr/local/php/bin/phpize  Configuring for: PHP Api Version:         20041225 Zend Module Api No:      20060613 Zend Extension Api No:   220060519

#3.1 We selected 'Asia/Chongqing' for 'CST/8.0/no DST'

cat /etc/sysconfig/clock ZONE="Asia/Shanghai"  //修改一下php.ini的时区 date.timezone = Asia/Shanghai

错误4

Last login: Fri Mar 30 14:34:50 2012 from 172.0.0.50 id: cannot find name for group ID 525

useradd -g zm zm

或者

useradd -G zm zm

错误 5 netfilter 相关

Apr  1 13:29:24 haproxy_t kernel: nf_conntrack: table full, dropping packet. Apr  1 13:29:25 haproxy_t kernel: nf_conntrack: table full, dropping packet. Apr  1 13:29:25 haproxy_t kernel: nf_conntrack: table full, dropping packet. Apr  1 13:29:26 haproxy_t kernel: nf_conntrack: table full, dropping packet. Apr  1 13:29:32 haproxy_t kernel: possible SYN flooding on port 80. Sending cookies. Apr  1 13:30:32 haproxy_t kernel: possible SYN flooding on port 80. Sending cookies. Apr  1 13:31:32 haproxy_t kernel: possible SYN flooding on port 80. Sending cookies. Apr  1 13:32:32 haproxy_t kernel: possible SYN flooding on port 80. Sending cookies.

kernel: nf_conntrack: table full, dropping packet.

在/etc/sysctl.conf中加入:

net.ipv4.netfilter.ip_conntrack_max=655350

net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=1200

立即生效

sysctl -p

统计

wc -l /proc/net/ip_conntrack

34546 /proc/net/ip_conntrack

在/etc/sysctl.conf中加入:

net.nf_conntrack_max=100000

立即生效

sysctl -p

统计

wc -l /proc/net/nf_conntrack

51962 /proc/net/nf_conntrack

kernel 用 ip_conntrack 模块来记录 iptables 网络包的状态,并保存到 table 里(/proc/net/ip_conntrack|/proc/net/nf_conntrack),如果网络状况繁忙,比如高连接,高并发连接等会导致逐步占用这个 table 可用空间,一般这个 table 很大不容易占满并且可以自己清理,table 的记录会一直呆在 table 里占用空间直到源 IP 发一个 RST 包,但是如果出现被攻击、错误的网络配置、有问题的路由/路由器、有问题的网卡等情况的时候,就会导致源 IP 发的这个 RST 包收不到,这样就积累在 table 里,越积累越多直到占满,满了以后 iptables 就会丢包,出现外部无法连接服务器的情况。  知道问题就好办了,要么增加 table 容量以便能记录更多的连接信息(会消耗一点内存),要么就卸载 ip_conntrack 模块。

错误6 (编译 nrpe for nagios)

[root@three nrpe-2.13]# make all cd ./src/; make ; cd .. make[1]: Entering directory `/root/nagios/nrpe-2.13/src' gcc -g -O2 -I/usr/local/openssl/include/openssl -I/usr/local/openssl/include -DHAVE_CONFIG_H -o nrpe nrpe.c utils.c acl.c -L/usr/lib64  -lssl -lcrypto -lnsl -lwrap  nrpe.c: In function ‘main’: nrpe.c:218: warning: assignment discards qualifiers from pointer target type nrpe.c:251: warning: assignment makes pointer from integer without a cast /tmp/ccK17MBg.o: In function `main': /root/nagios/nrpe-2.13/src/nrpe.c:251: undefined reference to `get_dh512' collect2: ld returned 1 exit status make[1]: *** [nrpe] Error 1 make[1]: Leaving directory `/root/nagios/nrpe-2.13/src'  *** Compile finished ***  If the NRPE daemon and client compiled without any errors, you can continue with the installation or upgrade process.

原因

在/usr/local/目录下装有openssl,导致  配置时调用配置目录 -I/usr/local/openssl/include,而非系统自带

[root@three nrpe-2.13]# vim configure

行6630  去掉 /usr/local/openssl 即可,

如"for dir in $ssl_inc_dir $ssl_dir /usr/local/openssl /usr/local/ssl"

[root@three nrpe-2.13]# ./configure  #再次配置....[root@three nrpe-2.13]# make all

.... *** Compile finished ***                                      #通过

错误7 named  (zone test.com/IN: not loaded due to errors.)

原因

$ tail /var/log/messages May  7 10:42:00 one named[27080]: reading built-in trusted keys from file '/usr/local/named/etc/bind.keys' May  7 10:42:00 one named[27080]: using default UDP/IPv4 port range: [1024, 65535] May  7 10:42:00 one named[27080]: using default UDP/IPv6 port range: [1024, 65535] May  7 10:42:00 one named[27080]: sizing zone task pool based on 2 zones May  7 10:42:00 one named[27080]: reloading configuration succeeded May  7 10:42:00 one named[27080]: reloading zones succeeded May  7 10:42:00 one named[27080]: zone test.com/IN: NS 'ns1.test.com' has no address records (A or AAAA) May  7 10:42:00 one named[27080]: zone test.com/IN: not loaded due to errors. May  7 10:42:00 one named[27080]: all zones loaded May  7 10:42:00 one named[27080]: running

解决方法(注意ns1.test.com.的".")

$TTL 600  @       IN      SOA     ns1.test.com.   root.test.com. (         2009050401         3600         600         3600000         1800 ) @               IN      NS      ns1.test.com. ns1             IN      A       192.168.57.71 www             IN      A       192.168.57.71     monitor         IN      A       192.168.57.70

mysql (Column count of mysql.db is wrong. Expected 22, found 20. The table is probably corrupte)

120511 14:26:49 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. The table is probably corrupted 120511 14:26:49 [ERROR] mysql.user has no `Event_priv` column at position 29 120511 14:26:49 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.

错误8 keepalived ip address associated with VRID not present in received packet

原因

5913 May 16 15:26:04 ha02 Keepalived_vrrp: ip address associated with VRID not present in received packet : 192.168.57.75 5914 May 16 15:26:04 ha02 Keepalived_vrrp: one or more VIP associated with VRID mismatch actual MASTER advert 5915 May 16 15:26:04 ha02 Keepalived_vrrp: bogus VRRP packet received on eth0 !!! 5916 May 16 15:26:04 ha02 Keepalived_vrrp: VRRP_Instance(VI_1) ignoring received advertisment... 5917 May 16 15:26:05 ha02 Keepalived_vrrp: ip address associated with VRID not present in received packet : 192.168.57.75 5918 May 16 15:26:05 ha02 Keepalived_vrrp: one or more VIP associated with VRID mismatch actual MASTER advert 5919 May 16 15:26:05 ha02 Keepalived_vrrp: bogus VRRP packet received on eth0 !!! 5920 May 16 15:26:05 ha02 Keepalived_vrrp: VRRP_Instance(VI_1) ignoring received advertisment..

解决方法

在同一网段内virtual_router_id 值不能相同,如果相同会在messages中收到VRRP错误包 所以需要更改 virual_router_id

fdisk /dev/sdb  (用你的硬盘位置代替/dev/sdb)  有提示后输入 x 回车, 在命令列表中会有一项 f   fix partition order 输入 f 回车 成功会提示 done. 然后输入 p 回车,查看调整后的分区表 最后输入 w 回车,这个命令是将之前的操作写入硬盘 重启之后就会启用新的分区表。

因为我的电脑是Ubuntu的,开机用的是grub引导,而grub就放在Ubuntu里的/boot/grub下。由于我修复分区顺序,导致grub找不到原先的Ubuntu所在分区,自然就找不到/boot/grub了,因此解决这个问题很简单,只要把grub和/boot/grub对应上就可以了。

2 编辑 /boot/grub/grub.cfg

替换原来分区比如, 旧的是 hd0,msdos8 替换成 hd0,mdos6

3 重装grub

grub-install /dev/sda

错误11 /lib/modules/2.6.32-71.el6.x86_64/build: No such file or directory. Stop.

//如果出现如下错误 make: *** /lib/modules/2.6.32-71.el6.x86_64/build: No such file or directory. Stop.  //进去相关的目录看,这个文件是个软链接,显示位红色,说明链接未成功,用一下命令重新链接一次就OK了 ln -s ../../../usr/src/kernels/2.6.32-71.29.1.el6.x86_64/ build

错误12  php

upload_max_filesize = 2M  //上传附件大小限制在2M

vim /etc/php.ini upload_max_filesize = 16M

错误13 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

修改  /etc/ssh/ssh_config

vim  /etc/ssh/ssh_config

GSSAPIAuthentication no

错误14

方法1 :我在arm上通过NFS共享文件时出现下面的错误提示nfs:server is not responding,still trying原因分析:NFS 的默认传输协议是 UDP,而PC机与嵌入式系统通过UPD交互时就会出现严重的网卡丢包现象。解决方法:在客户端改用TCP协议,使用下面的命令,#mount -o tcp 10.10.19.25:/home/export /mnt/local方法2:在目标板上通过NFS复制PC机上较大文件到目标板上的时候遇到的问题:nfs: server *** not responding, still trying修改方法:nfs mount时候出现的NFS崩溃,按照以下的方式mountmount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.1.3/root/somedir /client

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Spark中将计算结果写入MySQL时,可能会遇到并发问题。下面是一些常见问题及解决方法: 1. 插入重复数据:如果在并行处理过程中,多个任务尝试将相同的数据插入到MySQL中,可能会导致插入重复数据的问题。解决方法是使用MySQL的唯一约束或主键来避免插入重复数据。 2. 数据丢失:如果在并行处理过程中,多个任务尝试同时更新相同的数据,可能会导致数据丢失问题。解决方法是使用MySQL的事务隔离级别来保证数据一致性。 3. 性能问题:如果并发写入MySQL的数量过多,可能会导致性能下降。解决方法是使用连接池来管理MySQL连接,以便重用连接,避免频繁创建和销毁连接。 下面是一个Spark计算结果写入MySQL的示例: ```scala import java.sql.{Connection, DriverManager, PreparedStatement} import org.apache.spark.sql.{DataFrame, SparkSession} object SparkWriteToMysql { def main(args: Array[String]): Unit = { val spark = SparkSession.builder() .appName("SparkWriteToMysql") .master("local[*]") .getOrCreate() // 读取数据 val df: DataFrame = spark.read .option("header", "true") .csv("data.csv") // 写入MySQL df.foreachPartition(partition => { // 获取MySQL连接 val conn: Connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "password") // 批量插入数据 val sql: String = "INSERT INTO test_table (col1, col2) VALUES (?, ?)" val pstmt: PreparedStatement = conn.prepareStatement(sql) partition.foreach(row => { pstmt.setString(1, row.getAs[String]("col1")) pstmt.setString(2, row.getAs[String]("col2")) pstmt.addBatch() }) pstmt.executeBatch() // 关闭连接 pstmt.close() conn.close() }) spark.stop() } } ``` 在这个示例中,我们使用了`foreachPartition`操作,将DataFrame的每个分区并行写入到MySQL中。我们使用`DriverManager`获取MySQL连接,并使用`PreparedStatement`批量插入数据。最后,我们关闭连接,并停止SparkSession。 请注意,这个示例并没有处理并发问题,您需要根据您的具体情况进行适当的处理。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值