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


     

  • 相关阅读:
    windows常用快捷键
    清华为什么被称为“水木清华”
    CTP程序化系统开发(C++ && PHP)
    PHP判断SESSION过期的方法
    Linux 下 ---ThinkPHP 图片上传提示:上传根目录不存在!请尝试手动创建
    &#65279导致页面顶部空白一行解决方法 【】
    Code笔记 之:ajax诡异的错误-请求status为200
    PHP之:序列化和反序列化-serialize()和unserialize()
    Linux之:Ubuntu速学笔记(1)
    C语言归并排序(合并排序)算法及代码
  • 原文地址:https://www.cnblogs.com/fjsnail/p/4324904.html
Copyright © 2011-2022 走看看