练习环境、学习环境的 环境变量与相关的配置
文章很长,而且持续更新,建议收藏起来,慢慢读!疯狂创客圈总目录 博客园版 为您奉上珍贵的学习资源 :
免费赠送 :《尼恩Java面试宝典》 持续更新+ 史上最全 + 面试必备 2000页+ 面试必备 + 大厂必备 +涨薪必备
免费赠送 经典图书:《Java高并发核心编程(卷1)加强版》 面试必备 + 大厂必备 +涨薪必备 加尼恩免费领
免费赠送 经典图书:《Java高并发核心编程(卷2)加强版》 面试必备 + 大厂必备 +涨薪必备 加尼恩免费领
免费赠送 经典图书:《Java高并发核心编程(卷3)加强版》 面试必备 + 大厂必备 +涨薪必备 加尼恩免费领
免费赠送 经典图书:《尼恩Java面试宝典 最新版》 面试必备 + 大厂必备 +涨薪必备 加尼恩免费领
免费赠送 资源宝库: Java 必备 百度网盘资源大合集 价值>10000元 加尼恩领取
练习环境、学习环境的 环境变量与相关的配置
开发环,组件多,安装繁琐,怎么一键解决呢?
百度搜:疯狂创客圈 总目录
vagrant+java+微服务+redis+zookeeper 镜像的下载使用
镜像导入步骤
请参见:
https://www.cnblogs.com/crazymakercircle/p/14194688.html
相关的环境变量
[root@cdh1 ~]# cat /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_121
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
export VIRTUAL_IP=cdh1
export SCAFFOLD_DB_HOST=cdh1
export SCAFFOLD_DB_USER=root
export SCAFFOLD_DB_PSW=123456
export SCAFFOLD_REDIS_HOST=$VIRTUAL_IP
export SCAFFOLD_REDIS_PSW=123456
export SCAFFOLD_EUREKA_ZONE_HOSTS=http://$VIRTUAL_IP:7777/eureka/
export RABBITMQ_HOST=$VIRTUAL_IP
export SCAFFOLD_ZOOKEEPER_HOSTS=$VIRTUAL_IP:2181
export LUA_PATH="./?.lua;$ZBS/lualibs/?/?.lua;$ZBS/lualibs/?.lua"
export LUA_CPATH="$ZBS/bin/linux/x64/?.so;$ZBS/bin/linux/x64/clibs/?.so"
export KAFKA_HOME=/work/kafka_2.11-1.0.2
export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"
export LC_ALL=en_US.UTF-8
export ROCKETMQ_HOME=/usr/local/rocketmq/rocketmq-all-4.4.0-bin-release
export PATH=$ROCKETMQ_HOME/bin:$PATH
相关的自启动服务
[root@cdh1 ~]# cat /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
#start redis
#/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
/usr/bin/su - root -c "/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf"
#start nginx
#/usr/bin/su - root -c "/usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf"
# 启动 zookeeper
/usr/bin/su - root -c "/work/zookeeper/zookeeper_01/bin/zkServer.sh start"
sleep 5s
/usr/bin/su - root -c "/work/zookeeper/zookeeper_02/bin/zkServer.sh start"
# 启动 Nacos
/usr/bin/su - root -c "/work/nacos/bin/startup.sh -m standalone"
#start springcloud
sleep 10s
/usr/bin/su - root -c "/work/cloud-eureka-1.0-SNAPSHOT/bin/deploy.sh start"
sleep 20s
/usr/bin/su - root -c "/work/cloud-config-1.0-SNAPSHOT/bin/deploy.sh start"
# 启动 kafka
/usr/bin/su - root -c "nohup /work/kafka_2.11-1.0.2/bin/kafka-server-start.sh /work/kafka_2.11-1.0.2/config/server.properties 2>&1 &"
#启动 sentinel
# /usr/bin/su - root -c "nohup java -server -Xms64m -Xmx256m -Dserver.port=8849 -Dcsp.sentinel.dashboard.server=localhost:8849 -Dproject.name=sentinel-dashboard -jar /work/sentinel-dashboard-1.7.1.jar 2>&1 &"
leep 2s
# 启动 rocketmq namenode
#/usr/bin/su - root -c "nohup mqnamesrv -n 192.168.56.121:9876 &"
leep 30s
# 启动 rocketmq broker
在window 宿主机配置 hosts 别名,方便访问
192.168.56.121 cdh1
192.168.56.122 cdh2
192.168.56.123 cdh3
192.168.56.121 nginx.server
mysql
mysql -p密码
mysql -p123456
show database
java
java -version
cat /etc/profile
eureka
测试环境的地址:
springcloud config
测试环境的参考地址:
nacos
测试环境的地址:
zookeeper
cdh1:2181
redis
cdh1:6379