4)查看windows环境的中VMnet8网络配置
ifconfig :network interfaces configuring网络接口配置
ifconfig (功能描述:显示所有网络接口的配置信息)
[root@hadoop100 桌面]# ifconfig
ping 目的主机 (功能描述:测试当前服务器是否可以连接目的主机)
[root@hadoop100 桌面]# ping www.baidu.com
[root@hadoop100 桌面]#vim /etc/sysconfig/network-scripts/ifcfg-eth0
以下标红的项必须修改,有值得按照下面的值修改,没有该项的要增加。
HWADDR=00:0C:2x:6x:0x:xx #MAC地址
TYPE=Ethernet #网络类型(通常是Ethemet)
UUID=926a57ba-92c6-4231-bacb-f27e5e6a9f44 #随机id
# IP的配置方法[none|static|bootp|dhcp](引导时不使用协议|静态分配IP|BOOTP协议|DHCP协议)
2)执行service network restart
3.1 hostname 显示和设置系统的主机名称
hostname (功能描述:查看当前服务器的主机名称)
[root@hadoop100 桌面]# hostname
1)修改linux的主机映射文件(hosts文件)
(1)进入Linux系统查看本机的主机名。通过hostname命令查看
[root@hadoop100 桌面]# hostname
(2)如果感觉此主机名不合适,我们可以进行修改。通过编辑/etc/sysconfig/network文件
[root@hadoop100 桌面]# vi /etc/sysconfig/network
(3)打开此文件后,可以看到主机名。修改此主机名为我们想要修改的主机名hadoop100。
[root@hadoop100 桌面]# vim /etc/hosts
(6)并重启设备,重启后,查看主机名,已经修改成功
2)修改window7的主机映射文件(hosts文件)
(1)进入C:\Windows\System32\drivers\etc路径
3)修改window10的主机映射文件(hosts文件)
(1)进入C:\Windows\System32\drivers\etc路径
(4)将桌面hosts文件覆盖C:\Windows\System32\drivers\etc路径hosts文件
service 服务名 start (功能描述:开启服务)
service 服务名 stop (功能描述:关闭服务)
service 服务名 restart (功能描述:重新启动服务)
service 服务名 status (功能描述:查看服务状态)
[root@hadoop100 init.d]# pwd
[root@hadoop100 init.d]# ls -al
[root@hadoop100 桌面]#service network status
[root@hadoop100 桌面]#service network stop
[root@hadoop100 桌面]#service network start
[root@hadoop100 桌面]#service network restart
[root@hadoop100 桌面]#service –status-all
4.2 chkconfig 设置后台服务的自启配置
chkconfig (功能描述:查看所有服务器自启配置)
chkconfig 服务名 off (功能描述:关掉指定服务的自动启动)
chkconfig 服务名 on (功能描述:开启指定服务的自动启动)
chkconfig 服务名 –list (功能描述:查看服务开机启动状态)
[root@hadoop100 桌面]#chkconfig iptables off
[root@hadoop100 桌面]#chkconfig iptables on
[root@hadoop100桌面]# service iptables status
[root@hadoop100桌面]# service iptables stop
[root@hadoop100桌面]#chkconfig iptables –list
[root@hadoop100桌面]#chkconfig iptables off
在linux领域内大多用在服务器上,很少遇到关机的操作。毕竟服务器上跑一个服务是永无止境的,除非特殊情况下,不得已才会关机。
正确的关机流程为:sync > shutdown > reboot > halt
(1)sync (功能描述:将数据由内存同步到硬盘中)
(2)halt (功能描述:关闭系统,等同于shutdown -h now 和 poweroff)
(3)reboot (功能描述:就是重启,等同于 shutdown -r now)
Linux系统中为了提高磁盘的读写效率,对磁盘采取了 “预读迟写”操作方式。当用户保存文件时,Linux核心并不一定立即将保存数据写入物理磁盘中,而是将数据保存在缓冲区中,等缓冲区满时再写入磁盘,这种方式可以极大的提高磁盘写入数据的效率。但是,也带来了安全隐患,如果数据还未写入磁盘时,系统掉电或者其他严重问题出现,则将导致数据丢失。使用sync指令可以立即将缓冲区的数据写入磁盘。
[root@hadoop100桌面]# reboot
(4)计算机将在1分钟后关机,并且会显示在登录用户的当前屏幕中
[root@hadoop100桌面]#shutdown -h 1 ‘This server will shutdown after 1 mins’
[root@hadoop100桌面]# shutdown -h now
[root@hadoop100桌面]# shutdown -r now
http://blog.sina.com.cn/s/blog_c30a9e680102xuwr.html
http://blog.sina.com.cn/s/blog_c30a9e680102xuws.html
转载原文链接:http://www.atguigu.com/jsfx/598.html
大数据开发Linux基础篇网络配置和系统管理
原文:https://www.cnblogs.com/xiaobaizaixianzhong/p/15029236.html