一. 安装VMWare Fusion(略)
二. 寻找arm64架构mac能拉起来的centos7镜像(略)
参考
https://cloud.tencent.com/developer/article/2150583?areaSource=106000.2&traceId=kybnG2SKASN5GqSBiSmu9
三. 从origin镜像安装后开始记录
1. 将虚拟机clone,在克隆的镜像上再做修改。
链接克隆即可,打开虚拟机,输入账号密码即可登录
2. 此时网络不通,进行网络设置
ping www.baidu.com不通
参考链接
https://blog.csdn.net/nengliweb/article/details/131158782
2.1 VMware Fusion创建Nat网络
2.2 VMware Fusion修改Nat网络配置
cd /Library/Preferences/VMware\ Fusion/
注:“\” 是为了转义空格
2.2.1 修改其中的networking文件
vi networking
2.2.2 在当前目录的下一级目录: vmnet2中继续修改配置:
配置网关与子网掩码: 这里记住, 后面在linux机器的网络设置中会用到.
cd vmnet2
vi nat.conf
2.2.3 VMWare设置-网络设置中令刚才的修改生效
使用NAT,去掉勾 -> 应用,再打上勾 -> 应用
2.3 Linux虚拟机网络配置
cd /etc/sysconfig/network-scripts
ls
vi
设为静态ip
2.4 重启网络设置完成.
重启网络: systemctl restart network
VMWare设置刚才新增的NAT
2.5 此时即可ping通
3. 安装vim
编辑配置文件时,发现没有vim,只能用vi,于是想要安装vim。
3.1 运行安装命令
yum -y install vim-enhanced
或者
yum -y install vim*
运行提示失败
3.2 换源
参考文章:
https://blog.csdn.net/Remember_Z/article/details/131362153
3.2.1 进入目录备份原来的
cd /etc/yum.repos.d/
mkdir yum-back
mv CentOS-* yum-back/
3.2.2 替换yum源为阿里源
#vi直接新建文件
vi CentOS-Base.repo
直接复制内容:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
enabled=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
yum源的配置文件
#vi直接新建
vi epel.repo
直接复制内容:
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/SRPMS
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
3.3 检查认证密钥
检查
RPM-GPG-KEY-CentOS-7
和
PM-GPG-KEY-CentOS-7-aarch64
是否存在,如果不存在复制粘贴
cd /etc/pki/rpm-gpg/
ls
[root@node-01 rpm-gpg]# cat RPM-GPG-KEY-CentOS-7
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)
mQINBFOn/0sBEADLDyZ+DQHkcTHDQSE0a0B2iYAEXwpPvs67cJ4tmhe/iMOyVMh9
Yw/vBIF8scm6T/vPN5fopsKiW9UsAhGKg0epC6y5ed+NAUHTEa6pSOdo7CyFDwtn
4HF61Esyb4gzPT6QiSr0zvdTtgYBRZjAEPFVu3Dio0oZ5UQZ7fzdZfeixMQ8VMTQ
4y4x5vik9B+cqmGiq9AW71ixlDYVWasgR093fXiD9NLT4DTtK+KLGYNjJ8eMRqfZ
Ws7g7C+9aEGHfsGZ/SxLOumx/GfiTloal0dnq8TC7XQ/JuNdB9qjoXzRF+faDUsj
WuvNSQEqUXW1dzJjBvroEvgTdfCJfRpIgOrc256qvDMp1SxchMFltPlo5mbSMKu1
x1p4UkAzx543meMlRXOgx2/hnBm6H6L0FsSyDS6P224yF+30eeODD4Ju4BCyQ0jO
IpUxmUnApo/m0eRelI6TRl7jK6aGqSYUNhFBuFxSPKgKYBpFhVzRM63Jsvib82rY
438q3sIOUdxZY6pvMOWRkdUVoz7WBExTdx5NtGX4kdW5QtcQHM+2kht6sBnJsvcB
JYcYIwAUeA5vdRfwLKuZn6SgAUKdgeOtuf+cPR3/E68LZr784SlokiHLtQkfk98j
NXm6fJjXwJvwiM2IiFyg8aUwEEDX5U+QOCA0wYrgUQ/h8iathvBJKSc9jQARAQAB
tEJDZW50T1MtNyBLZXkgKENlbnRPUyA3IE9mZmljaWFsIFNpZ25pbmcgS2V5KSA8
c2VjdXJpdHlAY2VudG9z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2urEMG5CCEpy0K9XZv
bpUexhn7TbP10g5BzC9igd498QcW/69Oz5OK7WcZOtqmGn78pGBCH2ly+IqIV6ZS
9yXC6jOmOnA8fM0gKJAelhQALd77cULMSGbu96ReG3BEFlgWQjbtZG3L5BvMVInw
MkUQEntHvjp6oHtPiIAc3VtLq0IxWVygFHNRABEBAAG0cENlbnRPUyBBbHRBcmNo
IFNJRyAtIEFBcmNoNjQgKGh0dHA6Ly93aWtpLmNlbnRvcy5vcmcvU3BlY2lhbElu
dGVyZXN0R3JvdXAvQWx0QXJjaC9BQXJjaDY0KSA8c2VjdXJpdHlAY2VudG9zLm9y
Zz6JATkEEwECACMFAlW3h2gCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAK
CRBsfLbvMF1J1pSFCACQbLvjwCFdgr0DpVJZ0o50Dcl8jYzZtd/NZOBNYXi/TQza
c6DFhiAj72zkgOGb+xznUXJJIiOLCgyJBUdJQSRx/EfVb9ftd4kSOA/wErOhDV71
Hyww9M/gz82SjHF9qq8ofDto6ZfJMfiLX4aZwR39jZzS5Gm+bH5FfgxlwG0V88fu
aKlzsn3p975uD659tSKae4xLysxkBG6oDaXvnWI2/UGC724gN+R3aKe9kI0wk8wA
h5Qzf7+jRk0qb859rryno1rBpuzxJcwg5qvN2PXG3xDFOHG+3LX3mV3UnVAqCjHO
zyGnzAAiNfBwgMyu6bu4lXd4hbZKy73RwnouQkuA
=qiwp
-----END PGP PUBLIC KEY BLOCK-----
3.4 生成缓存
yum makecache
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
3.5 验证
yum -y install wget
注:wget是一个自动下载器,可以在用户退出系统的之后在后台执行。
3.6 安装vim
yum -y install vim-enhanced
成功
4. 安装jdk
4.1 在/usr/local/src/java目录上传jdk。
注意,需要arm64架构的jdk,去oracle下载
https://www.oracle.com/cn/java/technologies/downloads/#java8-linux
4.2 解压
tar -xvf jdk-8u381-linux-aarch64.tar.gz
4.3 配置环境变量
vi /etc/profile
#set java env
JAVA_HOME=/usr/local/src/java/jdk1.8.0_381
JAVA_BIN=/usr/local/src/java/jdk1.8.0_381/bin
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
source /etc/profile
4.4 验证
java -version
5. 安装zookeeper
5.1 上传、解压
tar -xvf zookeeper-3.4.8.tar.gz
5.2 修改配置文件
在zk根目录下创建文件夹data、log
mkdir data log
复制conf文件bing
cd conf
cp zoo_sample.cfg zoo.cfg
然后在conf中配置这2个目录
5.3 启动
cd /usr/local/src/zookeeper/zookeeper-3.4.8/bin
sh zkServer.sh start
#或者
#./zkServer.sh start