初始化Liunx
安装jdk8
- 地址:
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
-
产品选择
-
上传下载文件至服务器
-
解压
tar -zxvf jdk-8u281-linux-x64.tar.gz
-
设置环境变量,最后一行添加
vim /etc/profile
export JAVA_HOME=/usr/local/apps/jdk1.8.0_281 export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar export PATH=$PATH:${JAVA_HOME}/bin
-
重新加载配置
source /etc/profile
-
java -version验证
mysql安装
-
地址:
https://dev.mysql.com/downloads/mysql/ -
产品选择
-
点击 No thanks, just start my download. 进行下载
https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.23-1.el7.x86_64.rpm-bundle.tar
-
校验安装包
md5sum mysql-8.0.23-1.el7.x86_64.rpm-bundle.tar
-
通过 rpm -qa | grep mariadb 命令查看 mariadb 的安装包
-
删除 mariadb
rpm -e mariadb-libs-5.5.65-1.el7.x86_64 --nodepS
-
执行安装命令
rpm -ivh mysql-community-common-8.0.23-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-libs-8.0.23-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-client-8.0.23-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-server-8.0.23-1.el7.x86_64.rpm --nodeps --force
- 校验安装
rpm -qa | grep mysql
-
通过以下命令,完成对 mysql 数据库的初始化和相关配置
mysqld --initialize; chown mysql:mysql /var/lib/mysql -R; systemctl start mysqld.service; systemctl enable mysqld;
执行mysqld --initialize;可能会出现异常
mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
执行命令,可以解决异常
yum -y install numactl
-
查看初始密码
cat /var/log/mysqld.log | grep password
-
进入mysql,修改密码
ALTER user 'root'@'localhost' IDENTIFIED BY '你的密码';
-
修改远程访问
create user 'root'@'%' identified with mysql_native_password by '你的密码'; grant all privileges on *.* to 'root'@'%' with grant option; flush privileges;
redis
-
下载
https://download.redis.io/releases/redis-6.0.10.tar.gz
-
解压安装
tar -zxvf redis-6.0.10.tar.gz tar xzf redis-6.0.10.tar.gz cd redis-6.0.10 make
安装报错,由于gcc版本过低
# 查看版本 gcc -v yum -y install centos-release-scl yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils scl enable devtoolset-9 bash #修改环境变量 echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile gcc -v
-
相关配置 vim redis.conf
# 密码 requirepass 你的密码 # 远程访问 # 注释 #bind 127.0.0.1 # 修改 protected-mode no # 静默启动 daemonize yes
-
启动
./redis-server ../redis.conf
zookeeper
-
下载地址
http://archive.apache.org/dist/zookeeper/
http://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
-
安装 tar -zxf zookeeper-3.4.5.tar.gz -C /usr/myapp
-
配置
cd /usr/myapp/zookeeper-3.4.5 mkdir data mkdir logs # 在conf目录下新建zoo.cfg文件,写入以下内容保存: tickTime=2000 dataDir=/usr/myapp/zookeeper-3.4.5/data dataLogDir=/usr/myapp/zookeeper-3.4.5/logs clientPort=2181
python
-
安装python依赖
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
-
下载安装包
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
-
解压进入文件夹
-
指定安装路径
./configure -prefix=/usr/local/apps/python-3.7.9 --enable-optimizations --with-ssl
-
编译安装
sudo make && make install
-
建立链接
ln -s /usr/local/apps/python-3.7.9/bin/python3 /usr/bin/python3 #为python3创建软连接 ln -s /usr/local/apps/python-3.7.9/bin/pip3 /usr/bin/pip3 #为pip3创建软连接
-
验证
python3 # 输入 pip3 -V #V大写
安装maven
-
下载
https://mirrors.bfsu.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
-
设置环境变量, vim /etc/profile
export MAVEN_HOME=/usr/local/apps/apache-maven-3.6.3 export PATH=$MAVEN_HOME/bin:$PATH
-
刷新
source /etc/profile
.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
2. 设置环境变量, vim /etc/profile
```shell
export MAVEN_HOME=/usr/local/apps/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$PATH
```
3. 刷新
```shell
source /etc/profile