单列唯一约束
1 | ALTER TABLE `t_user` ADD unique(`username`); |
多列联合唯一约束
1 | ALTER TABLE table_name ADD UNIQUE KEY(key1, key2); |
RocktMQ Version 4.2.0
如果在配合gRPC使用的时候,会出现io.netty库多版本问题,造成部署失败
1 | <!-- RocketMQ --> |
原因:服务器存在多网卡
解决:在broker的配置文件中指定brokerIP参数的ip地址即可
1 | proxy_set_header X-Real-IP $remote_addr; |
1 | val split = request.getHeader("X-Forwarded-For").split(",") |
REMOTE_ADDR - This contains the real IP address of the client. That is the most reliable value you can find from the user.
REMOTE_HOST - This will fetch the Host name from which the user is viewing the current page. But for this script to work, Hostname Lookups On inside httpd.conf must be configured.
The error “volume node affinity conflict” happens when the persistent volume claims that the pod is using are scheduled on different zones, rather than on one zone, and so the actual pod was not able to be scheduled because it cannot connect to the volume from another zone.
1 | kind: StorageClass |
由于Container Engine在创建角色或ClusterRole时检查权限的方式,因此必须先创建一个RoleBinding,以授予您要创建的角色中包含的所有权限。
1 | gcloud info | grep Account |
1 | kubectl create clusterrolebinding myname-cluster-admin-binding \ |
1 | apiVersion: rbac.authorization.k8s.io/v1beta1 |
1 | apiVersion: apps/v1beta1 |
1 | AttachVolume.Attach failed for volume "pvc-9f48652a-e478-4f91-8fc8-42b27587338d" : failed to attach e7246a1a-3def-4e33-97d1-b26ff3b66ade volume to 9e202548-f70f-4422-b870-2c9629f718b0 compute: Expected HTTP response code [200] when accessing [POST https://compute.bhs5.cloud.ovh.net/v2.1/9132a2edd6544bd794768a0286a9a24a/servers/9e202548-f70f-4422-b870-2c9629f718b0/os-volume_attachments], but got 409 instead {"conflictingRequest": {"message": "Cannot 'attach_volume' instance 9e202548-f70f-4422-b870-2c9629f718b0 while it is in task_state migrating", "code": 409}} |
ReadWriteOnce:是最基本的方式,可读可写,但只支持被单个Pod挂载。
ReadOnlyMany:可以以只读的方式被多个Pod挂载。
ReadWriteMany:这种存储可以以读写的方式被多个Pod共享。
1 | spec: |
减轻用户对于存储资源细节的关注
减轻管理员手工管理PV的工作,由系统完成PV的创建和绑定,实现动态的资源供应
1 | kind: StorageClass |
策略类型:
Retain 手动重新使用
Recycle 基本的数据擦除 (“rm -rf /thevolume/*”)