Archive for the 'Linux' Category

安装rac执行root.sh出现rootconfig: line 815: 10338 Segmentation fault错误

在REDHAT 5.4上安装oracle 10g rac,安装cluster时,在执行/opt/ora10g/product/10.2.0/crs_1/root.sh时出现了如下错误:

WARNING: directory ‘/opt/ora10g/product/10.2.0′ is not owned by root
WARNING: directory ‘/opt/ora10g/product’ is not owned by root
WARNING: directory ‘/opt/ora10g’ is not owned by root
Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
/opt/ora10g/product/10.2.0/db_1/install/rootconfig: line 815: 10338 Segmentation fault $CH/bin/ocrconfig -upgrade $CRS_ORACLE_OWNER $CRS_DBA_GROUP
Failed to upgrade Oracle Cluster Registry configuration

最后查找到原因是GCC的问题,需进行如下操作:

1. cd /usr/bin
2. mv gcc gcc.script
3. mv g++ g++.script
4. ln -s gcc34 gcc
5. ln -s g++34 g++

RedHat的yum配置笔记

yum = Yellow dog Updater, Modified,主要功能是更方便的添加/删除/更新RPM包,它能自动解决包的倚赖性问题。这样对于安装软件就非常方便了。

我的系统环境为RedHat5.4企业版32位。首先将RedHat5.4安装光盘复制到/cdrom目录下。然后编辑rhel-debuginfo.repo,如下:

vi /etc/yum.repos.d/rhel-debuginfo.repo

添加:

[Cluster]
name=Red Hat Enterprise Linux $releasever – $basearch – Cluster
baseurl=file:///cdrom/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[ClusterStorage]
name=Red Hat Enterprise Linux $releasever – $basearch – ClusterStorage
baseurl=file:///cdrom/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Server]
name=Red Hat Enterprise Linux $releasever – $basearch – Server
baseurl=file:///cdrom/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[VT]
name=Red Hat Enterprise Linux $releasever – $basearch – VT
baseurl=file:///cdrom/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

再编辑yumRepo.py(通过搜索remote)

vi /usr/lib/python2.4/site-packages/yum/yumRepo.py

将remote = url + ‘/’ + relative
修改为:remote = “/cdrom/Server” + ‘/’ + relative

最后运行yum clean all即完成配置。

通过以下命令来查看是否能完成集群软件的安装:

cd /cdrom/Cluster
yum install *

 

 

RHCS错误:[3652]: ASEHAagent: The directory '/disk2/sybase/ASE15_0' doesn't exist.

完成LINUX双机热备RHCS后启动时出现错误,不能正常启动。查看/var/log/messages,错误如下:

Sep 24 21:36:38 node1 clurgmgrd[3113]: <notice> Starting stopped service service:sv_sybase
Sep 24 21:36:39 node1 avahi-daemon[2205]: Registering new address record for 192.168.1.210 on eth0.
Sep 24 21:36:39 node1 fenced[3015]: fencing node “node2″
Sep 24 21:36:39 node1 fenced[3015]: fence “node2″ failed
Sep 24 21:36:40 node1 kernel: kjournald starting. Commit interval 5 seconds
Sep 24 21:36:40 node1 kernel: EXT3 FS on sdb, internal journal
Sep 24 21:36:40 node1 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Sep 24 21:36:41 node1 bash: [3652]: <err> ASEHAagent: The directory ‘/disk2/sybase/ASE15_0′ doesn’t exist.
Sep 24 21:36:41 node1 clurgmgrd: [3113]: <err> script:script_sybase: start of /usr/share/cluster/ASEHAagent.sh failed (returned 1)
Sep 24 21:36:41 node1 clurgmgrd[3113]: <notice> start on script “script_sybase” returned 1 (generic error)
Sep 24 21:36:41 node1 clurgmgrd[3113]: <warning> #68: Failed to start service:sv_sybase; return value: 1
Sep 24 21:36:41 node1 clurgmgrd[3113]: <notice> Stopping service service:sv_sybase

显示不能找到/disk2/sybase/ASE15_0目录。但在安装sybase时目录应该是/disk2/sybase/ASE-15_0。

立即到/usr/share/cluster下查看ASEHAagent.sh中定义的变量,如下,发现sybase_ase和sybase_ocs的变量名中都少了个“-”。

sybase_home=”/disk2/sybase”
sybase_ase=”ASE15_0″
sybase_ocs=”OCS15_0″
server_name=”sybase”
login_file=”/disk2/sybase/login_file”
interfaces_file=”/disk2/sybase/interfaces”
sybase_user=”sybase”
shutdown_timeout=30
start_timeout=30
deep_probe_timeout=30
RUNSERVER_SCRIPT=$sybase_home/$sybase_ase/install/RUN_$server_name
CONSOLE_LOG=$sybase_home/$sybase_ase/install/$server_name.log

立即将它修改成如下内容:

