zoukankan      html  css  js  c++  java
  • Linux questions

    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]#


     

  • 相关阅读:
    各大搜索引擎的User-Agent
    xxx couldn't be loaded because it has not been added to the build settings.
    C#解压、压缩RAR文件
    [转载]C# Random 生成不重复随机数
    [转载]如何打一手好Log
    MongoDB服务器启动异常 1067
    [转载]Asp.net MVC2 与 MVC3 路由调试好帮手RouteDebug 与 RouteDebugger
    [转载]C#中获取时间戳(UnixTime)的方法
    C# winform 弹出输入框
    设计与框架
  • 原文地址:https://www.cnblogs.com/fjsnail/p/4324904.html
Copyright © 2011-2022 走看看