新来到公司,需要我部署一套公司应用的环境,具体干啥就不说了,直接看操作,这里主要想和大家分享下部署环境时遇到的问题,希望大家遇到同样的问题是,可以在这里快速找到答案
第一步,系统准备
- 安装软件列表
sshfs
sshpass
cifs-utils - 其他对接系统 硬盘库,光盘库,磁带库等系统安装单独处理,此处不涉及
- 部分系统无法直接安装sshfs,请参考下文
https://www.cnblogs.com/levi125/p/13685733.html
第二步,开始准备安装达梦数据库
先部署一下基础的环境,参照如下脚本
#!/bin/bash # host添加 源地址 echo ‘199.232.96.133 raw.githubusercontent.com‘ >> /etc/hosts # 下载nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash echo ‘export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"‘ >> /etc/profile source /etc/profile nvm --version # 下载node.js nvm install v10.12.0 node -v # 下载unixodbc yum install unixodbc # 配置odbc cp odbc.ini /etc/ cp odbcinst.ini /etc/ #配置达梦环境变量 echo "export LD_LIBRARY_PATH=/usr/local/lib:/opt/dmdbms/bin:\$LD_LIBRARY_PATH" >> /etc/profile echo "export PATH=/opt/dmdbms/bin:\$PATH" >> /etc/profile source /etc/profile odbcinst -j isql -v DM8
进入环境部署的第二阶段
##更新yum源,ubuntu可以忽略 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo sed -i ‘s/$releasever/7/g‘ /etc/yum.repos.d/CentOS-Base.repo #清空缓存:yum clean all #生成缓存:yum makecache #更新源:sudo yum update 更新gcc版本到5.4 下载: Wget http://mirror.hust.edu.cn/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2(国内镜像) gcc ftp下载地址: ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.7.2/ 下载完成后,执行命令: tar -jxvf gcc-5.4.0.tar.bz2 获得gcc-5.4.0文件夹 mkdir build (以后的操作目录) cd gcc-5.4.0/ ./contrib/download_prerequisites(这里在下载一些安装gcc会用到的文件,如果没配置wget则会失败。) cd ../build/ (来到工作目录) 接下来要安装gmp、mpfr、mpc gmp: ../gcc-5.4.0/gmp-4.3.2/configure sudo make sudo make install mpfr: ../gcc-5.4.0/mpfr-2.4.2/configure sudo make sudo make install ../gcc-5.4.0/mpc-0.8.1/configure sudo make sudo make install 现在再安装gcc就可以了 ../gcc-5.4.0/configure –enable-threads=posix –disable-checking –disable-multilib –enable-languages=c,c++ sudo make (及其耗时,将近两个小时) sudo make install gcc –version (验证gcc版本是否为5.4.0) 参考:https://www.qedev.com/linux/91867.html
../gcc-5.4.0/configure –enable-threads=posix –disable-checking –disable-multilib –enable-languages=c,c++ -disable-libsanitizer #需要加上最后一段,不然会出现问题3 ####### 遇到的问题 1 ./md-unwind-support.h:61:47: 错误: dereferencing pointer to incomplete type ‘struct ucontext’ sc = (struct sigcontext *) (void *) &uc_->uc_mcontext ———————————————— 问题参考链接 https://blog.csdn.net/juan190755422/article/details/103709300 ####### 问题2 ../../../../gcc-5.4.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:146:23: 致命错误: sys/ustat.h:没有那个文件或目录 编译中断。 make[4]: *** [Makefile:449:sanitizer_platform_limits_posix.lo] 错误 1 make[4]: 离开目录“/home/software/gcc/build/x86_64-unknown-linux-gnu/libsanitizer/sanitizer_common” make[3]: *** [Makefile:437:all-recursive] 错误 1 make[3]: 离开目录“/home/software/gcc/build/x86_64-unknown-linux-gnu/libsanitizer” make[2]: *** [Makefile:307:all] 错误 2 make[2]: 离开目录“/home/software/gcc/build/x86_64-unknown-linux-gnu/libsanitizer” make[1]: *** [Makefile:16925:all-target-libsanitizer] 错误 2 make[1]: 离开目录“/home/software/gcc/build” make: *** [Makefile:913:all] 错误 2 参考链接 https://zhuanlan.zhihu.com/p/377881136 ############ 问题3 In file included from ../../../../gcc-5.4.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:179:0: ../../../../gcc-5.4.0/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:272:72: 错误: size of array ‘assertion_failed__1090’ is negative 参考链接 https://zhuanlan.zhihu.com/p/357264769
在安装gcc的时候遇到了一些问题,做一下总结