设为首页 收藏本站
查看: 1240|回复: 0

[经验分享] Percona-Server 5.7.18 编译安装

[复制链接]

尚未签到

发表于 2018-10-20 06:21:50 | 显示全部楼层 |阅读模式
1、第1个问题: boost的问题  
解压之后开始编译,如下参数
  
#cmake ./ -DCMAKE_INSTALL_PREFIX=/opt/app/mysql5 \
  
>          -DDEFAULT_CHARSET=utf8 \
  
>          -DDEFAULT_COLLATION=utf8_general_ci
  
-- Running cmake version 2.8.12.2
  
-- Could NOT find Git (missing:  GIT_EXECUTABLE)
  
-- Configuring with MAX_INDEXES = 64U
  
-- The C compiler identification is GNU 4.4.7
  
-- The CXX compiler identification is GNU 4.4.7
  
-- Check for working C compiler: /usr/bin/cc
  
-- Check for working C compiler: /usr/bin/cc -- works
  
-- Detecting C compiler ABI info
  
-- Detecting C compiler ABI info - done
  
-- Check for working CXX compiler: /usr/bin/c++
  
-- Check for working CXX compiler: /usr/bin/c++ -- works
  
-- Detecting CXX compiler ABI info
  
-- Detecting CXX compiler ABI info - done
  
-- CMAKE_GENERATOR: Unix Makefiles
  
-- Looking for SHM_HUGETLB
  
-- Looking for SHM_HUGETLB - found
  
-- Looking for sys/types.h
  
-- Looking for sys/types.h - found
  
-- Looking for stdint.h
  
-- Looking for stdint.h - found
  
-- Looking for stddef.h
  
-- Looking for stddef.h - found
  
-- Check size of void *
  
-- Check size of void * - done
  
-- SIZEOF_VOIDP 8
  
-- Performing Test HAVE_C_SHIFT_OR_OPTIMIZATION_BUG
  
-- Performing Test HAVE_C_SHIFT_OR_OPTIMIZATION_BUG - Failed
  
-- Performing Test HAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG
  
-- Performing Test HAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG - Failed
  
-- Performing Test HAVE_C_FLOATING_POINT_FUSED_MADD
  
-- Performing Test HAVE_C_FLOATING_POINT_FUSED_MADD - Failed
  
-- Performing Test HAVE_CXX_FLOATING_POINT_FUSED_MADD
  
-- Performing Test HAVE_CXX_FLOATING_POINT_FUSED_MADD - Failed
  
-- Performing Test HAVE_C_FP_CONTRACT_FLAG
  
-- Performing Test HAVE_C_FP_CONTRACT_FLAG - Failed
  
-- Performing Test HAVE_CXX_FP_CONTRACT_FLAG
  
-- Performing Test HAVE_CXX_FP_CONTRACT_FLAG - Failed
  
-- MySQL 5.7.18-16
  
-- Packaging as: percona-server-5.7.18-16-Linux-x86_64
  
-- Looked for boost/version.hpp in  and
  
-- BOOST_INCLUDE_DIR BOOST_INCLUDE_DIR-NOTFOUND
  
-- LOCAL_BOOST_DIR
  
-- LOCAL_BOOST_ZIP
  
-- Could not find (the correct version of) boost.
  
-- MySQL currently requires boost_1_59_0
  

  
CMake Error at cmake/boost.cmake:81 (MESSAGE):
  
  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=
  

  
  This CMake script will look for boost in .  If it is not there,
  
  it will download and unpack it (in that directory) for you.
  

  
  If you are inside a firewall, you may need to use an http proxy:
  

  
  export http_proxy=http://example.com:80
  

  
Call Stack (most recent call first):
  
  cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST)
  
  CMakeLists.txt:465 (INCLUDE)
  

  
-- Configuring incomplete, errors occurred!
  
See also "/root/percona-server-5.7.18-16/CMakeFiles/CMakeOutput.log".
  
