1、通过ansible Roles编排实现 httpd 角色的部署
①、构建目录结构
②、编写roles中各个模块。
如下操作:
[root@centos8 data]#cd ansible/ [root@centos8 ansible]#ls role_httpd.yml roles [root@centos8 ansible]#cat role_httpd.yml --- - hosts: all remote_user: root roles: - httpd [root@centos8 ansible]#cd roles/ [root@centos8 roles]#ls httpd [root@centos8 roles]#cd httpd/ [root@centos8 httpd]#ls files handlers tasks [root@centos8 httpd]#cd tasks/ [root@centos8 tasks]#ls config.yml index.yml main.yaml user.yml group.yml install.yml service.yml [root@centos8 tasks]#cat main.yaml - include: group.yml - include: user.yml - include: install.yml - include: config.yml - include: index.yml - include: service.yml [root@centos8 tasks]#cat group.yml - name: create group group: name=apache system=yes gid=666 [root@centos8 tasks]#cat user.yml - name: create user user: name=apache shell=/sbin/nologin system=yes group=apache uid=666 create_home=no [root@centos8 tasks]#cat install.yml - name: install httpd yum: name=httpd [root@centos8 tasks]#cat config.yml - name: config file copy: src=httpd.conf dest=/etc/httpd/conf/ backup=yes notify: restart [root@centos8 tasks]#cat index.yml - name: index.html copy: src=index.html dest=/var/www/html [root@centos8 tasks]#cat service.yml - name: start service service: name=httpd state=started enabled=yes [root@centos8 tasks]#cd .. [root@centos8 httpd]#cd handlers/ [root@centos8 handlers]#ls main.yml [root@centos8 handlers]#cat main.yml - name: restart service: name=httpd state=restarted
2、简述 MySQL 数据库访问的执行过程。
答:①、select相当于挑选一张表中的指定的域,from是从哪张表中去挑。
②、数据库其实是默认放在/var/lib/mysql中,找库的时候会在此目录下面找到对应的库,然后再此库目录下找表。
3、S E L E C T 语句的完整语法较复杂,但至少包括的部分是 (A )
A.仅 S E L E C T
B.S E L E C T ,F R O M
C.S E L E C T ,G R O U P
D.S E L E C T ,I N T O
4、一张表的主键个数为 (C )
A.至多 3 个 B.没有限制
C.至多 1 个 D.至多 2 个