java –version java version "1.8.0_202" Java(TM) SE Runtime Environment (build 1.8.0_202-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
zookeeper3.6.1安装
安装
1 2 3 4 5 6 7 8
su - root mkdir -p /expoer/soft #上传 rz apache-zookeeper-3.6.1-bin.tar.gz #解压 tar -zxvf apache-zookeeper-3.6.1-bin.tar.gz #重命名 mv apache-zookeeper-3.6.1-bin zk
配置
1 2 3 4
#新建/expoer/soft/zk/data目录 mkdir data #修改conf mv zoo_sample.cfg zoo.cfg
在zoo.cfg中修改以下内容
1
dataDir=/export/soft/zk/data
验证
1 2 3 4 5 6 7
cd .. sh bin/zkServer.sh start 查看状态 sh bin/zkServer.sh status 查看进程 ps -ef|grep zookeeper sh bin/zkCli.sh -server 127.0.0.1:2181
Dubbo-admin安装
安装
1 2 3
mkdir -p /expoer/soft/dubbo-admin cd dubbo-admin rz dubbo-admin-server-0.2.0-SNAPSHOT.jar
#检查mysql组和用户是否存在,如果没有则创建 cat /etc/group|grep mysql groupadd mysql
如果报错 groupadd: cannot open /etc/group
解决方法使用root用户
1 2 3 4 5 6 7 8 9 10 11 12
chattr -i /etc/gshadow chattr -i /etc/group groupadd mysql #创建mysql用户 #useradd -r参数表示mysql用户是系统用户,不可用于登录系统 useradd -r -g mysql mysql chattr -i /etc/shadow chattr -i /etc/passwd useradd -r -g mysql mysql #将/usr/local/mysql-5.7.35的所有者及所属组改为mysql chown -R mysql.mysql /export/soft/mysql-5.7.35/ cp my_default.cnf /etc/my.cnf
初始化Mysql
1 2
cd bin ./mysqld --initialize --user=mysql --user=mysql --basedir=/export/soft/mysql-5.7.35/ --datadir=/export/soft/mysql-5.7.35/data/
初始化完成之后查看日志里的是临时密码
1
cat /export/soft/mysql-5.7.35/data/mysqld.log
启动Mysql
1 2 3 4 5 6
#把启动脚本放到开机初始化目录 cp support-files/mysql.server /etc/init.d/mysql #启动mysql service mysql start # 重启 service mysql restart 或 sudo /etc/init.d/mysql restart
#进入mysql并更改密码 cd /export/soft/mysql-5.7.35/bin ./mysql -uroot -h127.0.0.1 -p # 登入mysql后修改root密码 mysql> set password=password('foo@bar'); mysql> grant all privileges on *.* to root@'%' identified by 'foo@bar'; mysql> flush privileges;
新建mytest账号 远程登录% mysql> use mysql; mysql> CREATE USER 'mytest'@'%' IDENTIFIED BY 'foo@bar'; #修改mysql库的user表,将host项,从localhost改为%。%这里表示的是允许任意host访问,如果只允许某一个ip访问,则可改为相应的ip mysql> update user set host='%'where user = 'xdkj'; #给mytest授予所有权限 mysql> GRANT ALL ON *.* TO 'mytest'@'%'; #刷新系统权限表 mysql>flush privileges; mysql>quit;
stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir ./
slave-serve-stale-data yes slave-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-disable-tcp-nodelay no slave-priority 100
lazyfree-lazy-eviction no lazyfree-lazy-expire no lazyfree-lazy-server-del no slave-lazy-flush no # appendonly no appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb
# es不能使用root用户启动 cd elasticsearch-7.6.0/bin #检查es组和用户是否存在,如果没有则创建 cat /etc/group|grep es groupadd es useradd -r -g es es chown -R es elasticsearch-7.6.0 # 切到es用户 su es # -d后台启动 bash-4.2$ ./elasticsearch –d #初始化密码foo@bar ./elasticsearch-setup-passwords interactive