paascloud-master
:https://github.com/paascloud/paascloud-masterpaascloud-master
官方环境搭建:http://blog.paascloud.net/2018/06/13/java-env/paascloud/kai-fa-huan-jing/yum install lrzsz
yum install -y unzip zip
yum -y install vim*
tar.gz
包安装,参考:https://www.cnblogs.com/chy123/p/6750351.htmlrpm
包安装,参考:https://www.cnblogs.com/zenghua/p/7154311.html下载地址:https://dev.mysql.com/downloads/file/?id=470281
上面下载后,
yum localinstall mysql57-community-release-el7-11.noarch.rpm
vim /etc/yum.repos.d/mysql-community.repo # 确定使用的版本,enable设为1
yum install -y mysql-community-server
systemctl status mysqld.service
systemctl start mysqld.service
cat /etc/my.cnf
# log-error=/var/log/mysqld.log
# pid-file=/var/run/mysqld/mysqld.pid
cat /var/log/mysqld.log | grep password
mysql -u root -p
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=6;
mysql> alter user 'root'@'localhost' identified by '123456';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
mysql> flush privileges;
crontab
命令:https://www.cnblogs.com/kenshinobiy/p/7685229.html非常慢
,不推荐。
依次执行下面命令
yum remove docker docker-common docker-selinux docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum-config-manager --enable docker-ce-edge
yum-config-manager --enable docker-ce-test
yum-config-manager --disable docker-ce-edge
yum makecache fast
yum -y install docker-ce
systemctl start docker
docker run hello-world
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 1815c82652c0 2 months ago 1.84kB
从官方安装包下载:docker-ce-17.06.0.ce-1.el7.centos.x86_64.rpm
。
yum install /usr/local/src/tool/docker-ce-17.06.0.ce-1.el7.centos.x86_64.rpm -y
systemctl start docker
docker -v
# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
yum list installed|grep docker
yum –y remove docker.x86_64.XXX
rm -rf /var/lib/docker
wget http://download.redis.io/releases/redis-4.0.2.tar.gz
tar xzf redis-4.0.2.tar.gz
cd redis-4.0.2
make
src
目录下,通过下面的命令启动 Redis
服务:src/redis-server
redis-cli
进行使用:# src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
# 第一种:杀死进程PID,kill -9 PID
ps aux|grep redis
# 第二种
src/redis-cli shutdown
yum install epel-release
yum install redis
systemctl start redis.service
redis-server /etc/redis.conf
systemctl enable redis
vi /usr/local/redis-4.0.2/redis.conf
requirepass paasword #配置密码
# bind 127.0.0.1 #允许远程访问
daemonize yes #后台启动
src/redis-server ../redis.conf
src/redis-cli -a paasword
参考博客:http://blog.paascloud.net/2018/05/19/db/redis/centos7.3-install-redis4.0.8-3master-3slave/
docker run -d -p 6379:6379 redis:4.0.8 --requirepass "123456"
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum -y install nginx
systemctl start nginx
nginx -v
nginx version: nginx/1.14.1
/etc/nginx/nginx.conf
主要是搭建集群环境
参考博客:http://blog.paascloud.net/2018/02/21/java-env/rocketmq/rocketmq-synchro-double-write/
参考博客:https://blog.csdn.net/weixin_40533111/article/details/84451219
注意:如果 broker
启动失败,可能是 runbroker.sh
、runserver.sh
里的内存大小设置默认过大。
rocketmq
提供多种管理方式,命令行和界面等,
apache
提供一个开源的扩展项目: https://github.com/apache/rocketmq-externals 里面包含一个子项目 rocketmq-console
,配置下,打个包就可以用了。
或者可以百度搜索一下
rocketmq-console.war
。
具体安装参考博客:https://www.jianshu.com/p/e5b7a0b4803b
项目官方博客:http://blog.paascloud.net/2018/02/21/java-env/rabbitmq/centos7-install-rabbitmq3.7.3/
他人博客【我使用的】:https://www.cnblogs.com/xrog/p/8519967.html
/etc/init.d/rabbitmq-server start
# 或
service rabbitmq-service start
# 启动
rabbitmq-server -detached
# 关闭
rabbitmqctl stop
# 查看状态
rabbitmqctl status
用户名/密码:
guest/guest
rabbitmq-plugins enable rabbitmq_management
http://192.168.241.101:15672/
根据上面
参考博客1
搭建的伪集群,因为配置文件在一个机器上的zookeeper
目录下,所以启动时对应不同的配置文件。
zookeeper
的 conf
目录下cd /root/software/zookeeper-3.4.9/conf
# 添加了环境变量
zkServer.sh start zoo1.cfg
zkServer.sh start zoo2.cfg
zkServer.sh start zoo3.cfg
zkServer.sh status zoo1.cfg
zkServer.sh status zoo2.cfg
zkServer.sh status zoo3.cfg
zookeeper
图形化的客户端工具–ZooInspector
,具体使用参考博客:https://blog.csdn.net/qq_26857649/article/details/82420509。
启动
zookeeper
集群后,运行ZooInspector
jar 包,当paascloud
项目启动后,出现下面效果
根据上面 rocketmq集群 目录下的第一个参考博客来启动。
2m-2s-sync
。
NameServer A 192.168.241.101
nohup sh /usr/local/rocketmq/bin/mqnamesrv &
NameServer A 192.168.241.102
nohup sh /usr/local/rocketmq/bin/mqnamesrv &
BrokerServer A-master 192.168.241.101
nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-a.properties&
BrokerServer A-slave 192.168.241.101
nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-a-s.properties&
BrokerServer B-master 192.168.241.102
nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-b.properties&
启动BrokerServer B-slave 192.168.241.102
nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-b-s.properties&
netstat -ntlp
jps
tail -f -n 500 /usr/local/rocketmq/logs/rocketmqlogs/broker.log
tail -f -n 500 /usr/local/rocketmq/logs/rocketmqlogs/namesrv.log
sh /usr/local/rocketmq/bin/mqshutdown namesrv
sh /usr/local/rocketmq/bin/mqshutdown broker
rm -rf /usr/local/rocketmq/data/master
rm -rf /usr/local/rocketmq/data/slave
mkdir -p /usr/local/rocketmq/data/master/store/commitlog
mkdir -p /usr/local/rocketmq/data/slave/store/commitlog
mkdir -p /usr/local/rocketmq/data/master/store/consumequeue
mkdir -p /usr/local/rocketmq/data/slave/store/consumequeue
mkdir -p /usr/local/rocketmq/data/master/store/index
mkdir -p /usr/local/rocketmq/data/slave/store/index
rocketmq
集群控制台启动解压在tomcat目录,
./tomcat/bin/startup.sh
启动即可。
访问地址:http://192.168.0.110:8080/rocketmq-console/cluster/list.do