See also "/root/percona-server-5.7.18-16/CMakeFiles/CMakeError.log".
  

  
于是google、百度去搜索解决办法,发现需要安装boost,其实上面的信息已经告诉我们了!于是下载
  
下载地址:http://www.boost.org/users/history/ 我开始下载使用的是1.65.0的版本,地址:
  
https://dl.bintray.com/boostorg/release/1.65.0/source/
  
然后解压安装:
  
#tar xf boost_1_65_0.tar.gz
  
#mv boost_1_65_0 /usr/local/boost
  
#cd  /usr/local/boost
  
# ./bootstrap.sh
  
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
  
Detecting Python version... 2.6
  
Detecting Python root... /usr
  
Unicode/ICU support for Boost.Regex?... not found.
  
Generating Boost.Build configuration in project-config.jam...
  

  
Bootstrapping is done. To build, run:
  

  
    ./b2
  

  
To adjust configuration, edit 'project-config.jam'.
  
Further information:
  

  
   - Command line help:
  
     ./b2 --help
  

  
   - Getting started guide:
  
     http://www.boost.org/more/getting_started/unix-variants.html
  

  
   - Boost.Build documentation:
  
     http://www.boost.org/build/doc/html/index.html
  
然后继续执行:
  
#./b2     #需要很长一些时间
  

  
………………
  
common.mkdir bin.v2/libs/wave/build/gcc-4.4.7/release/threading-multi/cpplexer/re2clex
  
gcc.compile.c++ bin.v2/libs/wave/build/gcc-4.4.7/release/threading-multi/cpplexer/re2clex/aq.o
  
gcc.compile.c++ bin.v2/libs/wave/build/gcc-4.4.7/release/threading-multi/cpplexer/re2clex/cpp_re.o
  
gcc.link.dll bin.v2/libs/wave/build/gcc-4.4.7/release/threading-multi/libboost_wave.so.1.65.0
  
common.copy stage/lib/libboost_wave.so.1.65.0
  
ln-UNIX stage/lib/libboost_wave.so
  
...failed updating 54 targets...
  
...skipped 6 targets...
  
...updated 1107 targets...
  

  
当完成到这一步就证明已经完成了boost_1_65_0的安装,然后继续重新编译,添加了1个参数,如下:
  
# cmake ./ -DCMAKE_INSTALL_PREFIX=/opt/app/mysql5 \
  
>          -DDEFAULT_CHARSET=utf8 \
  
>          -DDEFAULT_COLLATION=utf8_general_ci \
  
>          -DWITH_BOOST=/usr/local/boost
  
-- Running cmake version 2.8.12.2
  
-- Configuring with MAX_INDEXES = 64U
  
-- CMAKE_GENERATOR: Unix Makefiles
  
-- SIZEOF_VOIDP 8
  
-- MySQL 5.7.18-16
  
-- Packaging as: percona-server-5.7.18-16-Linux-x86_64
  
-- Local boost dir /usr/local/boost
  
-- Found /usr/local/boost/boost/version.hpp
  
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 106500
  
CMake Warning at cmake/boost.cmake:266 (MESSAGE):
  
  Boost minor version found is 65 we need 59
  
Call Stack (most recent call first):
  
  CMakeLists.txt:465 (INCLUDE)
  

  
-- BOOST_INCLUDE_DIR /usr/local/boost
  
-- LOCAL_BOOST_DIR /usr/local/boost
  
-- LOCAL_BOOST_ZIP LOCAL_BOOST_ZIP-NOTFOUND
  
-- Could not find (the correct version of) boost.
  
-- MySQL currently requires boost_1_59_0
  

  
CMake Error at cmake/boost.cmake:81 (MESSAGE):
  
  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=
  

  
  This CMake script will look for boost in .  If it is not there,
  
  it will download and unpack it (in that directory) for you.
  

  
  If you are inside a firewall, you may need to use an http proxy:
  

  
  export http_proxy=http://example.com:80
  

  
