1.本地yum仓库配置
①挂载centos镜像到/mnt/cdrom目录
②安装httpd(yum install -y httpd)并启动httpd服务(service httpd start)
③配置yum源到httpd中
④备份本机yum源并进行配置将源指向自己`
[root@node1 /]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# cp CentOS-Base.repo CentOS-Base.repo.bak
[root@node1 yum.repos.d]# vim CentOS-Base.repo
[base]
name=CentOS-Local
baseurl=file:///var/www/html/Packages
gpgcheck=0
enabled=1 #增加改行,使能
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7`
2.shell脚本编程
①脚本以#!/bin/bash开头
②脚本需要可执行权限
③helloworld代码
[root@hadoop102 datas]$ touch helloworld.sh
[root@hadoop102 datas]$ vim helloworld.sh
[root@hadoop102 datas]$ chmod u+x helloworld.sh
在helloworld.sh中输入如下内容
#!/bin/bash
echo "helloworld"
④执行方式:
(1)赋予脚本权限:chmod 777 helloworld.sh
(2)执行脚本/root/helloWorld.sh.