**
一、TomCat安装部署【不用背】
**
1、软件包的上传与解压 tar zxvf apache-tomcat-6.0.53.tar.gz -C …/servers/
2、直接启动,并查看启动日志 ./startup.sh && tail -100f …/logs/catalina.out
3、验证,在浏览器访问http://192.168.10.132:8080/
二、Mysql安装部署
a、安装部署 yum install -y mysql-server
b、启动mysql /etc/init.d/mysqld start
c、设置用户名密码 /usr/bin/mysqladmin -u root password
‘123456’
d、使用root登录 mysql -uroot -p123456
Mysql命令
查看数据库列表 show databases;
查看数据表 show tables;
数据库切换 use 数据库名
解决中文乱码
A: 查看当前编码集
mysql -uroot -p123456
show variables like ‘character_set_%’;
B:修改配置/etc/my.cnf
在/etc/my.cnf中添加以下内容
[client]default-character-set=utf8
[mysql]default-character-set=utf8
[mysqld]character-set-server=utf8
最终结果
C: 重启mysql /etc/init.d/mysqld restart
D: 查看编码集
7.3 解决mysql远程连接失败
远程连接工具连接mysql报错如下
原因:mysql允许远程连接的服务器收到限制
修改mysql配置
A: mysql -uroot -p123456
B: mysql> use mysql
C: select host, user ,password from user;
-
修改远程限制,让root用户在任意节点使用123456都能够访问 grant all privileges on
. to ‘root’@’%’ identified by ‘123456’ with grant option;
E: 刷新配置 flush privileges;
F: 查看最终结果 select host, user ,password from user;

三、定时任务crontab 基本操作
查看已经配置的定时任务 crontab -l
编辑/添加新的定时任务 crontab -e
删除当前用户所有的任务 crontab -r
基本语法
* * * * * 命令/操作/动
四、时钟同步
A:与阿里云同步 ntpdate ntp4.aliyun.com
B: 局域网内部与某一个节点同步
1、 服务节点安装ntpd软件,并启动。
2、 修改配置/etc/ntp.confa) 解开第18行的注释,并将网段设置正确restrict 192.168.10.0 mask 255.255.255.0 nomodify notrapb)
注释掉第22-25行
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburstc)
在文档最后 添加两个设置
server 127.127.1.0 fudge
127.127.1.0 stratum 10
3、 修改配置文件/etc/sysconfig/ntpd
保证BIOS与系统时间同步 添加SYNC_HWLOCK=yes ,保存退出
4、 重启ntpd 服务
/etc/init.d ntpd restart
5、 到其他节点执行同步命令
ntpdate 192.168.10.132(时钟同步服务器的IP)
6、验证