consul 离线安装
1. 下载离线安装包
官网下载地址 https://www.consul.io/downloads
https://releases.hashicorp.com/consul/1.12.2/consul_1.12.2_linux_amd64.zip
mv consul /usr/local/bin/consulvim /usr/lib/systemd/system/consul.service[Unit]Description="HashiCorp Consul - A service mesh solution"Documentation=https://www.consul.io/Requires=network-online.targetAfter=network-online.target[Service]ExecStart=/usr/local/bin/consul agent -data-dir=/consul/data/ -config-dir=/etc/consul.d/ -server -bind 172.21.117.188(私有ip地址) -client=0.0.0.0 -bootstrap -bootstrap-expect=1 -uiExecReload=/bin/kill --signal HUP $MAINPIDKillMode=processKillSignal=SIGTERMRestart=on-failureLimitNOFILE=65536[Install]WantedBy=multi-user.targetsystemctl daemon-reloadsystemctl enable consulsystemctl start consul
redis 离线安装
tar zxvf redis-5.0.14.tar.gzcd redis-5.0.14makemake installvim /usr/lib/systemd/system/redis.service[Unit]Description=RedisAfter=network.target[Service]ExecStart=/usr/local/bin/redis-server redis.conf[配置文件路径] --daemonize noExecStop=/usr/local/bin/redis-cli -h 127.0.0.1 -p 6379 shutdown[Install]WantedBy=multi-user.targetsystemctl daemon-reloadsystemctl enable redissystemctl start redis
rabbitmq
# 拷贝离线包 到指定目录otp_src_25.0.1.tar.gzrabbitmq-server-generic-unix-3.10.5.tar.xz# 1.安装依赖包#解压 otp_src_25.0.1.tar.gztar zxvf otp_src_25.0.1.tar.gz#编译cd otp_src_25.0.1./configure --prefix=/usr/local/software/erlang/ # 目录自定义,提前创建好# 安装makemake install# 添加全局环境变量vim /etc/profileexport ERLANG_HOME=/usr/local/software/erlangexport PATH=$ERLANG_HOME/bin:$PATHsource /etc/profile# 验证erl -v# 2. 安装rabbitmq# 解压tar xf rabbitmq-server-generic-unix-3.10.5.tar.xz# 移动目录到 指定文件夹mv -f ./rabbitmq_server-3.10.5 /usr/local/software# 启动cd /usr/local/software/rabbitmq_server-3.10.5/sbin/# 启动后台管理插件./rabbitmq-plugins enable rabbitmq_management# 启动服务./rabbitmq-server -detached# 查看状态./rabbitmqctl status# 关闭服务./rabbitmqctl stop
Postgresql-11.6 离线安装
# 下载源码包wget https://ftp.postgresql.org/pub/source/v11.6/postgresql-11.6.tar.gz# 解压tar zxvf postgresql-11.6.tar.gz# 创建安装目录mkdir /usr/local/postgresql# 编译 、安装cd postgresql-11.6./configure --prefix=/usr/local/postgresqlmake && make install# 创建数据目录和 log目录mkdir /usr/local/postgresql/datamkdir /usr/local/postgresql/log# 添加全局环境变量vim /etc/profilePGHOME=/usr/local/postgresqlexport PGHOMEPGDATA=/usr/local/postgresql/dataexport PGDATAPATH=$PATH:$HOME/.local/bin:$HOME/bin:$PGHOME/binexport PATHsource /etc/profile# 增加用户 postgres 并赋权adduser postgreschown -R postgres:postgres /usr/local/postgresql/# 初始化数据库su postgres/usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data/# 编辑配置文件vim /usr/local/postgresql/data/postgresql.confvim /usr/local/postgresql/data/pg_hba.conf# 配置 systemctl 管理vim /usr/lib/systemd/system/postgresql11.service[Unit]Description=PostgreSQL database serverAfter=network.target[Service]Type=forkingUser=postgresGroup=postgresEnvironment=PGDATA=/usr/local/postgresql/data/ExecStart=/usr/local/postgresql/bin/pg_ctl start -D ${PGDATA} -s -w -t 300ExecStop=/usr/local/postgresql/bin/pg_ctl stop -D ${PGDATA} -s -m fastExecReload=/usr/local/postgres/bin/pg_ctl reload -D ${PGDATA} -sKillMode=mixedKillSignal=SIGINTTimeoutSec=300[Install]WantedBy=multi-user.target# 重启systemctl daemon-reloadsystemctl enable postgresql11.servicesystemctl start postgresql11.service# 查看状态systemctl status postgresql11.service● postgresql11.service - PostgreSQL database serverLoaded: loaded (/usr/lib/systemd/system/postgresql11.service; enabled; vendor preset: disabled)Active: active (running) since Mon 2022-06-13 15:36:15 CST; 23min ago# 连接验证[root@pgserver postgresql-11.6]# psqlpsql: FATAL: role "root" does not exist[root@pgserver postgresql-11.6]# psql -h localhost -p 5432 -U postgrespsql (11.6)Type "help" for help.postgres=#