sybase_ase=”ASE-15_0″
sybase_ocs=”OCS-15_0″

然后再执行启动双机,可以正常启动。

安装vmware-tools时出现Unable to find the answer LIBDIR in the installer database错误

在安装vmware-tools for linux时,如果是在安装没结束时通过[ctrl]+[c]的,当再次运行./vmware-install.pl想重新安装时就会出现如下的错误:

[root@node1 vmware-tools-distrib]# ./vmware-install.pl
A previous installation of VMware software has been detected.

The previous installation was made by the tar installer (version 3).

Keeping the tar3 installer database format.

Uninstalling the tar installation of VMware Tools.

Skipping VMware Tools services shutdown on the host: [ OK ]

Unable to find the answer LIBDIR in the installer database
(/etc/vmware-tools/locations). You may want to re-install VMware Tools.

Execution aborted.

Failure
Execution aborted.

解决方法:删除/etc/下的vmware-tools文件夹即可,如下:

rm -Rf /etc/vmware-tools

vmware中安装Ubuntu出现磁盘空间不足

在VMWARE上安装Ubuntu时出现磁盘空间不足,如下图:

原因是因为VMWARE中建立的硬盘类型为SCSI,而Ubuntu认识IDE的硬盘,所以只要在新建VMWARE虚拟机时选择“Custom”,硬盘类型选择IDE即可。

Sybase for Linux 下载

打开http://www.sybase.com/linux,点Download ASE Express Edition for Linux ,填写完信息后就进入了下载界面,再根据操作系统版本下载相应安装包。

Click here to download ASE Express Edition for Linux (x86) * (284MB – Be patient this will take time to download)
Click here to download ASE Express Edition for Linux (x86 64 bit)  * (317MB – Be patient this will take time to download)
Click here to download ASE Express Edition for Linux (OpenPower) * (368MB – Be patient this will take time to download)

Redhat下VNC SERVER的配置

1、启动VNC SERVER

输入vncserver,第一次启动会要求输入验证密码,完成后,VNC SERVER就启动了

[root@localhost ~]# vncserver

You will require a password to access your desktops.

Password:            //输入密码
Verify:                  //再次输入密码
xauth:  creating new authority file /root/.Xauthority

New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

[root@localhost ~]#

2、编辑.vnc/xstartup

使用VI打开xstartup文件,如下:

[root@localhost /]# cd /root/.vnc
[root@localhost .vnc]# vi xstartup

删除全部内容,然后添加如下内容:

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

3、重启动VNC SERVER

[root@localhost ~]# vncserver -kill :1
Killing Xvnc process ID 21198

[root@localhost ~]# vncserver

New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

[root@localhost ~]#

4、查看VNC的监听端口

如下,VNC用到了三个端口:5801、5901、6001。

[root@localhost /]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5801                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:724                 0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN
tcp        0      0 172.200.102.3:5901          181.181.181.51:1669         ESTABLISHED
tcp        0      0 :::6001                     :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0   1364 ::ffff:172.200.102.3:22     ::ffff:181.181.181.51:1599  ESTABLISHED
[root@localhost /]#

5、在防火墙上打开VNC用到的上面三个端口

[root@localhost /]# cd /etc/sysconfig
[root@localhost sysconfig]# vi iptables

添加如下三行:

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5801 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 6001 -j ACCEPT

重记动IPTABLES

[root@localhost sysconfig]# /etc/rc.d/init.d/iptables restart
Flushing firewall rules: [  OK  ]
Setting chains to policy ACCEPT: filter [  OK  ]
Unloading iptables modules: [  OK  ]
Applying iptables firewall rules: [  OK  ]
Loading additional iptables modules: ip_conntrack_netbios_ns ip_conntrack_ftp [  OK  ]
[root@localhost sysconfig]#

6、使用VNC VIEW连接VNC SERVER

下载VNC VIEW,运行,然后输入IP:端口号,输入刚才设定的密码,进入REDHAT桌面。

AIX、Solaris、FreeBSD等系统的免费真实学习环境

很早就知道Unix-Center.Net(Unix体验中心)并注册了。但一直没有使用他,因为以前都是用FreeBSD,他可以安装在Intel架构的机器上,随便找一台586的低档机器就可以安装FreeBSD并开始学习他。

最近在学习IBMAIX,花了些时间把AIX的文档简单的看了一些, 和学习FreeBSD一样,接下来就是要有一台安装AIX的机器能真实的操作,安装完VMware后突然想到,AIX不像FreeBSD能支持x86或者说是Inte CPU的机器,他只支持IBM的POWER处理器,网上搜索下,得到了确认,确实不能在VMware上安装AIX。

ChinaUnix.net上看到有朋友说有人贡献提供网友远程学习的AIX机器, 找了一圈没有,然后就想到了很早就注册的Unix-Center.Net,马上进入网站,果然看到了很多“UNIX”服务器,其实就有AIX。

