ScyllaDB 是用 C++ 重写的 Cassandra,每节点每秒处理 100 万 TPS。ScyllaDB 完全兼容 Apache Cassandra,拥有比 Cassandra 多 10x 倍的吞吐量,降低了延迟。
ScyllaDB 是性能优异的 NoSQL 列存储数据库。
ScyllaDB 在垃圾收集或者 Compaction 的时候不需要暂停;在常规生产负载的时候可以添加和删除节点。
看下我们的docker目录结构
请看我用dockerfile构建
FROM docker.io/centos:latest
MAINTAINER zailing
RUN yum clean all
RUN yum install -y yum-plugin-fastestmirror yum-utils epel-release
RUN yum update -y
# utils
RUN yum install -y git hostname sudo less iproute psmisc net-tools \
bash unzip which tar passwd ed m4 patch rsync wget curl tcpdump telnet \
tar bzip2 unzip strace supervisor openssl openssh openssh-server \
openssh-clients util-linux inotify-tools
# dev
RUN yum install -y gcc-c++ libtool make gdb mariadb-devel snappy-devel \
boost-devel lz4-devel zlib-devel libcurl-devel libevent-devel \
libesmtp-devel libuuid-devel libcsv-devel cyrus-sasl-devel \
bzip2-devel libpqxx-devel libxml2-devel libxslt-devel libxslt-python \
libpng-devel jemalloc-devel fontconfig-devel pcre-devel
# deps
RUN yum install -y redis sqlite mariadb mariadb-server postgresql
# python
RUN yum install -y python-pip python-devel python-lxml python-setuptools
RUN mkdir /var/run/sshd
RUN ssh-keygen -t rsa -q -f /etc/ssh/ssh_host_rsa_key -P ""
RUN ssh-keygen -t dsa -q -f /etc/ssh/ssh_host_dsa_key -P ""
RUN ssh-keygen -t rsa -q -f /root/.ssh/id_rsa -P ""
RUN cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys
RUN echo 'root:123123' | chpasswd
RUN sed -i 's/.*session.*required.*pam_loginuid.so.*/session optional pam_loginuid.so/g' /etc/pam.d/sshd
RUN echo -e "LANG=\"en_US.UTF-8\"" > /etc/default/local
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
RUN cp /usr/lib64/mysql/libmysqlclient* /usr/lib64/
RUN rm -rf etc/localtime && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "bind '\"\e[A\":history-search-backward'" >> /root/.bashrc
RUN echo "bind '\"\e[B\":history-search-forward'" >> /root/.bashrc
RUN echo "export HISTTIMEFORMAT='%F %T '" >> /root/.bashrc
EXPOSE 22
RUN chmod u+s /usr/bin/ping
#RUN wget -O /etc/yum.repos.d/scylla.repo http://downloads.scylladb.com/rpm/centos/scylla-1.2.repo
ADD ./scylla-1.2.repo /etc/yum.repos.d/
RUN yum -y remove boost-thread boost-system
RUN yum -y install scylla-server scylla-tools
ADD start-scylla.sh /start-scylla.sh
RUN chmod 755 /start-scylla.sh
EXPOSE 7000 7001 9042 9160 10000
VOLUME /var/lib/scylla
RUN yum clean all
ADD container-files /
RUN chmod +x /config/bootstrap.sh
RUN chmod +x -f /config/init/*.sh; exit 0
ENTRYPOINT ["/config/bootstrap.sh"]
docker-compose的书写格式如下 docker-compose.yml
version: '2'
services:
scylla:
build: .
image: zailing/scylla
container_name: scylla
hostname: scylla
privileged: true
read_only: false
tty: false
network_mode: "scylla"
ulimits:
nofile:
soft: 102400
hard: 102400
ports:
- "127.0.0.1:2245:22"
- "7000:7000"
- "17001:7001"
- "9042:9042"
- "9160:9160"
- "10000:10000"
environment:
- LISTEN_ADDRESS=192.168.0.2
- RPC_ADDRESS=192.168.0.2
volumes:
- /opt/docker/scylla:/var/lib/scylla
领取专属 10元无门槛券
私享最新 技术干货