首页 > 系统服务 > 详细

Linux questions

时间:2015-03-10 01:21:33      阅读:191      评论:0      收藏:0      [点我收藏+]

1.can not use ifconfig

http://blog.csdn.net/zjt289198457/article/details/6918644

   add this : export PATH=$PATH:/sbinc

   at the end of file /etc/profile

   and then execute : source /etc/profile to make the change effect

2.change to static ip
http://wkm.iteye.com/blog/1308528
2.1 change hostname to hadoop

技术分享

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=hadoop

 

2.2  Change ip address and Gateway 

path:/etc/sysconfig/network-scripts/ifcfg-eth0

old file:

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0c:29:d3:48:0e
ONBOOT=yes
NETMASK=255.255.0.0
IPADDR=172.27.35.222
GATEWAY=172.27.35.1
TYPE=Ethernet

new file

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0c:29:d3:48:0e
ONBOOT=yes
NETMASK=255.255.0.0
IPADDR=192.168.1.10
GATEWAY=192.168.1.100
TYPE=Ethernet

restart server :

 ifdown ech0

 ifup ech0  [same function : service network restart]

技术分享

 

4.change hostname

hostname show host name

hostname hadoop --change one time

permenet change :

change file /etc/sysconfig/network

[root@localhost sysconfig]# cat network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=hadoop

 

5.ip bind with hostname

vi /etc/hosts

add a line :192.168.1.10  hadoop

 

6.close firewall

6.1.server iptable status

  [root@hadoop etc]# service iptables status Table: filter Chain INPUT (policy ACCEPT) num  target     prot opt source               destination         1    RH-              Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0          

  Chain FORWARD (policy ACCEPT) num  target     prot opt source               destination         1    RH-Firewall-1-INPUT  all  --  0.0.0.0/0              

      0.0.0.0/0          

     Chain OUTPUT (policy ACCEPT) num  target     prot opt source               destination        

6.2 service iptables start/stop

     iptables {start|stop|restart|condrestart|status|panic|save}

 

7.check firewall server is run or not

   7.1  grep iptables server‘s status

    [root@hadoop etc]# chkconfig --list |grep iptables
      iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

7.2 close all firewall‘s service  and check status

[root@hadoop etc]# chkconfig iptables off
[root@hadoop etc]# chkconfig --list |grep iptables
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@hadoop etc]#


 

 

Linux questions

原文:http://www.cnblogs.com/fjsnail/p/4324904.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!