随笔:3 文章:9 评论:3 引用:0

发新文章 联系 聚合管理

2009年6月12日

更新后的内核,每次启动均会报错:

one or more disks are failing

系统运行过程中,经常会出异常,更甚者,系统突然注销掉。。。

期待有朋友能够给出建议或解决方案

重新启动更新前的内核,系统运行正常了,先用着吧,哈哈。

posted @ 2009-07-03 17:15 k-jong 阅读(403) | 评论 (0)编辑 收藏
 
fedora eclipse突然无法正常启动,不知是fedora版本自身不稳定,还是其他异常。

解决过程:

1、User为普通用户下,

  • 删除${ECLIPSE}/configuration下除config.ini下所有其他启动自生成文件。重启Eclipse。
  • fedora终端命令行启动eclipse。

2、su用户至root(Eclipse之前是通过yum install eclipse安装的),

  • 删除${ECLIPSE}/configuration下除config.ini下所有其他启动自生成文件。
  • 命令行启动eclipse,configuration目录下自动生成org.eclipse.osgi等。
  • su用户至普通用户,启动eclipse,正常。
3、为避免Sun JDK可能带来的异常及与fedora eclipse兼容性等,修改eclipse.ini,在第一行设置vm参数:

-vm
/usr/local/**/jdk1.6.0_13/jre/bin/java

Eclipse正常启动了,但仍感觉有些困惑,呵呵。
Anyway, it works.

posted @ 2009-07-03 10:09 k-jong 阅读(595) | 评论 (0)编辑 收藏
 
[工作环境:fedora 11]

1、连接双方,启动sshd服务。
/etc/init.d/sshd status
/etc/init.d/sshd start/stop/restart

2、与另一机器建立ssh连接。
ssh 10.*.*.*
#提示输入root密码
password for root: ******

3、scp实现连接双方的信息交流,含文件读写、交换等操作。
#拷贝对方机器/etc/my.cnf文件至本地/tmp/my.cnf
scp root@10.*.*.*:/etc/my.cnf /tmp/my.cnf

#拷贝本地/etc/my.cnf文件至对方/tmp/my.cnf
scp /etc/my.cnf root@10.*.*.*:/tmp/my.cnf

注: 执行过程中需要root用户密码验证。

posted @ 2009-07-02 14:53 k-jong 阅读(257) | 评论 (0)编辑 收藏
 

JXTA技术简介(参考JXSE_ProgGuide_V2.5

 

JXTA目的是使网络中的各种设备(传感器,手机,pda,笔记本等)相互连接通信,JXTA是一种协议,而不是一种语言!因此JXTA是不依赖于具体平台的,但是当前的JXTA协议

是在java开发的,好像有(j2me版本)

 

JXTA协议标准化了关于peers的几种行为:

1)互相发现

2)自组织peer

3)广告以及发现资源(在JXTA网络中,资源包括了很多含义:peers,管道,groups等)

4)相互通信

5)检测对方

 

利用JXTA,可以容易实现以下几个方面的互操作p2p程序

1)相互发现peers,不管peers是在防火墙还是NATs

2)互相共享资源

3)查找内容

4)创建组(组是基于一定共同目的的集合)

5)远程操作peer

6)安全通信


Jxta协议栈


JXTA core Service

封装基本的p2p网络功能,包括发现,互相通信(越过防火墙,NATs),创建组,建立安全通信

Services Layer

Applications Layer


JXTA peers可以分成3种基本类型

1 Minimal_Edge peers:仅仅提供基本的JXTAService,并且需要依赖于其他peers来参与到JXTA网络

2 Full_Edge peers:提供所有core service以及标准jxta功能,这些节点包括phonespcs

