常用软件安装
python
# 相关包
sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel
# 下载、解压
wget https://tianyunperfect.oss-cn-hongkong.aliyuncs.com/file/python/Python-3.7.0.tgz
tar -zxvf Python-3.7.0.tgz && cd Python-3.7.0
# 编译
./configure prefix=/usr/local/python3.7
sudo make && sudo make install
# 导入环境变量
cat >> /etc/profile << EOF
# python3.7环境变量
export PATH=/usr/local/python3.7/bin:\$PATH
EOF
. /etc/profile
#测试是否安装成功了
python3 -V
#建立软连接,方便sodu
sudo ln -s /usr/local/python3.7/bin/python3 /bin/python3
sudo ln -s /usr/local/python3.7/bin/pip3 /bin/pip3
# 升级pip
sudo pip3 install --upgrade pip
redis
wget http://download.redis.io/releases/redis-3.2.12.tar.gz
mkdir -p /usr/local/redis
tar zxvf redis-3.2.12.tar.gz -C /usr/local/redis
cd /usr/local/redis/redis-3.2.12
make
# 这样安装,方便搭建集群
make install PREFIX='/usr/local/redis/6379'
# 将配置文件redis.conf中的deamonize yes 以守护进程的方式启动。
cp /usr/local/redis/redis-3.2.12/redis.conf /usr/local/redis/6379/bin/
# 新建数据存放位置
mkdir /var/redis01/
vim /usr/local/redis/6379/bin/redis.conf
----------------------------
# 以服务形式启动
daemonize yes
#bind 127.0.0.1 注释掉这个,要不然其他服务器无法链接
# 可以不用密码
protected-mode no
# 保存文件到指定目录
dir /var/redis01/
# 注释掉bind 127.0.0.1可以使所有的ip访问redis
-------------------------------
# 启动服务端
/usr/local/redis/6379/bin/redis-server /usr/local/redis/6379/bin/redis.conf
# 启动客户端
/usr/local/redis/6379/bin/redis-cli
# 关闭服务端,在客户端状态下:
shutdown [save|nosave]
# 开机启动
cat >> /etc/rc.d/init.d/autostart << EOF
# redis
/usr/local/redis/6379/bin/redis-server /usr/local/redis/6379/bin/redis.conf
EOF
zookeeper
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
tar -zxvf zookeeper-3.4.6.tar.gz -C /usr/local/
cd /usr/local/zookeeper-3.4.6
mkdir data
cd conf
mv zoo_sample.cfg zoo.cfg
vim zoo.cfg
# 修改:
dataDir=/usr/local/zookeeper-3.4.6/data
# 开机执行
cat >> /etc/rc.d/init.d/autostart << EOF
# zookeeper
/usr/local/zookeeper-3.4.6/bin/zkServer.sh start
EOF
# 服务启动
/usr/local/zookeeper-3.4.6/bin/zkServer.sh start
# 服务关闭
/usr/local/zookeeper-3.4.6/bin/zkServer.sh stop
# 服务状态
/usr/local/zookeeper-3.4.6/bin/zkServer.sh status
gogs
### 创建用户
adduser git
passwd git # GI7tianyun
su git
su root
### 安装
sudo yum install -y sqlite-devel
wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_amd64.tar.gz
tar -zxvf gogs_0.11.91_linux_amd64.tar.gz -C /usr/local
rm -f gogs_0.11.91_linux_amd64.tar.gz
nohup /usr/local/gogs/gogs web >> /data/logs/gogs.log 2>&1 &
#### 访问http://www.tianyunperfect.tk:3000初始化
数据库:/data/gogs.db
仓库:/data/gogs-repositories
域名:http://www.tianyunperfect.tk
注册:tianyun GI7tianyun
### 启动(开机启动不了)
su git
su root
nohup /usr/local/gogs/gogs web >> /data/logs/gogs.log 2>&1 &
### 迁移
把数据库、仓库、自定义配置文件(custom)复制过去
mongodb
# 配置源文件
sduo vim /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
# 安装
sudo yum install -y mongodb-org
# 设置远程访问
sudo sed -i 's/bindIp/#bindIp/' /etc/mongod.conf
systemctl restart mongod.service
# mongo shell
mongo
show dbs # 查看数据库
# 配置内存
vim /etc/mongod.conf
wiredTiger:
engineConfig:
cacheSizeGB: 0.5
maven
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
tar -zxvf apache-maven-3.6.0-bin.tar.gz -C /usr/local/
mkdir /usr/local/repository
vim /usr/local/apache-maven-3.6.0/conf/settings.xml
# 配置仓库位置
<localRepository>/usr/local/repository</localRepository>
# 配置镜像
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
# 环境变量
sudo vim /etc/profile
M2_HOME=
PATH=$M2_HOME/bin:$PATH
windows:
M2_HOME=C:\develop\apache-maven-3.3.9
%M2_HOME%\bin
rabbitmq
### 安装erlang
yum install -y socat
cat >> /etc/yum.repos.d/rabbitmq-erlang.repo << EOF
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
EOF
yum -y install erlang
### 安装RabbitMQ
sudo rpm -Uvh https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.3/rabbitmq-server-3.7.3-1.el7.noarch.rpm
### 安装管理插件和新建管理用户
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user admin 123456
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p "/" admin "." "." ".*"
### 服务操作
service rabbitmq-server restart # 重启服务
systemctl enable rabbitmq-server # 开机启动
systemctl disable rabbitmq-server # 不开机启动
YAPI
转移至:https://www.yuque.com/tianyunperfect/ygzsw4/bdsg4l