一、windows查看:ipconfig
cmd命令直接输入ipconfig
二、linux查看
有3中查看方式:
(1)ifconfig命令
[root@hadoop001 ~]# ls /etc/sysconfig/network-scripts/
eth0表示网卡名称
ip地址:inet addr:172.31.95.246
(2)ping xxx (xxx表示当前机器名称)
(3)hostname -i
注意:ping xxx (xxx表示机器名称)和hostname -i这两种查看ip方式受限于配置文件/etc/hosts文件,这个/etc/hosts文件在工作中部署环境是要自己配置的。ping xxx (xxx表示机器名称)和hostname -i在执前需配置,格式是先配置ip,后配置机器名称:172.31.95.246 hadoop001
三、设置服务开机自启动
1、先安装某一服务:[root@hadoop001 ~]# yum install httpd
2、使某一服务生效:[root@hadoop001 ~]# service httpd start
3、检查服务开启状态:[root@hadoop001 ~]# chkconfig --list | grep http
4、设置服务开机自启动:[root@hadoop001 ~]# chkconfig httpd on
5、检查服务开启状态:[root@hadoop001 ~]# chkconfig --list | grep http
加油???
2018-9-24 14:29
Sylvia