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

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