数据分布
1、MySQL Cluster自动分区数据表(也可能使用用户自定义分区),将数据分布到分区中
2、一个数据表被划分到多个Data Node分区中,数据在分区中被”striped”
3、主键的 hashing 决定哪个分区拥有数据(自动分布)
4、对主键的一部分进行hashing也是可能的(适合sharding和数据局部性)
数据分布
1、MySQL Cluster自动分区数据表(也可能使用用户自定义分区),将数据分布到分区中
2、一个数据表被划分到多个Data Node分区中,数据在分区中被”striped”
3、主键的 hashing 决定哪个分区拥有数据(自动分布)
4、对主键的一部分进行hashing也是可能的(适合sharding和数据局部性)
1、查看物理CPU的个数
[root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
1
2、查看逻辑CPU的个数
[root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "processor"|wc -l
4
wenjianbao@wenjianbao-PC:~/Downloads/SecureCRT_8.3.4$ /usr/bin/SecureCRT /usr/bin/SecureCRT: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
刚装完 PHP、Nginx,准备跑下 phpMyAdmin 程序,结果报以下错误:
An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.If you are the system administrator of this resource then you should check theerror log for details.
Faithfully yours, nginx.
Discuz X3/X2.5默认开启缩略图的时候水印只添加到原图上面,而缩略图上面无法进行水印图的添加,需要改下程序,方可给缩略图添加水印,需要修改2个地方:
1、打开 source\function\function_post.php
2、查找
$image->Watermark($_G['setting']['attachdir'].'/forum/'.$newattachfile[$aid], '', 'forum');
要实现无限级分类,递归一般是第一个也是最容易想到的,但是递归一般被认为占用资源的方法,所以很多系统是不考虑使用递归的
本文还是通过数据库的设计,用一句sql语句实现
数据库字段大概如下:
字段 | 说明 |
---|---|
id | 编号 |
parend_id | 父分类编号 |
class_name | 分类名 |
path | 分类路径,以 id 为节点,组成类似 ,1,2,3,4, 这样的字符串 |
因为在某些场合下,服务提供者和服务消费者是直接可以调用的,不需要通过注册中心,本小节测试直连的调用:
Linux 开机自启动设置 inittab 详解:
# Default runlevel. The runlevels used are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # #id:5:initdefault: id:3:initdefault:
crontab的语法
crontab [-u username] [-l|-e|-r] 选项与参数: -u :只有 root 才能进行这个任务,亦即帮其他使用者创建/移除 crontab 工作排程; -e :编辑 crontab 的工作内容 -l :查阅 crontab 的工作内容 -r :移除所有的 crontab 的工作内容,若仅要移除一项,请用 -e 去编辑