鲲鹏ARM(aarch)软件部署指南

ZFIREH 2020年05月08日 214次浏览

MySQL

前置依赖

[root@arm ~]# yum -y install libaio*

安装包

mysql-5.7.27-aarch64.tar.gz

安装步骤

  1. 添加mysql用户组和mysql用户,用于隔离mysql进程

    [root@arm ~]# groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
    
  2. 安装依赖库

    [root@arm ~]# yum install -y libaio*
    
  3. 解压MySQL(如已存在可省略)

    [root@arm ~]# tar xvf mysql-5.7.27-aarch64.tar.gz -C /usr/local/
    
  4. 配置MySQL

    [root@arm ~]# mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql
    [root@arm ~]# mkdir -p /usr/local/mysql/logs
    [root@arm ~]# chown -R mysql:mysql /usr/local/mysql  
    [root@arm ~]# chown -R mysql:mysql /dev/shm 
    [root@arm ~]# ln -sf  /usr/local/mysql/my.cnf /etc/my.cnf
    [root@arm ~]# cp -rf /usr/local/mysql/extra/lib* /usr/lib64/ 
    [root@arm ~]# mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.old
    [root@arm ~]# ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6
    
    # 设置开机启动
    [root@arm ~]# cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld  
    [root@arm ~]# chmod +x /etc/init.d/mysqld
    [root@arm ~]# systemctl enable mysqld
    
  5. 添加环境变量

    [root@ecs-arm ~]# vi /etc/profile
    export MYSQL_HOME=/usr/local/mysql
    export PATH=$PATH:$MYSQL_HOME/bin
    
    [root@ecs-arm ~]# source /etc/profil
    
  6. 初始化启动MySQL

    • 无密码初始化登录
    [root@ecs-arm ~]# mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
    [root@ecs-arm ~]# systemctl start mysqld
    [root@ecs-arm ~]# systemctl status mysqld
    # 设置数据库root的密码
    [root@ecs-arm ~]# mysql_secure_installation
    
    • 随机密码初始化登录
    # "–initialize"生成随机密码,在这里存储在/usr/local/mysql/logs/mysql-error.log
    [root@ecs-arm ~]# mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
    [root@ecs-arm ~]# systemctl start mysqld
    [root@ecs-arm ~]# systemctl status mysqld
    # 查看随机密码
    [root@ecs-arm ~]# cat /usr/local/mysql/logs/mysql-error.log | grep password
    

Java(openjdk)

前置依赖

暂无

安装包

OpenJDK8U-jdk_aarch64

安装步骤

  1. 当可连通外网时,可通过yum方式安装

    [root@ecs-arm ~]# yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel -y
    
  2. 当内网环境时

    # 解压安装包:
    [root@ecs-arm ~]# tar -zxvf OpenJDK8U-jdk_aarch64_linux_hotspot_8u191b12.tar.gz -C /usr/local
    # 配置环境变量
    [root@ecs-arm ~]# vim /etc/profile
    # 在文件末尾加上:
    JAVA_HOME=/usr/local/jdk8u191-b12
    PATH=$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH
    # 使环境变量生效:
    [root@ecs-arm ~]# source /etc/profile
    
  3. 验证

    [root@ecs-arm ~]# java -version
    

zookeeper

前置依赖

jdk1.8

安装包

zookeeper-3.4.9.aarch安装包

安装步骤

  1. 解压安装包

    [root@ecs-arm ~]# tar -zxvf zookeeper-3.4.9.aarch64.tar.gz
    
  2. 进入到解压后的目录,并创建data和log目录

    [root@ecs-arm ~]#  cd zookeeper-3.4.9
    [root@ecs-arm ~]#  mkdir data log
    
  3. 在zookeeper的conf目录下生成和修改zoo.cfg配置文件

    [root@ecs-arm ~]#  cd conf
    [root@ecs-arm ~]#  cp zoo_sample.cfg zoo.cfg
    # 可选
    [root@ecs-arm ~]#  vim zoo.cfg
    #文件内容如下,标红的 代表做过修改,其他的默认
    # The number of milliseconds of each tick
    tickTime=2000
    # The number of ticks that the initial 
    # synchronization phase can take
    initLimit=10
    # The number of ticks that can pass between 
    # sending a request and getting an acknowledgement
    syncLimit=5
    # the directory where the snapshot is stored.
    # do not use /tmp for storage, /tmp here is just 
    # example sakes.
    dataDir=../data
    dataLogDir=../logs
    # the port at which the clients will connect
    clientPort=2181
    
  4. 启动服务

    [root@ecs-arm ~]#  cd ..
    [root@ecs-arm ~]#  bin/zkServer.sh start
    
  5. 验证服务

    [root@ecs-arm ~]#  bin/zkServer.sh status
    

移植指南

