1、通过ansible Roles编排实现 httpd 角色的部署
mkdir -pv /data/ansible/roles/httpd/{tasks,handlers,files}
cd /data/ansible/roles/httpd
vim tasks/main.yml
- include: group.yml
- include: user.yml
- include: install.yml
- include: config.yml
- include: index.yml
- include: service.yml
vim tasks/group.yml
- name: create httpd group
group: name=apache system=yes gid=88
vim tasks/user.yml
- name: create user
user: name=apache system=yes shell=/sbin/nologin home=/var/www uid=88 group=apache
vim tasks/install.yml
- name: install httpd
yum: name=httpd
vim tasks/config.yml
- name: config file
copy: src=httpd.conf dest=/etc/httpd/conf/
notify: restart httpd
vim task/index.yml
- name: index.html
copy: src=index.html dest=/var/www/html
vim tasks/service.yml
- name: start httpd
service: name=httpd state=started enabled=yes
vim handlers/main.yml
- name: restart httpd
service: name=httpd state=restarted
vim /data/ansible/role_httpd.yml
---
#httpd role
- host: websrvs
roles:
- httpd
ansible-playbook /data/ansible/role_httpd.yml
2、简述 MySQL 数据库访问的执行过程。
客户端发起一条SQL语句到SQL服务器,经过MySQL语法语义检查,通过优化器生成最佳执行计划,通过执行计划从存储引擎获取数据,返回客户端;
3、S E L E C T 语句的完整语法较复杂,但至少包括的部分是 (B )
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 个