Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

1

好友

2

主题
1#
发表于 2013-11-7 09:47:29 | 查看: 2645| 回复: 1
    我在workstation 8 下面创建了3个虚拟机搭建rac+dg,数据库是oracle11.2.0.3   linux是5.5的,我在dg服务器上搭建DNS,在两个节点上nslookup错误如下:
[root@galen1 ~]# nslookup scan-ip
Server:         192.168.120.108
Address:        192.168.120.108#53

** server can't find scan-ip: SERVFAIL
以下是每个服务器的配置情况
dg上
[root@dg etc]# pwd
/var/named/chroot/etc
[root@dg etc]# ls -l
total 20
-rw-r--r-- 1 root root   389 Nov  4 23:30 localtime
-rw-r----- 1 root named 1230 Jan 21  2010 named.caching-nameserver.conf
-rw-r----- 1 root named 1200 Nov  7 09:06 named.conf
-rw-r----- 1 root named 1209 Nov  7 09:15 named.rfc1912.zones
-rw-r----- 1 root named  113 Nov  5 10:18 rndc.key
[root@dg etc]# cat named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        allow-query     { any; };
        allow-query-cache { any; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { any; };
        match-destinations { any; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};
---------------------------------------------
[root@dg etc]# cat named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
        type hint;
        file "named.ca";
};

zone "localdomain" IN {
        type master;
        file "localdomain.zone";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
        file "named.ip6.local";
        allow-update { none; };
};

zone "255.in-addr.arpa" IN {
        type master;
        file "named.broadcast";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "named.zero";
        allow-update { none; };
};

zone "gaohuiromg.com" IN {
        type master;
        file "gaohuirong.zone";
        allow-update { none; };
};

zone "120.168.192.in-addr.arpa" IN {
        type master;
        file "120.168.192.in-addr.local";
        allow-update { none; };
};

---------------------------------------
[root@dg named]# pwd
/var/named/chroot/var/named
[root@dg named]# ls -l
total 44
-rw-r----- 1 root  named  474 Nov  7 09:20 120.168.192.in-addr.local
drwxrwx--- 2 named named 4096 Nov  5 13:54 data
-rw-r----- 1 root  named  242 Nov  7 09:19 gaohuirong.zone
-rw-r----- 1 root  named  198 Jan 21  2010 localdomain.zone
-rw-r----- 1 root  named  195 Jan 21  2010 localhost.zone
-rw-r----- 1 root  named  427 Jan 21  2010 named.broadcast
-rw-r----- 1 root  named 1892 Jan 21  2010 named.ca
-rw-r----- 1 root  named  424 Jan 21  2010 named.ip6.local
-rw-r----- 1 root  named  426 Jan 21  2010 named.local
-rw-r----- 1 root  named  427 Jan 21  2010 named.zero
drwxrwx--- 2 named named 4096 Jul 27  2004 slaves
-----------------------------------------
[root@dg named]# cat gaohuirong.zone
$TTL    86400
@               IN SOA  @       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           @
                IN A            127.0.0.1
                IN AAAA         ::1
scan-ip         IN A            192.168.120.107
--------------------------------------------
[root@dg named]# cat 120.168.192.in-addr.local
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      localhost.
1       IN      PTR     localhost.
107     IN      PTR     scan-ip.gaohuirong.com.
------------------------
[root@dg named]# /etc/init.d/named stop
Stopping named:                                            [  OK  ]
[root@dg named]# /etc/init.d/named start
Starting named:                                            [  OK  ]
[root@dg named]# /etc/init.d/named configtest
zone localdomain/IN: loaded serial 42
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700
zone 255.in-addr.arpa/IN: loaded serial 42
zone 0.in-addr.arpa/IN: loaded serial 42
zone gaohuiromg.com/IN: loaded serial 42
zone 120.168.192.in-addr.arpa/IN: loaded serial 1997022700

