1.安装ubuntu

http://mirrors.163.com/ubuntu-releases/18.04.4/

使用以上的国内地址下载镜像速度更快,使用的ubuntu版本是ubuntu-18.04.5-desktop-amd64.iso。

虚拟机使用vmware,安装过程略过,可能遇到卡在安装vmtools,参考https://blog.csdn.net/qq_34415586/article/details/80347813解决。

安装完成后配置为国内源,参考https://www.cnblogs.com/bug132294/p/12749192.html。

2.下载scylladb源码

安装git:sudo apt-get install git

拉取scylla源码,使用了国内的git源:

git clone https://github.com.cnpmjs.org/scylladb/scylla.git

切换到tag:

git checkout scylla-4.1.0 -b scylla4.1.0

拉取子项目代码:

git submodule update --init --recursive

3.安装依赖

增加scylladb依赖库的源:

sudo add-apt-repository -y ppa:scylladb/ppa

安装依赖包:

sudo ./install-dependencies.sh

4.configure

install-dependencies.sh运行完毕后会提示configure的语法:

./configure.py --enable-dpdk --mode=release --static-thrift --static-boost --static-yaml-cpp --compiler=/opt/scylladb/bin/g++-7 --cflags="-I/opt/scylladb/include -L/opt/scylladb/lib/x86-linux-gnu/" --ldflags="-Wl,-rpath=/opt/scylladb/lib"

4.1版本应该需要g++8,需要安装一下。更新的版本可能需要g++10,目前需要使用源码安装。

安装g++8:

sudo apt-get install g++-8

运行configure.py,修改了g++的路径:

./configure.py --enable-dpdk --mode=release --static-thrift --static-boost --static-yaml-cpp --compiler=/usr/bin/g++-8 --cflags="-I/opt/scylladb/include -L/opt/scylladb/lib/x86-linux-gnu/" --ldflags="-Wl,-rpath=/opt/scylladb/lib"

报错:

CMake Error at cmake/SeastarDependencies.cmake:107 (find_package):
  Could not find a configuration file for package "fmt" that is compatible
  with requested version "5.0.0".
需要安装更新版的fmt,先删除原来的:sudo apt remove libfmt-dev,再安装:

wget -c http://archive.ubuntu.com/ubuntu/pool/universe/f/fmtlib/libfmt-dev_5.2.1+ds-2_amd64.deb

sudo apt install ./libfmt-dev_5.2.1+ds-2_amd64.deb

重新config,又报错:

No package 'jsoncpp' found

安装:

sudo apt-get install libjsoncpp-dev

重新config,又报错:

No package 'libxxhash' found

安装:

wget http://ftp.cn.debian.org/debian/pool/main/x/xxhash/libxxhash0_0.8.0-1_amd64.deb

sudo apt install ./libxxhash0_0.8.0-1_amd64.deb

wget http://mirrors.ustc.edu.cn/debian/pool/main/x/xxhash/libxxhash-dev_0.8.0-1_amd64.deb

sudo apt install ./libxxhash-dev_0.8.0-1_amd64.deb\

重新config,又报错:

