1.启动mysql服务
systemctl start mysqld.service
查看mysql服务状态
systemctl status mysqld.service
2.启动dubbo
dubbo解压后上传到tomcat/webapps/目录下面
dubbo启动要有zookeeper支持,启动dubbo之前要配置dubbo代码里的WEB-INFO/dubbo.properties文件,设置zookeeper。
3.启动zookeeper
拷贝zk,conf目录下的zoo_sample.cfg文件,并改名为zoo.cfg,配置三个参数(注:目录要有,如果没有就手动创建,要么会启动失败,zk不会自己创建目录)
# the directory where the snapshot is stored.
dataDir=/tmp/zookeeper
dataLogDir=/tmp/zookeeper/log
# the port at which the clients will connect
clientPort=2181
zk启动命令
zkServer.sh start
链接zk客户端
./zkCli.sh -server ip:port
4.启动kafka
kafka自带zookeeper,所以会和已有zk冲突,先停以有的zk,然后再启动zk和kafka
启动zk
bin/kafka-server-start.sh config/zookeeper.properties &
启动kafka
bin/kafka-server-start.sh config/server.properties &
测试kafka
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
producer 输入 consumer 就可以收到就证明启动成功
启动kafka监控
cd /home/kafka-web-console-2.1.0-SNAPSHOT/bin
./kafka-web-console -DapplyEvolutions.default=true -Dhttp.port=9001 -mem 64 &
启动失败原因可能是内存设置过大
将 kafka-server-start.sh的 export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" 修改为 export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"kafka 启动成功后,会有9092和2181两个端口。
查看端口占用 lsof -i:9092
yum installed lsof 可安装
5.redis启动,测试相关
./redis-server ../redis.conf
连接redis
redis-cli
设置密码 config set requirepass Tz61**********
登录密码 auth Tz61**********
select 0 选择第一个库
keys * 查看所有key
6. fastDFS启动,测试相关
新三个目录
mkdir /opt/data/fastdfs
mkdir /opt/data/fastdfs/tracker
mkdir /opt/data/fastdfs/storage
配置/home/FastDFS/conf/tracker.conf
# the base path to store data and log files
base_path=/opt/data/fastdfs/tracker
配置/home/FastDFS/conf/storage.conf
# the base path to store data and log files
base_path=/opt/data/fastdfs/storage
# the paths must be exist
store_path0=/opt/data/fastdfs/storage
# tracker_server can ocur more than once, and tracker_server format is
# "host:port", host can be hostname or ip address
tracker_server=119.xxx.xxx.xxx:22122 (配置127.0.0.1本地测试找不到)
启动tracker
# cd /home/FastDFS/tracker
# ./fdfs_trackerd ../conf/tracker.conf
启动storage
# cd /home/FastDFS/storage
# ./fdfs_storaged ../conf/storage.conf
重启
# ./restart.sh tracker/fdfs_trackerd conf/tracker.conf
# ./restart.sh storage/fdfs_storaged conf/storage.conf
测试上传和下载
上传
./fdfs_test ../conf/client.conf upload /home/Python-3.6.3/demo/forTest.py
执行部分结果:
tracker_query_storage_store_list_without_group:
server 1. group_name=, ip_addr=119.23.235.254, port=23000
group_name=group1, ip_addr=119.23.235.254, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/rBKKLVrEZ86AXn9qAAAANiFmFSA0031.py
source ip address: 172.18.138.45
file timestamp=2018-04-04 13:51:10
file size=54
file crc32=560338208
file url: http://127.0.0.1:8080/group1/M00/00/00/rBKKLVrEZ86AXn9qAAAANiFmFSA0031.py
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/rBKKLVrEZ86AXn9qAAAANiFmFSA0031_big.py
source ip address: 172.18.138.45
file timestamp=2018-04-04 13:51:10
file size=54
file crc32=560338208
file url: http://127.0.0.1:8080/group1/M00/00/00/rBKKLVrEZ86AXn9qAAAANiFmFSA0031_big.py
./fdfs_test /etc/fdfs/client.conf download group1 00/00/rBKKLVrEZ86AXn9qAAAANiFmFSA0031_big.py forTest.py