redis崩溃
git filter-branch 瘦身 爽歪歪
git filter-branch –tree-filter ‘rm release/xxxx-201*’ HEAD
mongodb 3.4 官方资源导航
1. keyfiles内部验证
https://docs.mongodb.com/manual/core/security-internal-authentication/#keyfiles
2. 使用keyfile进行复制集之间的验证
https://docs.mongodb.com/manual/tutorial/enforce-keyfile-access-control-in-existing-replica-set/
3. 用户权限规矩
https://docs.mongodb.com/manual/reference/built-in-roles/#built-in-roles
** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/
** WARNING: Access control is not enabled for the database.
1. createUser
use admin
db.createUser(
{
user: "root",
pwd: "xxxxxx",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
)
2. Enable Auth
** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
卸载分区
umount /mnt/mongo
格式化为xfs(会丢失所有数据)
mkfs.xfs /dev/mapper/vg1-lvMongo -f
修改fstab,类型修改为xfs
vim /etc/fstab
change ext4 to xfs
自动挂载
mount -a
cannot concatenate ‘str’ and ‘NoneType’ objects
./psycopg/psycopg.h:31:22: fatal error: libpq-fe.h: No such file or directory
yum install libpqxx-devel
pip install psycopg2后就web.py可以happy的访问数据库了
postgres — PostgreSQL database server 安装和简单配置教程(centos7)
安装:
yum install postgresql-server
配置开机启动:
systemctl enable postgresql
初始化数据库:
postgresql-setup initdb
创建和删除数据库:
[root@web4 ~]# su - postgres Last login: Mon Mar 20 01:14:46 CST 2017 on pts/0 -bash-4.2$ -bash-4.2$ createdb xxxxx -bash-4.2$ createdb mydb -bash-4.2$ dropdb mydb
访问数据库:
psql xxxxx
web.py注册为服务(centos7)
命令行脚本:
/usr/bin/python /mnt/www/xxx/scripts/mq.py
创建服务文件(服务名xxx)
vim /usr/lib/systemd/system/xxx.service
xxx.service 文件内容
[Unit] Description=The doufu python message queue server After=network.target remote-fs.target nss-lookup.target [Service] Type=simple #PIDFile= #ExecStartPre= #ExecStartPre= ExecStart=/usr/bin/python /mnt/www/xxx/scripts/mq.py ExecReload=/usr/bin/python /mnt/www/xxx/scripts/mq.py KillSignal=SIGQUIT TimeoutStopSec=5 KillMode=process PrivateTmp=true [Install] WantedBy=multi-user.target
# 启用服务(开机自动启动) systemctl enable xxx.service # 查看服务状态 systemctl status xxx.service # 开始服务 systemctl start xxx.service # 查看服务状态 systemctl status xxx.service