3 super peer(个人理解是用于为jxta通信服务,为了帮助穿越防火墙以及NATs

  1Relay用于帮助不能直接连接的peer来存储以及传输信息(例如防火墙,NATs

  2Rendezvous用于存储广告信息以及所以,帮助节点来响应查询广告信息,更重要的是该节点维护网络的拓扑结构,用于控制分发信息路径。

  3) proxy:帮助Minimal_Edge peers来接入jxta网络

解释:

Relay主要用于穿透防火墙,以及穿透NATs,穿透防火墙的一个例子如下:


A先通过HttP穿透防火墙与C相连,BC之间可以使用其他协议(TCP\IPHTTP等)

所以AB就可以通过这种方式相连,在JXTA中,应该是利用管道信息来保存这样一条传输路径,来屏蔽下层的具体相连方式。另外,如果网络中一个peerNat或防火墙内部,就必须设置一个Relay来相连,否则应该无法连接出去(暂时理解,待深入探讨),在JXTAshell中就可以看到有一个Advanced 选项来设置Relay

 Rendezvous 用来存储广告信息以及维护拓扑结构,Rendezvous之间可以互相交互拓扑信息,存储广告信息的索引,是查询广告更加容易,一个注意的地方是:Rendezvous只是存储广告信息的索引,它不响应查询信息,如果收到查询信息,Rendezvous会查找索引,然后向目标机器发送信息,要求其直接回复查询信息。如果Rendezvous没有该索引,Rendezvous就会通过算法来查找索引。


主要内容转载在:http://blog.csdn.net/binghuazh/archive/2009/02/22/3923709.aspx


posted @ 2009-07-01 10:51 k-jong 阅读(419) | 评论 (0)编辑 收藏
 

1. 官方配置参考:jxta-jxse.dev.java.net/confighelp.html

2. JXTA是SUN Microsystem Inc.主持开发的开源P2P通用平台,目的是使各种P2P应用能够使用统一的网络协议进行互联与通信.

首次启动JXTA应用时,系统要求进行网络配置。再次启动应用时,系统将会调用存储于本地的网络配置信息。

       

->具有独立ip的用户
   左图Advanced窗体中, HTTP Settings中Enable Incoming Connections.

->NAT内部用户
   在“Rendezvous/Relay”窗体(图7)下部的“Relay Settings”中选中“Use a relay,点击“OK”按钮即可。

->访问协议或端口受防火墙限制的用户
   对于某些企业内部访问协议和端口受限的用户,一般需要通过能不受限访问Internet的计算机作为JXTA的Relay节点(即在该计算机上运行JXTA平台,并在进行JXTA网络配置时选中“Advanced”窗体下部的“Service Settings”中的”Act as a Relay”选项),把该Relay节点按独立IP用户方式进行配置,而且防火墙内部的用户需要把作为JXTA Relay节点的IP和端口填入右图中相应的“Relay seed peers”列表中。

->具有多个网络连接的用户
   某些用户的计算机可能具有多个IP地址,既有内网IP又有公网IP。此时,如果按上述配置方式无法将JXTA应用联入Internet,可尝试在图6中“Public Address”提示位置手动输入该计算机可用的公网IP。

->在同一台计算机上运行多个JXTA应用
   允许多个JXTA应用在一台计算机上同时运行,但必须在配置JXTA网络时为每个JXTA应用设置不同的端口选项(左图中“Manual”提示位置)。

3. 配置参考:http://security.riit.tsinghua.edu.cn/Freegame/index.html

posted @ 2009-06-30 22:02 k-jong 阅读(1448) | 评论 (3)编辑 收藏
 
Firewalls and NAT
A peer behind a firewall can send a message directly to a peer outside a firewall, but a peer outside the firewall cannot
establish a direct connection with a peer behind the firewall. The same 
is true for peers which are behind a NAT
device.
In order 
for JXTA peers to communicate with each other across a firewall, the following conditions must exist:
              At least one peer 
in the peer group inside the firewall must be aware of at least one peer outside of the
          •
              firewall.
              The peer inside 
and the peer outside the firewall must be aware of each other and must support a
          •
              common transport (HTTP 
or TCP).
              The firewall, at the very least, has to allow outbound HTTP 
or TCP connections. Figure 4-3 depicts a
          •
              typical message routing scenario through a firewall. In this scenario, JXTA Peers A 
and B want to pass a
              message, but the firewall prevents them 
from communicating directly. JXTA Peer A first makes a
              connection to Peer C using a protocol such as HTTP that can penetrate the firewall. Peer C then makes a
              connection to Peer B using a protocol such as TCP
/IP. A virtual connection is now made between Peers
              A 
and B.
posted @ 2009-06-30 17:27 k-jong 阅读(331) | 评论 (0)编辑 收藏
 
su root

(1)安装配置:
[root@fedora11 /]# vi /boot/grub/grub.conf

# grub.conf generated by anaconda
#
#
 Note that you do not have to rerun grub after making changes to this file
#
 NOTICE:  You do not have a /boot partition.  This means that
#
          all kernel and initrd paths are relative to /, eg.
#
          root (hd0,8)
#
          kernel /boot/vmlinuz-version ro root=/dev/sda9
#
          initrd /boot/initrd-version.img
#
boot=/dev/sda
default=0
timeout
=5
splashimage
=(hd0,8)/boot/grub/splash.xpm.gz
#hiddenmenu
title Fedora (2.6.29.4-167.fc11.i686.PAE)
        root (hd0,
8)
        kernel 
/boot/vmlinuz-2.6.29.4-167.fc11.i686.PAE ro root=UUID=821394be-299e-441e-9a8e-8e84e0d03267 rhgb quiet
        initrd 
/boot/initrd-2.6.29.4-167.fc11.i686.PAE.img
title Windows
        rootnoverify (hd0,0)
        chainloader 
+1
(2)JDK环境配置:
fedora默认已安装OpenJDK,查看:
which java
whereis java
删除OpenJDK及其关联的插件等,
rpm ---nodeps OpenJDK_**.rpm
rpm 
---nodeps **.rpm
安装sun JDK,
sh jdk_*.bin
or
.
/jdk_*.bin

mv jdk_* /usr/local/
编辑/etc/profile:
#文件末尾添加
export JAVA_HOME=/usr/local/jdk_*
export PATH
=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export CLASSPATH
=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

source /etc/profile      #环境变量生效
(3)安装eclipse:
yum install eclipse
安装成功,启动eclipse,
eclipse
查看eclipse安装位置等,
which eclipse
whereis eclipse
因安装的为fedora eclipse,之前配置的Sun JDK环境会报错,即Selinux报错:..../client/libjvm.so权限不够。。,selinux_alert0626.txt
解决方法:
chcon -t
textrel_shlib_t 
'/usr/local/javadev/jdk1.6.0_13/jre/lib/i386/client/libjvm.so'

semanage fcontext 
--t textrel_shlib_t
'/usr/local/javadev/jdk1.6.0_13/jre/lib/i386/client/libjvm.so'

(4)时间同步
[root@fedora11 /]# /usr/bin/rdate -s time-b.nist.gov
[root@fedora11 /]# /usr/sbin/ntpdate 133.100.11.8
26 Jun 16:10:35 ntpdate[6005]: step time server 133.100.11.8 offset 0.559171 sec

posted @ 2009-06-26 16:50 k-jong 阅读(597) | 评论 (0)编辑 收藏
 
linux下启动mysql服务,即mysqld:
1 /etc/init.d/mysql start   # 自动调用/etc/my.cnf文件进行参数初始化
2 $ mysqld_safe -uroot &      # 调用mysqld初始化方式
3 $ mysqld -uroot       #
其中,mysql数据库表结构等文件存放在/var/lib/mysql下;若/etc/my.cnf不存在,可从mysql安装目录/usr/share/mysql/下复制my-large.cnf(或其他)至/etc下,然后改名为my.cnf即可。

默认情况下,mysql服务的每个连接,当客户端连续8小时没有操作时,mysql将自动关闭该连接,从而造成了数据库服务的不可用。
解决方案——mysqld带参数(wait_timeout, interactive_timeout)启动:
mysqld --wait_timeout=2592000 --interactive_timeout=2592000 -uroot
注:须同时修改wait_timeout和interactive_timeout参数,方可生效。
posted @ 2009-06-22 18:12 k-jong 阅读(1346) | 评论 (0)编辑 收藏
 
From Java vm specification:
A class can be declared strictfp to indicate that all expressions in the methods of the class are FP-strict (§2.18), whether or not the methods themselves are declared FP-strict.

strictfp-Java关键字, 即 strict float point (精确浮点)。
  strictfp 关键字可应用于类、接口或方法。使用 strictfp 关键字声明一个方法时,该方法中所有的float和double表达式都严格遵守FP-strict的限制,符合IEEE-754规范。当对一个类或接口使用 strictfp 关键字时,该类中的所有代码,包括嵌套类型中的初始设定值和代码,都将严格地进行计算。严格约束意味着所有表达式的结果都必须是 IEEE 754 算法对操作数预期的结果,以单精度和双精度格式表示。

在Java虚拟机进行浮点运算时,如果没有指定strictfp关键字时,Java的编译器以及运行环境在对浮点运算的表达式是采取一种近似于我行我素的行为来完成这些操作,以致于得到的结果往往无法令你满意。而一旦使用了strictfp来声明一个类、接口或者方法时,那么所声明的范围内Java的编译器以及运行环境会完全依照浮点规范IEEE-754来执行。
如果你想让你的浮点运算更加精确,而且不会因为不同的硬件平台所执行的结果不一致的话,可以用关键字strictfp。
可以将个类、接口以及方法声明为strictfp,但是不允许对接口中的方法以及构造函数声明strictfp关键字。
posted @ 2009-06-13 16:05 k-jong 阅读(284) | 评论 (0)编辑 收藏
 
解决方案:
Java Keytool生成数字证书:
keytool -genkey -alias webmin.com -keyalg RSA
 -keystore /home/demo/webminkey -validity 365
中,RSA-非对称加密-validity 365:证书有效期为365天,keytool默认生成的有效期为90天。

Jetty服务器配置config.xml:<?xml version="1.0" encoding="UTF-8"?>
<MetaData xmlns="http://www.osgi.org/xmlns/metatype/v1.0.0">
    
<OCD name="%configurationName" id="server.config" description="%configurationDescription">
        
<AD id="http.enabled" type="Boolean" default="true"/>
        
<AD id="http.port" type="Integer" default="0"/>
        
<AD id="http.host" type="String" cardinality="1"/>
        
<AD id="https.enabled" type="Boolean" default="false"/>
        
<AD id="https.port" type="Integer" default="0"/>
        
<AD id="https.host" type="String" cardinality="1"/>
        
<AD id="ssl.keystore" type="String" cardinality="1"/>
        
<AD id="ssl.password" type="String" cardinality="1"/>
        
<AD id="ssl.keypassword" type="String" cardinality="1"/>
        
<AD id="ssl.needclientauth" type="Boolean" cardinality="1"/>
        
<AD id="ssl.wantclientauth" type="Boolean" cardinality="1"/>
        
<AD id="ssl.protocol" type="String" cardinality="1"/>
        
<AD id="ssl.algorithm" type="String" cardinality="1"/>
        
<AD id="ssl.keystoretype" type="String" cardinality="1"/>
        
<AD id="context.path" type="String" cardinality="1"/>
        
<AD id="context.sessioninactiveinterval" type="Integer" cardinality="1"/>
        
<AD id="other.info" type="String" cardinality="1"/>
    
</OCD>
    
<Designate pid="org.eclipse.equinox.http.jetty.config.designate" factoryPid="org.eclipse.equinox.http.jetty.config" bundle="*">
        
<Object ocdref="server.config"/>
    
</Designate>
</MetaData>

在java配置文件configuration/config.ini中添加参数:

# enable ssl
org.eclipse.equinox.http.jetty.https.enabled=true
org.eclipse.equinox.http.jetty.http.enabled=false
org.eclipse.equinox.http.jetty.ssl.keystore=webminkey
org.eclipse.equinox.http.jetty.ssl.password=administrator
org.eclipse.equinox.http.jetty.ssl.keypassword=webmin

# set ssl port (defaults to 443)
org.eclipse.equinox.http.jetty.https.port=443
#org.eclipse.equinox.http.jetty.http.port=8088



测试:
浏览器中输入url: https://localhost/
posted @ 2009-06-13 10:35 k-jong 阅读(4968) | 评论 (0)编辑 收藏
 
**以下说明适用于windows及linux平台,系统设计为统一utf-8编码。

Firefox网页显示默认采用utf
-8编码。

IE默认使用gb2312编码格式,并且当htm页面
<meta http-equiv="Content-type" value="text/html;charset=utf-8">

时,IE仍会自动转换至gb2312,此时客户端页面传递中文参数至服务器端(接受utf-8编码格式的参数)时,即发生乱码问题。

解决方案:IE下传递中文参数值时,
使用“encodeURIComponent(form.element.value)“对表单中的字段值手动进行utf
-8编码。
posted @ 2009-06-13 09:44 k-jong 阅读(461) | 评论 (0)编辑 收藏
 
mysql数据库备份:
1 mysqldump -hhost -uuser -ppassword thedatabase > db.sql

mysql数据库还原:
mysql -hhost -uuser -ppassword todatabase < db.sql

mysql数据库统一utf-8编码:
修改%mysql%/data/neodb/db.opt文件如下:
1 default-character-set=utf8
2 default-collation=utf8_general_ci

检查mysql数据库编码命令:

posted @ 2009-06-12 09:53 k-jong 阅读(306) | 评论 (0)编辑 收藏
CALENDER
<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

留言簿

随笔分类

最新随笔

最新评论

阅读排行榜


Powered By: 博客园
模板提供沪江博客