===================================
节点1上
[root@galen1 ~]# service iptables status
Firewall is stopped.
[root@galen1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost
::1             localhost6.localdomain6 localhost6
#galen1
192.168.120.101     galen1.gaohuirong.com            galen1
192.168.120.102     galen1-vip.gaohuirong.com        galen1-vip
192.168.116.103     galen1-priv.gaohuirong.com       galen1-priv

#galen2
192.168.120.104     galen2.gaohuirong.com            galen2
192.168.120.105     galen2-vip.gaohuirong.com        galen2-vip
192.168.116.106     galen2-priv.gaohuirong.com       galen2-priv

#scan-ip
192.168.120.107     scan-ip.gaohuirong.com           scan-ip
=========================
[root@galen1 ~]# cat /etc/resolv.conf
search gaohuirong.com
nameserver 192.168.120.108
[root@galen1 ~]# hostname
galen1.gaohuirong.com
=====================
节点2上
[root@galen2 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1                  localhost
::1             localhost6.localdomain6 localhost6
#galen1
192.168.120.101     galen1.gaohuirong.com            galen1
192.168.120.102     galen1-vip.gaohuirong.com        galen1-vip
192.168.116.103     galen1-priv.gaohuirong.com       galen1-priv

#galen2
192.168.120.104     galen2.gaohuirong.com            galen2
192.168.120.105     galen2-vip.gaohuirong.com        galen2-vip
192.168.116.106     galen2-priv.gaohuirong.com       galen2-priv

#scan-ip
192.168.120.107     scan-ip.gaohuirong.com           scan-ip

[root@galen2 ~]# cat /etc/resolv.conf
search gaohuirong.com
nameserver 192.168.120.108
[root@galen2 ~]# hostname
galen2.gaohuirong.com
===========
[root@galen1 ~]# ping galen2
PING galen2.gaohuirong.com (192.168.120.104) 56(84) bytes of data.
64 bytes from galen2.gaohuirong.com (192.168.120.104): icmp_seq=1 ttl=64 time=6.92 ms
64 bytes from galen2.gaohuirong.com (192.168.120.104): icmp_seq=2 ttl=64 time=0.251 ms
都能ping通。
我重建好几次DNS了还是不对,求大神指教
2#
发表于 2013-11-7 14:37:02
1、 你完全可以不用配置DNS

2、 如果你坚持要配置DNS 请参照


DNS and Linux

I initially looked at DNS when still at the University which seems like a long time ago nowadays. Back then Linux was the uni’s preferred non-Windows platform so I knew which package to install. The following example uses bind 9.3.4-6P1.el5 which is the unpatched DNS server distributed with RHEL 5 update 2.

A word of caution: this article shouldn’t be used to set up a production DNS server, it’s merely intended to get you a DNS server for a lab environment!

With all that said, let’s proceed to getting our SCAN addresses registered. First of all, use rpm to install the package.

Once that’s installed, we need to configure our DNS server. bind9 comes with a number of sample configuration files which make our life a little easier. Traditionally, bind is configured in 2 places:

/etc/named.conf for the zone definition and
/var/named for the zone configuration.

/etc/named.conf

Let’s look at /etc/named.conf first. Please check the documentation and/or man page for the file if you need more explanation.

This file contains the zones as recommended by RFC 1912 section 4.1 (part of the sample configuration) and my zone “the-playground.de”. I want to resolve all hostnames ending in the-playground.de from the DNS server. Consider this file:

options
{
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
query-source    port 53;
query-source-v6 port 53;
*/

// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
dump-file               "data/cache_dump.db";
statistics-file         "data/named_stats.txt";
memstatistics-file      "data/named_mem_stats.txt";

allow-transfer {"none";};
zone-statistics yes;

};

logging
{
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "the-playground.de" IN {
type master;
file "the-playground.zone";
//allow-transfer {192.168.30.2;};
notify no;
};

zone "30.168.192.in-addr.arpa" IN {
type master;
file "the-playground.reverse";
//allow-update { none; };
//allow-transfer {192.168.30.2;};
notify no;
};

// the following is recommended and not my stuff
// named.rfc1912.zones:

zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};

zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};

zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
The file is a copy & paste effort with emphasis of getting it to work rather than a beautiful engineering effort. Copy the files referenced by the file directive from /usr/share/doc/bind-9.3.4/sample/var/named to /var/named. The files “the-playground.reverse” and “the-playground.zone” need to be created, see below. Please also rename the zones to whatever you fancy. If you wonder why there are 2 directives for the same domain – that has to do with forward and reverse address resolution. DNS needs to be able to do 2 things:

Resolve name to IP address
Reverse the process, converting IP addresses to names.
So when you type in “ping node1.the-playground.de” DNS will translate this to “ping 192.168.30.10″. Also, you can ask DNS which hostname is behind a specific IP using the nslookup tool. dig and host are some more tools you could use for troubleshooting.

the-playground.zone

The file has the following contents:

$TTL    86400
@        IN SOA    the-playground.de hostmaster.the-playground.de (
                 42        ; serial (d. adams)
                 3H        ; refresh
                15M        ; retry
                 1W        ; expiry
               1D )        ; minimum
                IN NS   node1
node1           IN A    192.168.30.10
node1v          IN A    192.168.30.11
node2           IN A    192.168.30.20
node2v          IN A    192.168.30.21
node3           IN A    192.168.30.30
node3v          IN A    192.168.30.31

scan-cluster    IN A    192.168.30.100
scan-cluster    IN A    192.168.30.101
scan-cluster    IN A    192.168.30.102
Here we are assigning names to IP addresses. The reverse is done in the reverse zone file. Just change names and IP addresses to fit your needs.

NOTE
I had an undetected problem with the file, in a way that the PTR wasn’t the FQDN of the host which caused reverse lookups to return incorrect results. This has now been fixed.

the-playground.reverse

Consider this file:

$TTL    86400
@        IN SOA    the-playground.de root.rhel5.the-playground.de (
                   42        ; serial (d. adams)
                   3H        ; refresh
                  15M        ; retry
                   1W        ; expiry
                 1D )        ; minimum
                IN NS   node1.the-playground.de.
10              IN PTR  node1.the-playground.de.
11              IN PTR  node1v.the-playground.de.
20              IN PTR  node2.the-playground.de.
21              IN PTR  node2v.the-playground.de.
30              IN PTR  node3.the-playground.de.
31              IN PTR  node3v.the-playground.de.

100             IN PTR  scan-cluster.the-playground.de.
101             IN PTR  scan-cluster.the-playground.de.
102             IN PTR  scan-cluster.the-playground.de.
Starting and using named

With the files in place, start named using service named start. Check /var/log/messages for potential problems (usually typos) and correct them. Configuration changes are made available through service named reload.

Edit /etc/resolv.conf on your RAC nodes, they need the following entries:

options attempts: 2
options timeout: 1

search          the-playground.de
nameserver      192.168.30.10
Change IP addresses for your environment. Also, edit /etc/nsswitch conf’s hosts directive to favour dns over files, i.e. make sure the line beginning “hosts” reads hosts: dns files

That’s it! We’re well underway to set up our first 11.2 cluster!

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-6-2 10:59 , Processed in 0.047683 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569