Category - IT技术

redhat CentOS openssl    2017-07-19 22:48:22    10
前段时间,由于项目需要,安装keepalived,需要安装依赖包openssl-devel,可是无奈服务器不允许使用网络,无法使用yum安装,所以研究了下如何离线安装,进入了很多坑,所以记录分享下

声明:此文仅为其中一种方法,不要自己将思维局限于这一种方式

前提:基于redhat 6.5或者CentOS 6.5
软件包(由yum缓存中提取的):
http://pan.baidu.com/s/1dDHIEGD

rpm -e --nodeps keyutils-libs-1.4-4.el6.x86_64
rpm -ivh keyutils-libs-1.4-5.el6.x86_64.rpm
rpm -ivh keyutils-libs-devel-1.4-5.el6.x86_64.rpm 
rpm -ivh libsepol-devel-2.0.41-4.el6.x86_64.rpm 
rpm -e --nodeps libselinux-2.0.94-5.3.el6_4.1.x86_64        删除以后就再也装不上了,所以切勿执行。。。。,恢复,取消此操作,继续测试

rpm -e --nodeps libselinux-utils-2.0.94-5.3.el6_4.1.x86_64
rpm -Uvh libselinux-2.0.94-5.8.el6.x86_64.rpm   安装成功,由此绕过之前5步出错的bug,
rpm -ivh libselinux-devel-2.0.94-5.8.el6.x86_64.rpm
rpm -e --nodeps krb5-libs-1.10.3-10.el6_4.6.x86_64
rpm -ivh krb5-libs-1.10.3-42.el6.x86_64.rpm
rpm -e --nodeps libcom_err-1.41.12-18.el6.x86_64
rpm -ivh libcom_err-1.41.12-22.el6.x86_64.rpm 
rpm -ivh libcom_err-devel-1.41.12-22.el6.x86_64.rpm
rpm -ivh krb5-devel-1.10.3-42.el6.x86_64.rpm
rpm -ivh zlib-devel-1.2.3-29.el6.x86_64.rpm 
rpm -e --node
CentOS redis    2017-07-19 22:46:25    7

下载redis的安装包:http://download.redis.io/releases/redis-3.0.3.tar.gz

 

由于我的系统是刚装的,所以需要安装gcc才能编译成功,建议大家都先安装下gcc再安装文件
离线安装gcc方法,请看末尾
yum install gcc

然后再按照下面的方式执行

Installation

Download, extract and compile Redis with:

$ wget http://download.redis.io/releases/redis-3.0.3.tar.gz
$ tar xzf redis-3.0.3.tar.gz
$ cd redis-3.0.3
$ make

The binaries that are now compiled are available in the src directory. Run Redis with:

$ src/redis-server

You can interact with Redis using the built-in client:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
离线安装GCC方法
# rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm # rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm # rpm -ivh cpp-4.4.7-4.el6.x86_64.rpm # rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm # rpm -ivh gcc-4.4.7-4.el6.x86_64.rpm
离线包:http://pan.baidu.com/s/1i3lg73Z

 

by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(防止爬虫):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/


 
Centos keepalived 虚拟IP    2017-07-19 22:45:23    12
下载keepalived

http://www.keepalived.org/software/


首先检查安装openssl-devel

yum install openssl-devel

如果是离线,借鉴文章:http://blog.csdn.net/gsying1474/article/details/48396205

# ./configure --prefix=/usr/local/keepalived --with-kernel-dir=/usr/src/kernels/2.6.32-279.el6.x86_64



当出现如下字样
Keepalived configuration
------------------------
Keepalived version       : 1.2.19
Compiler                 : gcc
Compiler flags           : -g -O2
Extra Lib                : -lssl -lcrypto -lcrypt
Use IPVS Framework       : Yes
IPVS sync daemon support : Yes
IPVS use libnl           : No
fwmark socket support    : Yes
Use VRRP Framework       : Yes
Use VRRP VMAC            : Yes
SNMP support             : No
SHA1 support             : No
Use Debug flags          : No

执行安装命令

# make 
# make install


设置keepalived开机启动脚本

cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/

cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/

cp /usr/local/keepalived/sbin/keepalived /usr/sbin/

chkconfig keepalived on

新建一个配置文件,默认keepalived启

SELINUX MariaDB    2017-07-19 22:41:48    27
150812 23:38:24 [ERROR] WSREP: Permission denied
150812 23:38:24 [ERROR] WSREP: failed to open gcomm backend connection: 13: error while trying to listen 'tcp://0.0.0.0:4567?socket.non_blocking=1', asio error 'Permission denied': 13 (Permission denied)
  at gcomm/src/asio_tcp.cpp:listen():777
150812 23:38:24 [ERROR] WSREP: gcs/src/gcs_core.cpp:long int gcs_core_open(gcs_core_t*, const char*, const char*, bool)():206: Failed to open backend connection: -13 (Permission denied)
150812 23:38:24 [ERROR] WSREP: gcs/src/gcs.cpp:long int gcs_open(gcs_conn_t*, const char*, const char*, bool)():1379: Failed to open channel 'galera_cluster' at 'gcomm://192.168.100.220': -13 (Permission denied)
150812 23:38:24 [ERROR] WSREP: gcs connect failed: Permission denied
150812 23:38:24 [ERROR] WSREP: wsrep::connect() failed: 7
150812 23:38:24 [ERROR] Aborting




原因:

由于开启了SELINUX。

解决方法:

编辑文件/etc/sysconfig/selinux

把SELINUX设为disabled

重启后就会忽略selinux,或者直接执行命令

setenforce 0

立即生效。


 


 

by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交

Percona-xtrabackup    2017-07-19 22:39:16    11

Xtrabackup是什么Xtrabackup是一个对MySQL InnoDB做数据备份的工具,支持在线热备份(备份时不影响数据读写),是商业备份工具InnoDB Hotbackup的一个很好的替代品。

Xtrabackup有两个主要的工具:xtrabackup、innobackupex1.xtrabackup只能备份InnoDB和XtraDB两种数据表,而不能备份MyISAM数据表2.innobackupex是参考了InnoDB Hotbackup的innoback脚本修改而来的.innobackupex是一个perl脚本封装,封装了xtrabackup。主要是为了方便的同时备份InnoDB和MyISAM引擎的表,但在处理myisam时需要加一个读锁。并且加入了一些使用的选项。如slave-info可以记录备份恢复后,作为slave需要的一些信息,根据这些信息,可以很方便的利用备份来重做slave。

工具/原料

  • Ubuntu 13.10_X64+MySQL-server-5.5.35+percona-xtrabackup-2.1.7

方法/步骤

  1. 源码下载:http://www.percona.com/redir/downloads/XtraBackup/XtraBackup-2.1.7/binary/Linux/x86_64/percona-xtrabackup-2.1.7-721-Linux-x86_64.tar.gz

  2. 源码解压:tar -xzvf percona-xtrabackup-2.1.7-721-Linux-x86_64.tar.gz

  3. cd percona-xtrabackup-2.1.7-Linux-x86_64/bin/

  4. ll

    drwxr-xr-x 2 master master     4096 Jan 23 22:12 ./

    drwxr-xr-x 4 master master     4096 Jan 23 22:05 ../

    -rwxr-xr-x 1 master master   169816 Jan 23 22:12 innobackupex*

    lrwxrwxrwx 1 master master       12 Jan 23 22:12 innobackupex-1.5.1 -> innobackupex*

    -rwxr-xr-x 1 master maste

6/24