一、python3安装
1、安装依赖
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
2、获取包
wget [http://npm.taobao.org/mirrors/python/3.7.5/Python-3.7.5.tar.xz](http://npm.taobao.org/mirrors/python/3.7.5/Python-3.7.5.tar.xz)
3、解压
xz -d Python-3.7.5.tar.xz
tar -xf Python-3.7.5.tar
4、#进入解压后的目录,依次执行下面命令进行手动编译
cd Python-3.7.5
./configure prefix=/usr/local/python3
make && make install
5、添加软链接
#将原来的链接备份
mv /usr/bin/python /usr/bin/python.bak
#添加python3的软链接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python
6、#测试是否安装成功了
python -V
7、更改yum配置,因为其要用到python2才能执行,否则会导致yum不能正常使用
vi /usr/bin/yum
把#! /usr/bin/python修改为#! /usr/bin/python2
vi /usr/libexec/urlgrabber-ext-down
把#! /usr/bin/python 修改为#! /usr/bin/python2
二、Elasticsearch
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
yum clean all
yum makecache
wget https://artifacts.elastic.co/packages/7.x/yum/7.2.0/elasticsearch-7.2.0-x86_64.rpm
rpm -ivh elasticsearch-7.2.0-x86_64.rpm
java -version
rpm -qi elasticsearch
systemctl daemon-reload
systemctl start elasticsearch
systemctl enable elasticsearch
systemctl status elasticsearch
curl localhost:9200
修改数据目录
vim /etc/elasticsearch/elasticsearch.yml
path.data: /home/tank/es
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: ["node-1"]
vim /etc/sysctl.conf
vm.max_map_count = 655360
sysctl -p
cd /var/lib/elasticsearch/
mv nodes/ /home/tank/es/
systemctl restart elasticsearch
systemctl status elasticsearch
数据目录:/home/tank/es
日志目录:/var/log/elasticsearch
配置文件:/etc/elasticsearch/elasticsearch.yml
三、Nignx
yum -y install gcc gcc-c++ make libtool zlib zlib-devel openssl openssl-devel pcre pcre-devel
cd /home/tank
mkdir nginx
cd nginx/
wget -c https://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz
mv nginx-1.18.0/ nginx
cd /nginx
/configure --prefix=/usr/local/nginx
make
make install
启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
重载
/usr/local/nginx/sbin/nginx -s reload
配置文件位置
/usr/local/nginx/conf/nginx.conf
四、rocketmq安装
环境 jdk1.8
解压tar包
#java
tar -zxvf
修改环境变量
export JAVA_HOME=/home/tank/jdk1.8/jdk1.8.0_161
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib
mkdir rockmq
cd rockmq
wget https://archive.apache.org/dist/rocketmq/4.4.0/rocketmq-all-4.4.0-bin-release.zip
chmod -R 777 *
unzip rocketmq-all-4.4.0-bin-release.zip
cd rocketmq-all-4.4.0-bin-release
修改jvm内存
runserver.sh、runbroker.sh、tools.sh 需要修改其中内存
分别为
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m"
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m"
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=200m"
启动命令
cd /home/tank/rocketmq/rocketmq-all-4.4.0-bin-release
nohup sh bin/mqnamesrv &
nohup sh bin/mqbroker -n localhost:9876 &
五、mysql 安装
wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
cd /etc/yum.repos.d/
yum -y install mysql-server
若报错则
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql-server
systemctl start mysqld
mysql配置文件存放目录:/etc/my.cnf
mysql安装目录:/var/lib/mysql
grep 'temporary password' /var/log/mysqld.log
若无初始随机码则取消密码登录
vi /etc/my.cnf
[mysqld]
skip-grant-tables
mysql
flush privileges;
update user set password=password(‘123456’) where user=’root’;
flush privileges;
quit
mysql -uroot -p123456
六、redis
yum install -y gcc
wget http://download.redis.io/releases/redis-6.2.5.tar.gz
tar -zxvf redis-6.2.5.tar.gz
make
make install PREFIX=/usr/local/redis
cd /usr/local/redis/bin/
cp /usr/local/redis-6.2.5/redis.conf /usr/local/redis/bin/
修改 redis.conf 文件,把 daemonize no 改为 daemonize yes
./redis-server redis.conf
开机自启
vi /etc/systemd/system/redis.service
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start redis.service
systemctl enable redis.service
ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis
开放外部访问
vi /etc/redis.conf
bind 0.0.0.0
防火墙开放6379端口
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --reload
redis
auth "123456"
查看密码
config get requirepass
目录:
/usr/local/redis/bin/
服务与配置文件目录相同