[ARM64-CentOS7.5_Zookeeper 3.4.6应用移植指南V1.0-发布版.pdf](https://obs.zhouhuo.com.cn/arm/arm-docs/ARM64-CentOS7.5_Zookeeper 3.4.6应用移植指南V1.0-发布版.pdf)


RabbitMQ & erlang

前置依赖安装

[root@ecs-arm ~]#  yum install socat

安装包

安装步骤

  1. 安装erlang

    [root@ecs-arm ~]#  rpm -ivh erlang-20.1.7.1-1.el7.centos.a.aarch64.rpm
    
  2. 安装RabbitMQ

    [root@ecs-arm ~]#  rpm -ivh rabbitmq-server-3.7.4-1.el7.noarch.rpm
    
  3. RabbitMQ启停

# 启动
[root@ecs-arm ~]# systemctl start rabbitmq-server 
# 查看状态
[root@ecs-arm ~]# systemctl status rabbitmq-server
# 停止
[root@ecs-arm ~]# systemctl stop rabbitmq-server
  1. RabbitMQ 开机自启

    [root@ecs-arm ~]# systemctl enable rabbitmq-server
    
  2. 其他操作命令

     #启用RabbitMQ的管理插件
    [root@ecs-arm ~]# rabbitmq-plugins enable rabbitmq_management
     #设置用户名和密码
    [root@ecs-arm ~]# rabbitmqctl add_user admin admin
     #设置用户角色
    [root@ecs-arm ~]# rabbitmqctl set_user_tags admin administrator
     #为admin分配权限
    [root@ecs-arm ~]# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
     #重启rabbitmq服务
    [root@ecs-arm ~]# systemctl restart rabbitmq-server
    

移植指南

参考ARM64_CentoOS-7.5_RabbitMQ3.7.4移植指南V1.0


Redis

前置依赖安装

[root@ecs-arm ~]# yum install -y jemalloc jemalloc-devel

安装包

redis-4.0.3-aarch64.tar.gz

安装步骤(以单机版为例)

  1. 解压安装包

    [root@ecs-arm ~]# tar -xvf  redis-4.0.3-aarch64.tar.gz 
    
  2. 进入到解压后的目录

    [root@ecs-arm ~]#  cd redis-4.0.3  
    
  3. 编译

    [root@ecs-arm ~]#  make
    
  4. 安装到指定目录

    # 本例所在目录需root权限,也可安装在其他目录,例如/home/dam/soft/redis
    # 创建安装目录
    [root@ecs-arm ~]# mkdir -p /usr/local/redis
    #安装
    [root@ecs-arm ~]# make PREFIX=/usr/local/redis install
    # 创建配置文件目录
    [root@ecs-arm ~]# mkdir -p /usr/local/redis/conf
    # 拷贝配置文件 从解压包拷贝
    [root@ecs-arm ~]# cp redis.conf /usr/local/redis/conf
    
  5. 修改配置文件

    [root@ecs-arm ~]# vim /usr/local/redis/conf/redis.conf
    

    需修改以下配置

    daemonize yes # 守护进程运行(后台运行)

    bind 127.0.0.1 192.168.0.246 # 绑定内网IP,如仅本机访问,绑定127.0.0.1即可,公网环境需修改端口或设置密码,防止入侵

    修改端口(选做)

    port 6389 #设置端口为6389

    requirepass bmsoft@123 #设置密码为bmsoft@123

  6. 启动和验证

    [root@ecs-arm ~]# cd /usr/local/redis
    # 启动
    [root@ecs-arm ~]# bin/redis-server conf/redis.conf
    # 客户端连接
    [root@ecs-arm ~]# bin/redis-cli -h <ip> -p <端口> -a <密码 如设置>
    

移植指南

ARM64_Centos-7.5_Redis移植指南V1.1-发布版.pdf


Nginx

前置依赖安装

[root@ecs-arm ~]# yum   install gcc gcc-c++ openssl openssl-devel cmake unzip pcre zlib zlib-devel   libxml2 libxml2-devel gd-devel readline readline-devel ncurses ncurses-devel   perl-devel perl-ExtUtils-Embed

安装包

安装步骤

  1. 解压pcre-8.42

    [root@ecs-arm ~]# tar -zxvf pcre-8.42.tar.gz -C /usr/local
    
  2. 解压nginx

    [root@ecs-arm ~]# tar -zxvf nginx-1.15.0.tar.gz
    
  3. 执行编译

    [root@ecs-arm ~]# cd nginx-1.15.0
    [root@ecs-arm ~]# mkdir -p /usr/local/nginx
    # 执行编译
    [root@ecs-arm ~]# ./configure   --prefix=/usr/local/nginx --with-http_stub_status_module   --with-http_ssl_module --with-pcre=/usr/local/pcre-8.42
    
  4. 安装

    [root@ecs-arm ~]# make && make install
    
  5. 设置环境变量(选做)

    #设置环境变量
    [root@ecs-arm ~]# vim /etc/profile
    #在文件末尾添加如下内容
    export NGINX_HOME=/usr/local/nginx
    export PATH=$PATH:${NGINX_HOME}/sbin
    
  6. 使环境变量生效

    [root@ecs-arm ~]# souce /etc/profile
    
  7. 启动&测试

    # 启动
    [root@ecs-arm ~]# nginx
    # 查看版本
    [root@ecs-arm ~]# nginx -v
    # 测试
    [root@ecs-arm ~]# curl 127.0.0.1:80
    

鲲鹏镜像站

鲲鹏软件镜像站


原生Hadoop

安装包(已编译移植):hadoop-3.1.3.tar.gz


原生Hive

安装包(已编译移植):apache-hive-3.0.0-bin.tar.gz

如启动时抛出如下异常,需查找hive 与hadoop中的guava包,保留高版本,删除低版本,并将高版本jar包复制到低版本jar包所在路径

SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357)
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
        at org.apache.hadoop.mapred.JobConf.setJar(JobConf.java:536)
        at org.apache.hadoop.mapred.JobConf.setJarByClass(JobConf.java:554)
        at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:448)
        at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:5141)
        at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:5099)
        at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:97)
        at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:81)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:699)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236)

鲲鹏大数据解决方案-移植指南