最近产品提了一个在线音视频直播的需求,技术这边主要是java开发,这让我想起了3年前使用的一款red5的开源流媒体服务器,下面会对开发中使用内容进行说明.
red5介绍
Red5是使用java写的开源的Flash流媒体服务器,它支持以下内容:
- 将视频/音频文件转化为播放流(支持FLV和MP3)
- 录制客户端播放流(仅支持 FLV)
- 共享对象
- 现场直播流发布
- 远程调用(AMF)
最近产品提了一个在线音视频直播的需求,技术这边主要是java开发,这让我想起了3年前使用的一款red5的开源流媒体服务器,下面会对开发中使用内容进行说明.
Red5是使用java写的开源的Flash流媒体服务器,它支持以下内容:
今天在测试程序的时候发现一个诡异的spring异常,此异常在IDE调试中不存在,但在测试环境中打包后即出现,错误日志如下
1 2 3 4 |
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx] Offending resource: class path resource [applicationContext.xml] |
今天在发布线上版本的时候发现一个rmi的异常,开始一看以为是客户端配置出错,但检查配置后发现配置无异常.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
org.springframework.beans.factory.support.DefaultListableBeanFactory[line:242]- Returning cached instance of singleton bean 'callbackService' org.springframework.remoting.rmi.RmiClientInterceptorUtils[line:182]- Remote service [rmi://10.77.7.49:9200/callbackService] threw exception java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178) at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132) at $Proxy24.invoke(Unknown Source) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:398) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:344) at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:259) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy23.process(Unknown Source) at java.lang.Thread.run(Thread.java:662) |
MySQL启动时提示Timeout error occurred trying to start MySQL Daemon
解决办法:执行/usr/bin/mysql_install_db,修复下就OK了.
启动后发现所有的数据表都无法使用,查看MySQL异常日志,发现如下log
1 2 3 4 5 6 7 8 9 10 11 12 13 |
InnoDB: Error: cannot allocate 17179885568 bytes of InnoDB: memory with malloc! Total allocated memory InnoDB: by InnoDB 45007312 bytes. Operating system errno: 12 InnoDB: Check if you should increase the swap file or InnoDB: ulimits of your operating system. InnoDB: On FreeBSD check you have compiled the OS with InnoDB: a big enough maximum process size. InnoDB: Note that in most 32-bit computers the process InnoDB: memory space is limited to 2 GB or 4 GB. InnoDB: We keep retrying the allocation for 60 seconds... InnoDB: Fatal error: cannot allocate the memory for the buffer pool |
原因:这个报错的大意是,内存基本耗尽,没有再可以分配的内存.
解决办法:查看/etc/my.cnf,找innodb_buffer_pool_size,发现设值已经超过了系统总内存,然后重新设置为系统内存1半,即innodb_buffer_pool_size = 6144M 重启MySQL就OK了.
to be continued…