Monthly Archives: September 2018

Day11.Mysql主从配置

1、配置主-从-从结构,并做各种测试 第一步,配置主库51 vim /etc/my.cnf [root@51 mysql]# grep -v “^#” /etc/my.cnf | grep -v “^$” [mysqld] validate_password_policy = 0 validate_password_length = 6 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock symbolic-links=0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid log-bin=master51 server_id=51 binlog_format=”mixed” [root@51 mysql]# systemctl restart mysqld [root@51 mysql]# mysql -uroot -p123456 mysql> … Continue reading

Posted in mysql | Tagged | Leave a comment

创建Redis集群(重新修改)

创建Redis集群 为6台主机安装并运行redis服务 # yum -y install gcc gcc-c++ # tar -zxvf redis-4.0.8.tar.gz # cd redis-4.0.8/ # make # make install # ./utils/install_server.sh • 调整配置文件 # vim /etc/redis/redis.conf bind IP地址 //只写物理接口IP地址 daemonize yes //守护进程方式运行 port xxxx //端口号不要使用默认的6379 cluster-enabled yes//启用集群 cluster-config-file nodes-xxxx.conf//指定集群信息文件 … Continue reading

Posted in reids | Tagged | Leave a comment

Redis绑定IP后报 bind: Cannot assign requested address 异常解决方法

Redis绑定IP后报 bind: Cannot assign requested address 异常解决方法 今天在研究Redis安全设置,提到bind IP地址,然后就在redis.conf文件中的bind项后加入了客户端的IP,以为是绑定了IP的机器才能访问Redis,修改完成后重启,报错了: Creating Server TCP listening socket 192.168.1.55:6379: bind: Cannot assign requested address 提示监听192.168.1.55地址的6379端口错误,无法分配请求地址! 报着疑问,百度了一下,发现原来是我理解错了bind关键字的意义,原来的作用是绑定本机IP和地址 这个是知乎上的解答:http://www.zhihu.com/question/27220050/answer/38463570 redis.conf中的原文解释: # By default Redis listens for connections from all the network interfaces # available on the … Continue reading

Posted in reids | Tagged | Leave a comment

安装redis make报错 zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录

原因分析: 在redis的解压包下有个README文件,打开这个文件 有这个一段话。 llocator ——— Selecting a non-default memory allocator when building Redis is done by setting the `MALLOC` environment variable. Redis is compiled and linked against libc malloc by default, with the exception of jemalloc being the default on Linux … Continue reading

Posted in reids | Tagged | Leave a comment