Traceback (most recent call last):
  File "./configure.py", line 1308, in <module>
    proc_res = subprocess.run(["thrift", "-version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'thrift': 'thrift'
安装thrift:

sudo apt install thrift-compiler

重新config,又报错:

No package 'lua' found

查看configure.py脚本,似乎需要5.3版本,因此安装:

sudo apt-get install liblua5.3-dev

重新config成功

5.编译

命令:

ninja release -j 6

执行报错:

File "./idl-compiler.py", line 25, in <module>
    import pyparsing as pp
ModuleNotFoundError: No module named 'pyparsing'

这个是python的包,因此安装:

sudo apt-get install python-pip

使用-i清华源安装,也可以先配置到配置文件:

pip install pyparsing -i https://pypi.tuna.tsinghua.edu.cn/simple

再执行,下一个报错:

#include <thrift/Thrift.h>

安装:

sudo apt-get install scylla-libthrift010-dev

报错:

build/release/gen/alternator/expressionsLexer.hpp:55:10: fatal error: antlr3.hpp: No such file or directory
 #include <antlr3.hpp>

安装:

sudo apt-get install scylla-antlr35-c++-dev

可能版本不大对,依赖没安装全,问题比较多

报错:

/usr/include/boost/icl/type_traits/type_to_string.hpp:56:12: error: partial specialization of ‘struct boost::icl::type_to_string<Unary<Type> >’ after instantiation of ‘struct boost::icl::type_to_string<std::__cxx11::basic_string<char> >’ [-fpermissive]修改/usr/include/boost/icl/type_traits/type_to_string.hpp,调整了代码顺序:namespace boost{ namespace icl
{//--------------------------------------------------------------------------template<class Type>struct type_to_string{/** Convert the type to it's typestring */static std::string apply();};//-------------------------------------------------------------------------template<template<class> class Templ>struct unary_template_to_string{static std::string apply();};template <template<class>class Unary, class Type>struct type_to_string<Unary<Type> >{static std::string to_string(){return unary_template_to_string<Unary>::apply()+"<"+type_to_string<Type>::apply()+">";}};// ---------------------------------------------------------------------------template<template<class,class>class Templ>struct binary_template_to_string{static std::string apply();};template <template<class Type1, class Type2>class Binary, class Type1, class Type2>struct type_to_string<Binary<Type1, Type2> >{static std::string apply(){return binary_template_to_string<Binary>::apply()+"<"+type_to_string<Type1>::apply()+","+type_to_string<Type2>::apply()+">";}};//--------------------------------------------------------------------------template<>inline std::string type_to_string<bool>::apply() { return "bool"; }template<>inline std::string type_to_string<char>::apply() { return "char"; }template<>inline std::string type_to_string<short>::apply(){ return "short"; }template<>inline std::string type_to_string<int>::apply()  { return "int"; }template<>inline std::string type_to_string<long>::apply() { return "long"; }template<>inline std::string type_to_string<long long>::apply(){ return "Long"; }template<>inline std::string type_to_string<unsigned char>::apply(){ return "char+"; }template<>inline std::string type_to_string<unsigned short>::apply(){ return "short+"; }template<>inline std::string type_to_string<unsigned int>::apply()  { return "int+"; }template<>inline std::string type_to_string<unsigned long>::apply() { return "long+"; }template<>inline std::string type_to_string<unsigned long long>::apply(){ return "Long+"; }template<>inline std::string type_to_string<float>::apply() { return "flt"; }template<>inline std::string type_to_string<double>::apply() { return "dbl"; }template<>inline std::string type_to_string<std::string>::apply() { return "string"; }}} // namespace boost icl

报错:

compress.cc:24:10: fatal error: snappy-c.h: No such file or directory
 #include <snappy-c.h>

安装:

sudo apt-get install libsnappy-dev

报错:

g++-8: fatal error: Killed signal terminated program cc1plus

原因应该是虚拟机内存配了8G不大够用,减少线程数:ninja release -j 2

报错:

./alternator/rjson.hh:65:10: fatal error: rapidjson/document.h: No such file or directory
 #include <rapidjson/document.h>

安装:

sudo apt-get install rapidjson-dev

报错一堆gnutls相关未定义:

In file included from alternator/auth.cc:26:
/usr/include/gnutls/crypto.h:35:10: error: ‘gnutls_cipher_algorithm_t’ has not been declared
          gnutls_cipher_algorithm_t cipher,
          ^~~~~~~~~~~~~~~~~~~~~~~~~

修改alternator/auth.cc:增加#include <gnutls/gnutls.h>

报错:

g++-8: error: /usr/lib/x86_64-linux-gnu/libunistring.so: No such file or directory

安装:

sudo apt-get install libunistring-dev

报错:

build/release/gen/Cassandra.cpp:16366: error: undefined reference to 'apache::thrift::TApplicationException::write(apache::thrift::protocol::TProtocol*) const'
collect2: error: ld returned 1 exit status

修改:

sudo cp /opt/scylladb/lib/libthrift* /usr/lib

报错:

/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libboost_regex.a(icu.o):function boost::basic_regex<int, boost::icu_regex_traits>::imbue(icu_60::Locale): error: undefined reference to 'icu_60::Collator::createInstance(icu_60::Locale const&, UErrorCode&)'
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libboost_regex.a(icu.o):function boost::basic_regex<int, boost::icu_regex_traits>::imbue(icu_60::Locale): error: undefined reference to 'icu_60::Collator::createInstance(icu_60::Locale const&, UErrorCode&)'
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libboost_regex.a(icu.o):function boost::basic_regex<int, boost::icu_regex_traits>::imbue(icu_60::Locale): error: undefined reference to 'icu_60::Collator::createInstance(icu_60::Locale const&, UErrorCode&)'
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libboost_regex.a(icu.o):function boost::basic_regex<int, boost::icu_regex_traits>::imbue(icu_60::Locale): error: undefined reference to 'icu_60::Collator::createInstance(icu_60::Locale const&, UErrorCode&)'
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libicuuc.a(udata.ao):function openCommonData(char const*, int, UErrorCode*): error: undefined reference to 'icudt60_dat'
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libicuuc.a(udata.ao):function openCommonData(char const*, int, UErrorCode*): error: undefined reference to 'icudt60_dat'

搜这两个函数搜到两个库

./x86_64-linux-gnu/libicuuc.so.60

./x86_64-linux-gnu/libicui18n.so.60.2

编辑build.ninja,修改以下内容:

libs = -Wl,-Bstatic -lyaml-cpp -Wl,-Bdynamic -latomic -llz4 -lz -lsnappy -ljsoncpp  -lstdc++fs  -lcrypt  -lcryptopp  -lpthread -Wl,-Bstatic -lboost_date_time -lboost_regex -licuuc -Wl,-Bdynamic -lxxhash -llua5.3 -lsystemd

修改为:

libs = -licuuc -licui18n -Wl,-Bstatic -lyaml-cpp -Wl,-Bdynamic -latomic -llz4 -lz -lsnappy -ljsoncpp  -lstdc++fs  -lcrypt  -lcryptopp  -lpthread -Wl,-Bstatic -lboost_date_time -lboost_regex -licuuc -Wl,-Bdynamic -lxxhash -llua5.3 -lsystemd

报错:

/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o:function _start: error: undefined reference to 'main'

此过程出错:

[18/149] LINK (stripped) build/release/test/boost/log_heap_test
FAILED: build/release/test/boost/log_heap_test

不知道为啥没有main函数,因为是test程序,应该不影响功能,在ninja.build中注释到这个编译。还有挺多这种的,同样处理。

修改后编译通过。

6.安装

sudo apt-get install patchelf

sudo apt-get install gawk

sudo ln -s /bin/gzip /usr/bin/gzip

sudo ln -s /sbin/ifconfig /usr/sbin/ifconfig

sudo apt-get install ethtool;sudo ln -s /sbin/ethtool /usr/sbin/ethtool

sudo ln -s /bin/netstat /usr/bin/netstat

sudo apt-get install hwloc

sudo apt-get install pigz

sudo mkdir /usr/lib/lib64;sudo ln -s /usr/lib/x86_64-linux-gnu/libthread_db.so /usr/lib/lib64/libthread_db.so

sudo ln -s /lib/x86_64-linux-gnu/libthread_db-1.0.so /lib64/libthread_db-1.0.so

#这个不知道是什么配置文件,touch了一个,可能有问题

sudo mkdir /etc/crypto-policies;sudo mkdir /etc/crypto-policies/back-ends;sudo touch /etc/crypto-policies/back-ends/gnutls.config

python3 -m compileall ./dist/common/scripts/ ./seastar/scripts/perftune.py ./tools/scyllatop

ninja -j 3 build/release/scylla-package.tar.gz

生产文件:./build/release/scylla-package.tar.gz

考到其他目录解压缩后,修改一下install.sh后运行:sudo ./install.sh

adjust_bin() {
    local bin="$1"
    # We could add --set-rpath too, but then debugedit (called by rpmbuild) barfs
    # on the result. So use LD_LIBRARY_PATH in the thunk, below.
    strip $root/$prefix/libexec/$bin
    patchelf \
        --set-interpreter "$prefix/libreloc/ld.so" \
        "$root/$prefix/libexec/$bin"
    cat > "$root/$prefix/bin/$bin" <<EOF
#!/bin/bash -e
export GNUTLS_SYSTEM_PRIORITY_FILE="\${GNUTLS_SYSTEM_PRIORITY_FILE-$prefix/libreloc/gnutls.config}"
export LD_LIBRARY_PATH="$prefix/libreloc"
exec -a "\$0" "$prefix/libexec/$bin" "\$@"
EOF
    chmod +x "$root/$prefix/bin/$bin"
}

可以运行了:

~/software/scylla-package$ scylla --version
4.1.0-0.20201128.b443b2574

scylladb源码安装过程相关推荐

  1. linux运行软件代码,Linux软件安装-详细源码安装过程

    1.简介 软件的安装是linux学习时的重中之重,*nux上重要思维哲 学组合若干小功能进而成为一个可用可维护的系统平台.那么在 操作系统构建完成之时,除非内核等支持系统必需软件之外,可 拓展可维护的 ...

  2. snort-2.9.7.0源码安装过程

    2015/02/15,centos6.5-64-minimal,初始205个包 [root@localhost snort]# yum install wget [root@localhost sno ...

  3. CentOS6.5+mysql5.1源码安装过程

    一:先安装依赖包(不然配置的时候会报错的!) yum -y install ncurses* libtermcap* gcc-c++* 新建mysql用户 [root@HE1Packages]# gr ...

  4. Ubuntu20.04软件主要管理工具包详细介绍:离线安装dpkg、在线安装apt、源码安装(适用于Github程序下载)

    Ubuntu20.04软件主要管理工具包详细介绍:离线安装dpkg.在线安装apt.源码安装(适用于Github程序下载) 一.离线安装dpkg命令 二.在线安装apt命令 三.软件包的源码安装过程 ...

  5. linux7squid编译安装,CentOS 7.3 源码安装squid 4.12 及安装过程遇到的一些问题

    CentOS 7.3 源码安装squid 4.12 及安装过程遇到的一些问题 一.源码安装squid 4.12 1.下载squid-4.12源码包 wget http://www.squid-cach ...

  6. ubuntu中手动编译源码安装Xorg-server过程中依赖关系的解决

    ubuntu中手动编译源码安装Xorg-server过程中依赖关系的解决 在linux系统中手动编译源码安装软件包的过程是非常痛苦的,然而这一个多星期以来我是强忍住脾气体验了一把,虽然面对慢的令人发指 ...

  7. Linux安装Mysql5.7详细过程(源码安装)

    Linux安装Mysql详细过程(源码安装) 第一步:下载 进入到mysql官网下载自己对应版本的mysql, 下载地址:https://dev.mysql.com/downloads/mysql/5 ...

  8. mininet安装过程(ubantu、git、mininet源码安装)以及POX安装

    小白一只,由于毕设题目跟SDN有关,就开始踢软件定义网络的大门,当然第一步就是熟悉网络工具,从mininet开始.对于从没接触过mininet.Linux的人来说,安装过程还是挺艰难的,我在安装过程中 ...

  9. ZABIX5.0.7源码安装详细过程

    ZABIX5.0.7源码安装详细过程 Zabbix5.0源码安装文档 一:Linux初始设置 关闭selinux vi /etc/selinux/config SELINUX=disabled 关闭网 ...

最新文章

  1. MachineLN博客目录
  2. 在GitHub上管理项目
  3. const与#define相比,区别和优点超详解总结
  4. DEDECMS自定义表单提交后的跳转链接如何修改
  5. 会计转行从事IT,如何在一年时间内全职学习?
  6. python类的参数加self_python类参数self使用示例
  7. 如何使用JMeter自身代理录制APP测试脚本
  8. win10怎么更改照片分辨率和大小?图片dpi修改方法
  9. 关于Behavior的使用方法
  10. 一个矩阵与单位矩阵相乘等于本身吗?并且符合交换律吗?
  11. matlab获取ipv4地址,【MATLAB】从 IP camera 撷取影像
  12. 图解LeetCode——854. 相似度为 K 的字符串(难度:困难)
  13. 微信公众账号分类入门知识
  14. linux查看某个端口的流量_linux中查看网卡流量六种方法
  15. Spirit - 腾讯移动 Web 整体解决方案
  16. kali网络渗透实验一:网络扫描与网络侦查
  17. mars3d基于vue3.0的widget使用
  18. 没有密码怎么解除pdf的加密
  19. Keil4的下载程序后窗口闪退,程序保存失败
  20. 数据库系统设计与原理

热门文章

  1. 使用k-means及k-prototype对混合型数据集进行聚类分析
  2. python单向认证_使用Python进行单向方差分析的四种方法
  3. 你还在找全国省市县大全吗
  4. 作业python 内部小卖铺
  5. 海量数据,3行Python代码直接获取!
  6. 锚文本链接用html怎么做,锚文本链接是什么?
  7. HoloLens2开发
  8. GCC编译器使用指北
  9. 在UniApp的H5项目中,生成二维码和扫描二维码的操作处理
  10. 量化金融投资及其python应用_量化投资:用Python实现金融数据的获取与整理