用以前的帐号登陆,然后试着连接AIX的服务器地址:aix.unix-center.net,再用登陆网站的用户名密码(说明:网站上注册的用户名密码可以登陆所有的unix-center服务器),连接成功。

马上试了几个前两天刚看的简单的AIX命令, 都可以使用。又连接了另外两台服务器:freebsd.unix-center.net和t1000.unix-center.net,也都成功。如图:

1、AIX

center1.gif

center2.gif

2、FreeBSD

center3.gif

3、Solars

center4.gif

AIXSolaris等系统而且自己很难架设学习环境的人来说,Unix-Center.Net挺有用。当然考虑到安全,一些命令或者在服务器的使用上肯定会有所限制。

最后引用Unix-Center.Net网站上的一段话:

中国是一个发展中国家,我们有很多教师、学生和工程人员希望能够学习Unix/Linux系统,却又苦于没有合适的环境和条件。本站存在的目的,就是给这些爱好Unix/Linux的人一个学习和练习的条件,希望您能够支持我们的行动。

RouterOS2.9.6安装及试用笔记

最近在用一台老机器安装RouterOS做测试,效果不错,在管理及流量控制等方面比BSD要好的多,如是你是一个中型的单位企业,使用一台普通的P4+IDE硬盘接口的PC安装一个RouterOS,应该能完全满足上网的需求了。以下为安装及配置的简要过程:

一、下载及安装RouterOS

从网络上下载后将ISO结尾的文件镜像刻盘,然后开始安装,将光盘放入,直到出现如下画面:

routeros1.gif

依次键入“a”(选择全部安装),然后键入“i”(开始安装),这时会跳出第一个对话框:是否删除硬盘里所有数据,选“y”,接着跳出第二个对话框:是否保存原有数据,选“n”,接着就开始安装了,半分钟后,出现如下画面后按回车重启机器,这样RouterOS就完成安装了。

routeros2.gif

二、 配置内网网卡ip

先配置内网网卡地址,然后使用winbox远程配置。

重启后使用默认用户名admin密码为空登陆系统,如下图:

routeros3.gif

登陆后使用setup命令配置网卡地址,将出现如下画面:

routeros4.gif

这里选择“a”选项(配置ip地址和网关),出现下一对话框后再选择“a”,然后选择网卡,默认为“ether1”,直接回车,最后输入内网网卡地址和子网掩码,如下图。

routeros5.gif

输入完ip回车后又会出现两次对话框要求输入ip和网关,直接按两次“x”键即可退出。因为RouterOS命令是直接生效的,所以下来就可以用一台windows机器加上winbox软件来远程安装配置了。

三、配置外网网卡地址

RourterOS可以使用winbox来实现远程的管理与维护,winbox登陆界面如下:

routeros7.gif

连接后winbox的主界面如下:

routeros6.gif

接下来开始配置外网网卡ip,依次点击IP -> Addresses,如下图:

routeros8.gif

在弹出的对话框中点击“+”按扭,然后在New Address对话框中输入外网IP,这里只填Address项,为58.241.2.156/29,点击“ok”,如下图。

routeros9.gif

四、配置路由与NAT

1)路由配置

依次选择IP -> Routes,点击“+”按扭,弹出New Route对话框,Destination为0.0.0.0/0,gateway为外网网关,这里为58.241.2.153,如下图。

routeros10.gif

2)配置NAT

依次选择IP -> Firewall -> NAT,在出现的对话框中选择General选项卡,Chain选项中选择srcnat,再选择Action选项卡,Action选项中选择masquerade,点击“ok”,如下图。

routeros11.gif

至此,内网用户设置6段地址后就可以上网了,接下来做一些安全及流量的配置:

五、添加防火墙规则

点击New Terminal, 打入“/ ip firewall filter”命令,然后复制防火墙文件中的规则列表,再进入New Terminal窗口,点击右键选择“Paste”,如下图。

routeros12.gif

这样,在IP -> Firewall -> Filter Rules中可以看到刚才导入的防火墙规则了,如下图。

routeros13.gif

 六、对单个IP限速

选择Queues -> Simple Queues,点击“+”按扭,选择General,Name中填入任一名称,在Dst. Address中填入想限速的IP,如192.168.6.1/32,然后将Max Limit  (tx/rx)打钩,然后在后面的框中输入“1M/512K”,这里的1M为下载速度(tx),512K为上传速度(rx) ,点击“ok”,如下图。

routeros14.gif

小结:因为RouterOS使用的是Linux的内核,所以在大网络环境或者大吞吐量时的表现应该表现不凡,这方面linux应该说比BSD要更出现。在安装、配置、管理等方面也比BSD要更简单,因为它使用了窗口式管理。如果在SCSI硬盘的支持上RouterOS能更好的话,相信它的性能会更强。

刚接触RouterOS,文中难免有错误。

funpower  2008-03-05   funpower@gmail.com