Month: December 2016

CentOS 7.2 redis-3.0.5 WARNING solved

启动redis,显示告警如下: 8589:M 05 Dec 14:28:58.509 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 8589:M 05 Dec 14:28:58.509 # Server started, Redis version 3.0.5 8589:M 05 Dec 14:28:58.509 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect. 8589:M…

Read More »

Tuning Linux for MongoDB — 转

Tuning Linux for MongoDB Tim Vaillancourt  | August 12, 2016 |  Posted In: MongoDB In this post, we’ll discuss tuning Linux for MongoDB deployments. By far the most common operating system you’ll see MongoDB running on is Linux 2.6 and 3.x. Linux flavors such as CentOS and Debian do a fantastic job of being a stable, general-purpose operating system. Linux runs software on hardware ranging from tiny computers like the Raspberry Pi up to massive data center servers. To make this flexibility work,…

Read More »

mongodb 3.2.11 副本集 安装日志 主从仲裁

==================================================== 系统环境: CentOS release 6.2+ 安装软件: mongodb-linux-x86_64-rhel62-3.2.11.tgz 一、mongodb3 副本集规划 副本集名称: testrs (项目中根据实际情况修改) 以 192.168.100.x 为例 1.1 集群规划 192.168.100.1:27017 主 192.168.100.2:27017 从 192.168.100.3:27017 仲裁 – 不保存业务数据,节约硬盘空间 1.2 服务器目录规划 /home/mongodb3 mongodb-home目录 |_ bin 命令目录 |_ conf 配置目录 |_ data 数据目录 – 可建立符号链接 指向nas/其他目录 |_ master 主 |_ slaver 从 |_ arbiter 仲裁 |_ log mongodb运行日志目录 – 可建立符号链接 指向其他目录 1.3 用户 以 mongodb3 用户名为例(项目中根据实际情况定): # useradd mongodb3 二、操作系统配置 使用 root 用户登录 2.1 如果启用了iptables,将27001端口加入防火墙 # vi /etc/sysconfig/iptables 下面一行内容加在COMMIT之前 ——————————————- -A INPUT -p tcp –dport…

Read More »

mongodb 磁盘空间重用测试对比 (2.6.12 v.s. 3.2.11)

从测试日志可以看出: mongodb3默认的WiredTiger存储引擎,与mongodb2的MMAP相比,在空间利用率上有着质的飞越; mongodb3在删除集合后,对应的磁盘空间会立即回收,这极大的减轻了运维工作量。 以下是测试日志: mongodb_reuse_diskspace_test_log.txt $ mongo –version MongoDB shell version: 2.6.12 ===================================================== 测试集合名称:person2 准备 db.person2.drop(); db.repairDatabase(); $ du -h -d 1 data/master 80M data/master/admin 0B data/master/journal 10G data/master/local 80M data/master/logevents 10G data/master 写入727.2万 727.2万 person2.dataSize=1.6254186630249023G 每条数据 240bytes $ du -h -d 1 data/master 0B data/master/_tmp 80M data/master/admin 289M data/master/journal 10G data/master/local 4.0G data/master/logevents 14G data/master 再写入500万 [2016-12-15 14:08:33.460 CST] main INFO mongodb.MongoDbReuseDiskspaceTest: 1000000条记录已就绪 [2016-12-15 14:09:39.644 CST] main INFO mongodb.MongoDbReuseDiskspaceTest: 写入1000000条记录至Person2成功 [2016-12-15 14:09:40.471 CST] main INFO mongodb.MongoDbReuseDiskspaceTest: 1000000条记录已就绪 [2016-12-15 14:10:48.308…

Read More »

mac 重启 finder

重启Finder: 方法是按住Option键,『单击Dock上的Finder图标不放,大概2秒后』(或双指点触/鼠标右键)将在Finder图标上出现一个菜单,单击『重新启动』 see more: http://blog.csdn.net/aaa1117a8w5s6d/article/details/8589259

Read More »

CentOS 6 yum 安装 GlusterFS 3.6

GlusterFS 安装至 o2o-gluster-1,o2o-gluster-2 ============================================================ 两台机组成GlusterFS Server集群。 1、安装依赖包 # yum -y install wget # cd /etc/yum.repos.d/ # wget http://download.gluster.org/pub/gluster/glusterfs/3.6/LATEST/CentOS/glusterfs-epel.repo # yum -y install epel-release 2、安装服务端 (o2o-gluster-1,o2o-gluster-2) # yum install glusterfs-server # service glusterd start 或 # /etc/init.d/glusterd start # chkconfig glusterfsd on **如果是o2o-gluster-1,o2o-gluster-2集群** ———————————————– 下面这行命令在一台服务器上执行即可,状态将同步到其他服务器 例如在o2o-gluster-1上执行 # gluster peer probe o2o-gluster-2 ———————————————– 查看状态 # gluster peer status 注:已挂载独立硬盘分区到/gfs_data目录 在o2o-gluster-1和o2o-gluster-2中分别执行 # mkdir -p /gfs_data/glusterfs/brick1 **如果是o2o-gluster-1,o2o-gluster-2集群** ———————————————– 在o2o-gluster-1和o2o-gluster-2其中一台机器上执行 replica 指定副本数量 # gluster volume create gv0 replica 2 o2o-gluster-1:/gfs_data/glusterfs/brick1 o2o-gluster-2:/gfs_data/glusterfs/brick1 ———————————————– **如果是o2o-gluster-1单机** ———————————————– gluster…

Read More »

CentOS 6 yum 安装 nginx

# cat /etc/redhat-release CentOS release 6.5 (Final) # vi /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/6/x86_64/ gpgcheck=0 enabled=1 # yum install nginx 启动 # service ngnix start

Read More »

centos 7.2 yum 安装 MySQL 社区版

1、新建yum源 [root@myhost yum.repos.d]# pwd /etc/yum.repos.d [root@myhost yum.repos.d]# cat mysql-community.repo # Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64 enabled=1 gpgcheck=0 2、yum 安装MySQL社区版 [root@myhost yum.repos.d]# yum install mysql-community-server [root@myhost yum.repos.d]# systemctl list-unit-files | grep mysql [root@myhost yum.repos.d]# service mysql start 3、解决告警 [root@myhost yum.repos.d]# cat /var/log/mysqld.log | grep Warning 问题 2016-12-05 15:13:29 9005 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000) 2016-12-05 15:13:29 9005 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000) 解决 [root@myhost ~]# ulimit -a…

Read More »