# ela-up **Repository Path**: my_chtholly/ela-up ## Basic Information - **Project Name**: ela-up - **Description**: No description available - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-04-22 - **Last Updated**: 2021-04-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 安装指南 Ubuntu18.04 centos7.9 设置允许以root身份远程ssh登录:```vim /etc/ssh/sshd-config``` ### 0. 使用方法 **step1:** 确保安装了git,给集群内所有服务器配置好go语言环境、rocksDB编译环境 (以Centos系统为例) 1. Go语言安装配置 ``````shell # 下载源码 wget https://storage.googleapis.com/golang/go1.16.3.linux-amd64.tar.gz # 解压缩 tar -xf go1.16.3.linux-amd64.tar.gz # 配置环境变量 vim ~/.bashrc export GOROOT="golang解压缩位置" export GOPATH="选择GOPATH目录" export PATH=$GOPATH/BIN:$GOROOT/bin:$PATH export GOPROXY=https://goproxy.io,direct source ~/.bashrc vim /etc/profile export GOROOT="golang解压缩位置" export GOPATH="选择GOPATH目录" export PATH=$GOPATH/BIN:$GOROOT/bin:$PATH export GOPROXY=https://goproxy.io,direct source /etc/profile `````` 2. 源码编译环境 ``````shell yum -y update yum -y install gcc yum -y install glibc-static.x86_64 yum -y install gflags-devel yum -y install snappy-devel yum -y install zlib-devel yum -y install bzip2-devel yum -y install libstdc++-devel yum -y install lz4-devel yum -y install libzstd-devel # 安装jemalloc # wget https://github.com/jemalloc/jemalloc/releases/download/5.0.1/jemalloc-5.0.1.tar.bz2 # wget https://gitee.com/wanttobeamaster/jemalloc/repository/archive/5.0.1?format=tar.gz -O jemalloc-5.0.1.tar.gz yum -y install bzip2 tar -jxvf jemalloc-5.0.1.tar.bz2 cd jemalloc-5.0.1 yum -y install autogen autoconf ./autogen.sh make -j2 make install ldconfig cd ../ rm -rf jemalloc-5.0.1 jemalloc-5.0.1.tar.bz2 rm -rf ~/.cache/go-build `````` **step2 :** 在中控机上,下载ela-up源码 :```go get gitee.com/wanttobeamaster/ela-up``` 或 ```git clone https://gitee.com/wanttobeamaster/``` **step3 :** 编辑 ```/home/hosts``` 文件,写入集群内主机的 ```ip ssh-passed```,可执行脚本会按行读取内容 **step4 : ** 在中控机器上下载expect工具```yum install expect``` **step5 :** 在ela-up目录下运行```./node-man.sh```根据提示输入[yes / no];完成后,所有机器会自动下载并编译源码 **step6:** 启动集群 ### 1. download.sh ```download.sh``` 用于本地环境下连接网络(校园网情况下)、下载源代码、编译源代码 ### 2. exp.sh ```exp.sh``` 通过expect工具,实现远程ssh登录,达到在远程环境下执行目标指令的目的,此处借助expect工具,实现远程执行```download.sh```脚本的作用 ### 3. node-man.sh ```node-man.sh``` 节点管理脚本,集成了exp.sh。node-man.sh会以行为单位,读取```/home/hosts```文件,hosts文件内容为目标主机的ip和ssh密码。默认的登入角色为root。 hosts格式如下: ``````shell 121.248.55.193 passwd 121.248.49.238 passwd 121.248.2.124 passwd ``````