Call Stack (most recent call first):
  
  cmake/boost.cmake:269 (COULD_NOT_FIND_BOOST)
  
  CMakeLists.txt:465 (INCLUDE)
  

  

  
-- Configuring incomplete, errors occurred!
  
See also "/root/percona-server-5.7.18-16/CMakeFiles/CMakeOutput.log".
  
See also "/root/percona-server-5.7.18-16/CMakeFiles/CMakeError.log".
  

  
但是依然继续报错……在网上又找到了另外一个解决方法于是按照此方法操作
  
删除boost目录下的所有文件:
  
#rm -rf /usr/local/boost/*
  

  
再添加1个编译参数,重新cmake,如下:
  
#cmake ./ -DCMAKE_INSTALL_PREFIX=/opt/app/mysql5 \
  
         -DDEFAULT_CHARSET=utf8 \
  
         -DDEFAULT_COLLATION=utf8_general_ci \
  
         -DDOWNLOAD_BOOST=1 \
  
         -DWITH_BOOST=/usr/local/boost
  
会输出如下信息:
  
-- Running cmake version 2.8.12.2
  
-- Configuring with MAX_INDEXES = 64U
  
-- CMAKE_GENERATOR: Unix Makefiles
  
-- SIZEOF_VOIDP 8
  
-- MySQL 5.7.18-16
  
-- Packaging as: percona-server-5.7.18-16-Linux-x86_64
  
-- Downloading boost_1_59_0.tar.gz to /usr/local/boost
  
可以看到在自己下载boost_1_59_0.tar.gz,这就是为什么开始的时候我选在下载1_59版本的原因!!!
  
但是会卡在这里,于是停止编译,自己在官网下载boost_1_59_0.tar.gz 放在/usr/local/boost目录
  

  
2、cmake 过程中的软件包依赖问题
  

  
然后删除percona-server-5.7.18-16目录,重新解压编译
  
#cmake ./ -DCMAKE_INSTALL_PREFIX=/opt/app/mysql5 \
  
>          -DDEFAULT_CHARSET=utf8 \
  
>          -DDEFAULT_COLLATION=utf8_general_ci \
  
>          -DWITH_BOOST=/usr/local/boost
  
-- Running cmake version 2.8.12.2
  
-- Configuring with MAX_INDEXES = 64U
  
-- CMAKE_GENERATOR: Unix Makefiles
  
-- SIZEOF_VOIDP 8
  
-- MySQL 5.7.18-16
  
-- Packaging as: percona-server-5.7.18-16-Linux-x86_64
  
-- Local boost zip /usr/local/boost/boost_1_59_0.tar.gz
  
-- cd /usr/local/boost; tar xfz /usr/local/boost/boost_1_59_0.tar.gz
  
……
  

  
-- Check size of wint_t - done
  
-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
  
CMake Error at cmake/readline.cmake:66 (MESSAGE):
  
  Curses library not found.  Please install appropriate package,
  

  
      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
  
Call Stack (most recent call first):
  
  cmake/readline.cmake:190 (FIND_CURSES)
  
  cmake/readline.cmake:264 (FIND_SYSTEM_READLINE)
  
  CMakeLists.txt:493 (MYSQL_CHECK_EDITLINE)
  

  

  
-- Configuring incomplete, errors occurred!
  
See also "/root/percona-server-5.7.18-16/CMakeFiles/CMakeOutput.log".
  
See also "/root/percona-server-5.7.18-16/CMakeFiles/CMakeError.log".
  
结果又报了上面提示的错误,意思是找不到CURSES_LIBRARY,
  
解决方法:
  
#rm -f CMakeCache.txt
  
安装依赖包:
  
#yum install ncurses  ncurses-devel readline readline-devel -y
  
注意:所以上面第二步,才提到在cmake的时候会遇到各种奇葩问题,其实是很多依赖包没有安装,安装
  
之后,重新cmake就ok了。



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-623766-1-1.html 上篇帖子: oracle联合查询并更新一个表字段的sql语句 下篇帖子: 【MantisBT】之如何使用SQL批量添加版本信息
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表