分类归档

服务器教程

服务器知识、操作系统教程、服务器常用软件等

FWQ
服务器教程
centos 7中与网络有关的命令
1、启动、停止、关闭网络服务 systemctl retart network.service 或 systemctl restart network systemctl start network.service 或 systemctl start network systemctl stop network.service 或 systemctl stop network   2、启用、停止单个网卡的服务 #ifconfig [网卡名] down #…
2024-11-24 阅读全文 →
FWQ
服务器教程
Mongodb的安装和启动
1、官方下载地址:https://www.mongodb.com/download-center 2、官方安装文档:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/ 3、官方使用文档:https://docs.mongodb.com/manual/ 4、官方中文文档:http://docs.mongoing.com/manual-zh/index.html   4、yum安装: [mongodb-org-3.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc yum list | grep mongodb 中各.rpm包的作用 #包含所有的mongodb中所有的安装包 mongodb-org    A metapackage that will automatically install the…
2024-11-24 阅读全文 →
FWQ
服务器教程
Mongodb的配置
1、配置文件目录:/etc/mongod 2、官方配置文档:https://docs.mongodb.com/manual/reference/configuration-options/   # mongod.conf # for documentation of all options, see: #   http://docs.mongodb.org/manual/reference/configuration-options/ # where to write logging data. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log #…
2024-11-24 阅读全文 →
FWQ
服务器教程
Mongodb安装过程中的问题
1、** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.  **        We suggest setting it to ‘never’   ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.  **        We suggest setting it to ‘never’ 临时解决方案: echo "never"…
2024-11-24 阅读全文 →
FWQ
服务器教程
php7的安装以及编译中的错误
1、下载地址:http://idc.net/downloads.php 2、configure的配置如下: ./configure –prefix=/usr/local/php7 -with-config-file-path=/usr/local/php7/etc -with-mcrypt=/usr/local/libmcrypt -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-gd -with-iconv -with-zlib -enable-xml -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -enable-mbregex -enable-fpm -enable-mbstring -enable-ftp -enable-gd-native-ttf -with-openssl -enable-pcntl -enable-sockets -with-xmlrpc -enable-zip -enable-soap -without-pear…
2024-11-24 阅读全文 →
FWQ
服务器教程
PHP7中的MongoDB\Driver\Manager
这个MongoDB中的操作入口类,包括了连接MongoDB服务器、write、query的操作. final public MongoDB\Driver\Manager::__construct ( string $uri [, array $options [, array $driverOptions ]] ) 构造函数,连接MongoDB,连接方式有很多种 # 连接表达式 mongodb://[username:password@]host1[:port1][,host2[:port2],.. .[,hostN[:portN]]][/[database][?options]] final public MongoDB\Driver\WriteResult MongoDB\Driver\Manager::executeBulkWrite ( string $namespace ,…
2024-11-24 阅读全文 →
FWQ
服务器教程
PHP7中的MongoDB\Driver\WriteConcern
这个是个对mongodb的写入性能、以及确保数据一致性的控制设置,非常重要的一个类 1、final public MongoDB\Driver\WriteConcern::__construct ( string|int $w [, integer $wtimeout [, boolean $journal ]] ) 参数:$w 1:默认的writeConcern,数据写入到Primary就向客户端发送确认 0:对客户端的写入不需要发送任何确认,适用于性能要求高,但不关注正确性的场景 majority:数据写入到副本集大多数成员后向客户端发送确认,适用于对数据安全性要求比较高的场景,该选项会降低写入性能 $journal:默认为”{j: false},如果要求Primary写入持久化了才向客户端确认,则指定该选项为true $wtimeout:写入超时时间,仅$w的值大于1时有效 当指定{w: }时,数据需要成功写入number个节点才算成功,如果写入过程中有节点故障,可能导致这个条件一直不能满足,从而一直不能向客户端发送确认结果,针对这种情况,客户端可设置wtimeout选项来指定超时时间,当写入过程持续超过该时间仍未结束,则认为写入失败。 2、final public object MongoDB\Driver\WriteConcern::bsonSerialize…
2024-11-24 阅读全文 →
FWQ
服务器教程
PHP7中的MongoDB\Driver\WriteConcern
这个是个对mongodb的写入性能、以及确保数据一致性的控制设置,非常重要的一个类 1、final public MongoDB\Driver\WriteConcern::__construct ( string|int $w [, integer $wtimeout [, boolean $journal ]] ) 参数:$w 1:默认的writeConcern,数据写入到Primary就向客户端发送确认 0:对客户端的写入不需要发送任何确认,适用于性能要求高,但不关注正确性的场景 majority:数据写入到副本集大多数成员后向客户端发送确认,适用于对数据安全性要求比较高的场景,该选项会降低写入性能 $journal:默认为”{j: false},如果要求Primary写入持久化了才向客户端确认,则指定该选项为true $wtimeout:写入超时时间,仅$w的值大于1时有效 当指定{w: }时,数据需要成功写入number个节点才算成功,如果写入过程中有节点故障,可能导致这个条件一直不能满足,从而一直不能向客户端发送确认结果,针对这种情况,客户端可设置wtimeout选项来指定超时时间,当写入过程持续超过该时间仍未结束,则认为写入失败。 2、final public object MongoDB\Driver\WriteConcern::bsonSerialize…
2024-11-24 阅读全文 →
FWQ
服务器教程
RabbitMQ中的权限控制
在刚开始看RabbitMq权限的时候,分不清楚角色和权限(permission)的区别和用法,今天把我对它们的理解做一个总结。   角色 也可以理解为权限,但它只是针对管理RabbitMQ的权限,包括vhost、用户、exchange、queue、链接等。举个实际的例子:假设开启了rabbitmq_manage 的插件,通过set_user_tags 就可以赋予某个用户使用rabbitmq_manage的权限。 系统默认有5种角色:none、management、policymaker、monitoring、administrator none 不能访问 management plugin management 用户可以通过AMQP做的任何事外加: 列出自己可以通过AMQP登入的virtual hosts 查看自己的virtual hosts中的queues, exchanges 和 bindings 查看和关闭自己的channels 和 connections 查看有关自己的virtual hosts的“全局”的统计信息,包含其他用户在这些virtual hosts中的活动。 policymaker management可以做的任何事外加:…
2024-11-19 阅读全文 →