Unix/Linux

From dbawiki
Revision as of 16:07, 2 January 2013 by Stuart (talk | contribs) (Run a command on lots of servers in parallel)
Jump to: navigation, search

DNS not working

Ping to an IP address works

ping 74.125.136.103

but this doesn't

ping www.google.com

Check resolv.conf

cat /etc/resolv.conf
nameserver 95.130.132.17
nameserver 95.130.132.18

I had changed internet provider and forgot to update this. Just to set it to the router address and let that do the resolution

nameserver 192.168.1.1

Setup Oracle Enterprise Linux (RedHat) with yum server

You need to download the yum .repo file from the server, as per the steps below. After this, you need to enable a flag in the .repo file as per your operating system version. Having done these two steps, when you run yum install <pkgname> command on your linux box, the Oracle's yum server will be scanned, the dependent & the relevant rpm's will be download and installed for you.

cd /etc/yum.repos.d

To download files here

wget http://public-yum.oracle.com/public-yum-el5.repo

A file named public-yum-el5.repo will be created in your directory Edit this file and enter enabled=1 against the operating systems which is relevant to you

vi public-yum-el5.repo

Next run the yum command

yum install package-name

To change to static IP address

As root:

cd /etc/networks
vi interfaces

replace the line “iface eth0 inet dhcp” with

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1

You should also take a look at the file /etc/resolv.conf and check it has a nameserver entry (probably pointing at your default gateway) or direct to your ISP name servers.

nameserver 192.168.1.1

Run a command on lots of servers in parallel

This is a damn fine AIX utility - part of the CSM Distributed Shell.

dsh -a "ls -al /etc/apache2/*conf"

will list the Apache configuration file on all reachable servers (nodes)