软件安装及配置

软件安装及配置

  • 软件安装及配置
    • JDK
    • MySQL
    • Redis
    • MongoDB
    • Docker
    • Nginx
    • RabbitMQ
    • Zookeeper
    • FastDFS

软件安装及配置

软件安装
软件配置
软件主目录

经常找不到服务的主目录(笑哭)

JDK

下载tar包并解压
配置环境变量vi /etc/profile

export JAVA_HOME=/usr/local/java/jdk1.8.0_162
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

source /etc/profile
java -version

MySQL

下载mysql的repository:wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
安装repository:yum -y install mysql57-community-release-el7-10.noarch.rpm
安装Mysql服务器:yum -y install mysql-community-server
执行上一步失败时:rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

启动Mysql:systemctl start mysqld.service
查看状态:systemctl status mysqld.service
找出密码:grep "password" /var/log/mysqld.log
登录Mysql:mysql -uroot -p xxxxxx
更改密码:ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxxx';
设置密码不受限:set global validate_password_policy=0;
开启远程访问:grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges;
/etc/my.cnf 增加字段编码

[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci

重启服务:systemctl restart mysqld.service
开机启动:systemctl enable mysqld

/var/lib/mysql

Redis

下载tar包并解压
进入解压包make make install

安装后目录/usr/lcoal/bin

MongoDB

官网下载安装包:curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.12.tgz
解压:tar -zxvf mongodb-linux-x86_64-3.2.12.tgz
移动目录:mv mongodb-linux-x86_64-3.2.12 /usr/local/mongodb
修改配置文件:sudo vi /etc/profile

export MONGODB_HOME=/usr/local/mongodb 
export PATH=$PATH:$MONGODB_HOME/bin

重启配置:source /etc/profile

cd /usr/local/mongodb
mkdir -p data/db
chmod -R 777 data/db
mkdir logs
cd logs
touch mongodb.log

增加配置文件:cd /usr/local/mongodb/bin sudo vi mongodb.conf

dbpath = /usr/local/mongodb/data/db #数据文件存放目录 
logpath = /usr/local/mongodb/logs/mongodb.log #日志文件存放目录 
port = 27017 #端口 
fork = true #以守护程序的方式启用,即在后台运行 
nohttpinterface = true 

以配置文件启动:

cd /usr/local/mongodb/bin
./mongod -f mongodb.conf

连接:./mongo


安装后目录:/usr/local/mongodb

Docker

/var/lib/docker

Nginx

下载tar包:wget http://nginx.org/download/nginx-1.20.1.tar.gz
解压
进入主目录后:./configure
编译:make && make install
安装后目录:/usr/local/nginx/sbin

RabbitMQ

/usr/lib/rabbitmq

Zookeeper

下载:wget https://downloads.apache.org/zookeeper/zookeeper-3.6.2/apache-zookeeper-3.6.2-bin.tar.gz
解压
移动:mv apache-zookeeper-3.6.3-bin /usr/local/zookeeper-3.6.3
新建data和logs:mkdir data | mkdir logs
复制配置:cd conf | cp zoo_sample.cfg zoo.cfg
修改配置:vi zoo.cfg

#数据文件夹
dataDir=/usr/local/zookeeper-3.6.3/data
#日志文件夹
dataLogDir=/usr/local/zookeeper-3.6.3/log

修改系统配置:vim /etc/profile

export ZOOKEEPER_HOME=/usr/local/zookeeper-3.6.3/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH

启动服务端:zookeeper-3.6.3/bin/zkServer.sh start
启动客户端:./zkCli.sh

安装后目录:/usr/local/zookeeper-3.6.3

FastDFS

你可能感兴趣的:(记录,redis)