0.yum install net-tools 安装网络管理工具
1.安装jdk11
yum search java-11
选择jdk环境安装 yum install
2.安装python
yum install python
根据提示选择python36进行安装 yum install python36
3.安装mysql
yum search mysql-server
yum install 查找到的mysql-server
service mysqld start
service mysqld status
mysql -uroot -p
空密码进修改密码ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
为了远程登陆可以新建root远程登录账户并设置权限
create user 'root'@'%' identified by '123456';
grant all privileges on *.* to 'root'@'%' ;
flush privileges;
特别注意:需要关闭防火墙 firewall-cmd --state
firewall-cmd --permanent --zone=public --add-port=3306/tcp 永久添加该端口去掉permanent则为临时
firewall-cmd --reload 加载配置使修改生效
firewall-cmd --permanent --zone=public --list-ports 查看开启端口是否为3306
systemctl enable mysqld.service 设置开机启动
4.安装mongodb
vim /etc/yum.repos.d/mongodb-org-4.2.repo
[mongodb-org-4.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
然后 yum install -y mongodb-org安装
修改配置文件 vim /etc/mongod.conf
net:
port:27017
bindIp:0.0.0.0
同样需要打开防火墙端口
firewall-cmd --permanent --zone=public --add-port=27017/tcp 永久添加该端口去掉permanent则为临时
firewall-cmd --reload 加载配置使修改生效
firewall-cmd --permanent --zone=public --list-ports
设置开机启动 systemctl enable mongod.service
卸载sudo yum erase $(rpm -qa | grep mongodb-org)
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongo
5.安装redis
yum install redis
vim /etc/redis.conf
注释掉 bind 127.0.0.1
修改 protected-mode yes为protected-mode no
firewall-cmd --permanent --zone=public --add-port=6379/tcp
firewall-cmd --reload
systemctl enable redis
6.安装rabbitmq
添加epel源
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
安装erlang
dnf -y install wget
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v21.3.8.6/erlang-21.3.8.6-1.el7.x86_64.rpm
dnf install -y erlang-21.3.8.6-1.el7.x86_64.rpm
添加rabbitmq仓库
vim /etc/yum.repos.d/rabbitmq-server.repo
[rabbitmq-server]
name=rabbitmq-server
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
安装rabbitmq
dnf makecache -y --disablerepo='*' --enablerepo='rabbitmq-server'
dnf install -y rabbitmq-server
开放防火墙
firewall-cmd --zone=public --permanent --add-port={4369,25672,5671,5672,15672,61613,61614,1883,8883}/tcp
firewall-cmd --reload
启动并添加启动项systemctl start rabbitmq-server.service
systemctl enable rabbitmq-server.service
systemctl status rabbitmq-server.service
rabbitmqctl status
rabbitmq-plugins enable rabbitmq_management
设置管理账号和密码
rabbitmqctl add_user admin mypassword
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
用浏览器访问http://机器IP:15672打开管理界面,使用上一步配置好的admin账号登录。
7.安装elasticsearch
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
配置源
vim /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
安装
dnf install elasticsearch
开放防火墙
firewall-cmd --zone=public --permanent --add-port={9100,9200,9300}/tcp
firewall-cmd --reload
配置文件
vim /etc/elasticsearch/elasticsearch.yml
cluster.name: centos8-elasticsearch
network.host: 0.0.0.0
cluster.initial_master_nodes: ["node-1"]
在最后加上
action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
配置启动项并启动
systemctl enable elasticsearch.service --now
测试
curl -X GET "localhost:9200/"
安装head插件
安装node.js
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash
yum install -y nodejs
node -v
npm -v
安装nrm
npm install -g nrm
nrm use taobao
copy head插件到elasticsearch目录(可以为其他目录)
cd /usr/share/elasticsearch/elasticsearch-head-master
安装依赖
npm install
运行
npm run start
访问 http://localhost:9100