常用软件安装

python

  1. # 相关包
  2. sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel
  3. # 下载、解压
  4. wget https://tianyunperfect.oss-cn-hongkong.aliyuncs.com/file/python/Python-3.7.0.tgz
  5. tar -zxvf Python-3.7.0.tgz && cd Python-3.7.0
  6. # 编译
  7. ./configure prefix=/usr/local/python3.7
  8. sudo make && sudo make install
  9. # 导入环境变量
  10. cat >> /etc/profile << EOF
  11. # python3.7环境变量
  12. export PATH=/usr/local/python3.7/bin:\$PATH
  13. EOF
  14. . /etc/profile
  15. #测试是否安装成功了
  16. python3 -V
  17. #建立软连接,方便sodu
  18. sudo ln -s /usr/local/python3.7/bin/python3 /bin/python3
  19. sudo ln -s /usr/local/python3.7/bin/pip3 /bin/pip3
  20. # 升级pip
  21. sudo pip3 install --upgrade pip

redis

  1. wget http://download.redis.io/releases/redis-3.2.12.tar.gz
  2. mkdir -p /usr/local/redis
  3. tar zxvf redis-3.2.12.tar.gz -C /usr/local/redis
  4. cd /usr/local/redis/redis-3.2.12
  5. make
  6. # 这样安装,方便搭建集群
  7. make install PREFIX='/usr/local/redis/6379'
  8. # 将配置文件redis.conf中的deamonize yes 以守护进程的方式启动。
  9. cp /usr/local/redis/redis-3.2.12/redis.conf /usr/local/redis/6379/bin/
  10. # 新建数据存放位置
  11. mkdir /var/redis01/
  12. vim /usr/local/redis/6379/bin/redis.conf
  13. ----------------------------
  14. # 以服务形式启动
  15. daemonize yes
  16. #bind 127.0.0.1 注释掉这个,要不然其他服务器无法链接
  17. # 可以不用密码
  18. protected-mode no
  19. # 保存文件到指定目录
  20. dir /var/redis01/
  21. # 注释掉bind 127.0.0.1可以使所有的ip访问redis
  22. -------------------------------
  23. # 启动服务端
  24. /usr/local/redis/6379/bin/redis-server /usr/local/redis/6379/bin/redis.conf
  25. # 启动客户端
  26. /usr/local/redis/6379/bin/redis-cli
  27. # 关闭服务端,在客户端状态下:
  28. shutdown [save|nosave]
  29. # 开机启动
  30. cat >> /etc/rc.d/init.d/autostart << EOF
  31. # redis
  32. /usr/local/redis/6379/bin/redis-server /usr/local/redis/6379/bin/redis.conf
  33. EOF

zookeeper

  1. wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
  2. tar -zxvf zookeeper-3.4.6.tar.gz -C /usr/local/
  3. cd /usr/local/zookeeper-3.4.6
  4. mkdir data
  5. cd conf
  6. mv zoo_sample.cfg zoo.cfg
  7. vim zoo.cfg
  8. # 修改:
  9. dataDir=/usr/local/zookeeper-3.4.6/data
  10. # 开机执行
  11. cat >> /etc/rc.d/init.d/autostart << EOF
  12. # zookeeper
  13. /usr/local/zookeeper-3.4.6/bin/zkServer.sh start
  14. EOF
  15. # 服务启动
  16. /usr/local/zookeeper-3.4.6/bin/zkServer.sh start
  17. # 服务关闭
  18. /usr/local/zookeeper-3.4.6/bin/zkServer.sh stop
  19. # 服务状态
  20. /usr/local/zookeeper-3.4.6/bin/zkServer.sh status

gogs

  1. ### 创建用户
  2. adduser git
  3. passwd git # GI7tianyun
  4. su git
  5. su root
  6. ### 安装
  7. sudo yum install -y sqlite-devel
  8. wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_amd64.tar.gz
  9. tar -zxvf gogs_0.11.91_linux_amd64.tar.gz -C /usr/local
  10. rm -f gogs_0.11.91_linux_amd64.tar.gz
  11. nohup /usr/local/gogs/gogs web >> /data/logs/gogs.log 2>&1 &
  12. #### 访问http://www.tianyunperfect.tk:3000初始化
  13. 数据库:/data/gogs.db
  14. 仓库:/data/gogs-repositories
  15. 域名:http://www.tianyunperfect.tk
  16. 注册:tianyun GI7tianyun
  17. ### 启动(开机启动不了)
  18. su git
  19. su root
  20. nohup /usr/local/gogs/gogs web >> /data/logs/gogs.log 2>&1 &
  21. ### 迁移
  22. 把数据库、仓库、自定义配置文件(custom)复制过去

mongodb

  1. # 配置源文件
  2. sduo vim /etc/yum.repos.d/mongodb-org-3.4.repo
  3. [mongodb-org-3.4]
  4. name=MongoDB Repository
  5. baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/3.4/x86_64/
  6. gpgcheck=1
  7. enabled=1
  8. gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
  9. # 安装
  10. sudo yum install -y mongodb-org
  11. # 设置远程访问
  12. sudo sed -i 's/bindIp/#bindIp/' /etc/mongod.conf
  13. systemctl restart mongod.service
  14. # mongo shell
  15. mongo
  16. show dbs # 查看数据库
  17. # 配置内存
  18. vim /etc/mongod.conf
  19. wiredTiger:
  20. engineConfig:
  21. cacheSizeGB: 0.5

maven

  1. wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
  2. tar -zxvf apache-maven-3.6.0-bin.tar.gz -C /usr/local/
  3. mkdir /usr/local/repository
  4. vim /usr/local/apache-maven-3.6.0/conf/settings.xml
  5. # 配置仓库位置
  6. <localRepository>/usr/local/repository</localRepository>
  7. # 配置镜像
  8. <mirror>
  9. <id>alimaven</id>
  10. <mirrorOf>central</mirrorOf>
  11. <name>aliyun maven</name>
  12. <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
  13. </mirror>
  14. <mirror>
  15. <id>alimaven</id>
  16. <name>aliyun maven</name>
  17. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  18. <mirrorOf>central</mirrorOf>
  19. </mirror>
  20. # 环境变量
  21. sudo vim /etc/profile
  22. M2_HOME=
  23. PATH=$M2_HOME/bin:$PATH
  24. windows
  25. M2_HOME=C:\develop\apache-maven-3.3.9
  26. %M2_HOME%\bin

rabbitmq

  1. ### 安装erlang
  2. yum install -y socat
  3. cat >> /etc/yum.repos.d/rabbitmq-erlang.repo << EOF
  4. [rabbitmq-erlang]
  5. name=rabbitmq-erlang
  6. baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
  7. gpgcheck=1
  8. gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
  9. repo_gpgcheck=0
  10. enabled=1
  11. EOF
  12. yum -y install erlang
  13. ### 安装RabbitMQ
  14. sudo rpm -Uvh https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.3/rabbitmq-server-3.7.3-1.el7.noarch.rpm
  15. ### 安装管理插件和新建管理用户
  16. rabbitmq-plugins enable rabbitmq_management
  17. rabbitmqctl add_user admin 123456
  18. rabbitmqctl set_user_tags admin administrator
  19. rabbitmqctl set_permissions -p "/" admin "." "." ".*"
  20. ### 服务操作
  21. service rabbitmq-server restart # 重启服务
  22. systemctl enable rabbitmq-server # 开机启动
  23. systemctl disable rabbitmq-server # 不开机启动

YAPI

转移至:https://www.yuque.com/tianyunperfect/ygzsw4/bdsg4l