环境搭建-mysql,nacos,fastdfs,nginx,docker
1.中间件环境安装
1.1 MYSQL-5.7.27
下载地址
https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz
图文教程
https://www.jb51.net/article/217014.htm
安装步骤
groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
yum install -y libaio*
tar xzvf mysql-5.7.27-aarch64.tar.gz -C /usr/local/
mkdir -p /usr/local/mysql/logs
chown -R mysql:mysql /usr/local/mysql
ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
cp -rf /usr/local/mysql/extra/lib* /usr/lib64/
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.old
ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6
cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
systemctl enable mysqld
vi /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
source /etc/profile
mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
systemctl start mysqld
systemctl status mysqld
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '!QAZ2wsx' WITH GRANT OPTION;
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '!QAZ2wsx' WITH GRANT OPTION;
flush privileges;
/etc/init.d/mysqld restart
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
启动,重启,停止
systemctl start mysqld
systemctl stop mysqld
systemctl status mysqld
systemctl restart mysqld
账号密码
root
!QAZ2wsx
1.2 REDIS
安装redis
1.获取redis资源
wget http://download.redis.io/releases/redis-4.0.8.tar.gz
2.解压
tar xzvf redis-4.0.8.tar.gz
3.安装
cd redis-4.0.8
make
cd src
make install PREFIX=/usr/local/redis
4.移动配置文件到安装目录下
cd ../
mkdir /usr/local/redis/etc
mv redis.conf /usr/local/redis/etc
5.配置redis为后台启动
vi /usr/local/redis/etc/redis.conf //将daemonize no 改成daemonize yes
6.将redis加入到开机启动
vi /etc/rc.local //在里面添加内容:/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf (意思就是开机调用这段开启redis的命令)
7.开启redis
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
常用命令
redis-server /usr/local/redis/etc/redis.conf //启动redis
pkill redis //停止redis
卸载redis:
rm -rf /usr/local/redis //删除安装目录
rm -rf /usr/bin/redis-* //删除所有redis相关命令脚本
rm -rf /usr/local/src/redis-4.0.8 //删除redis解压文件夹
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
启动,停止
开机自启动
vi /etc/rc.local //在里面添加内容:/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf (意思就是开机调用这段开启redis的命令)
chmod +x /etc/rc.d/rc.local
1.3 DOCKER
安装教程
https://docs.docker.com/engine/install/binaries/
下载地址
https://download.docker.com/linux/static/stable/aarch64/docker-20.10.9.tgz
安装步骤
使用该实用程序提取存档。和 二进制文件被提取dockerd。docker
tar xzvf /path/to/<FILE>.tar.gz
将二进制文件移动到可执行路径上的目录
cp docker/* /usr/bin/
启动 Docker 守护进程:
dockerd &
vi /etc/rc.local
dockerd &
1.4 FASTDFS
安装教程
https://zhuanlan.zhihu.com/p/80256918
http://172.17.1.103:81/zyplayer-doc-manage/doc-wiki#/page/show?pageId=140
下载地址
git clone https://github.com/happyfish100/libfastcommon.git
git clone https://github.com/happyfish100/fastdfs.git
git clone https://github.com/happyfish100/fastdfs-nginx-module.git
启动
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
fdfs_test /etc/fdfs/client.conf upload /home/litong/test.txt
1.5 NACOS
https://www.cnblogs.com/it66/p/12949658.html
启动
sh /usr/local/nacos/bin/startup.sh -m standalone
1.6 NGINX
yum -y install gcc-c++ zlib-devel pcre-devel
wget http://nginx.org/download/nginx-1.14.0.tar.gz
tar zxvf nginx-1.14.0.tar.gz
git clone https://github.com/happyfish100/fastdfs-nginx-module
./configure --prefix=/home/software/nginx --add-module=/home/software/fastdfs-nginx-module-master/src
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
./configure --prefix=/usr/local/nginx --add-module=/home/litong/git/fastdfs-nginx-module/src
make && make install

浙公网安备 33010602011771号