Centos7安装redash

一.更改yum国内源:
(1)cd /etc/yum.repos.d/
  sudo yum install wget
(2)备份:sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(3)下载阿里yum源:sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
(4)清理原缓存:sudo yum clean all
(5)建立缓存以后方便缓存中搜索:sudo yum makecache
(5)更新系统包:sudo yum update -y
(6)安装常用包:
sudo yum -y install gcc gcc-c++ kernel-devel make zlib zlib-devel libffi-devel openssl-devel git
(7)当前用户添加到root组:
sudo usermod -aG root 当前centos用户名
(8)安装dnf:sudo yum install dnf -y
--------------------------------------------------------------------------------
二、安装PostgreSql9.6
(1)安装postgresql源: sudo yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat-repo-42.0-11.noarch.rpm
(2)安装postgresql6客户端: sudo yum install -y postgresql96
(3)安装postgresql6服务端: sudo yum install -y postgresql96-server
(4)初始化:sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
(5)设置开机自启:sudo systemctl enable postgresql-9.6
(6)启动postgresql9.6服务: sudo systemctl start postgresql-9.6
(7)修改用户名密码:
1.sudo -u postgres psql
2.alter user postgres with password '密码';
3.create role 当前centos用户名;
4.alter role 当前centos用户名 login;
5.\q
--------------------------------------------------------------------------------
三.安装Redis
(1)下载fedora的epel仓库:sudo yum install epel-release -y
(2)安装:sudo yum install redis
(3)启动redis:sudo systemctl start redis
(4)设置开机自启:sudo systemctl enable redis.service
--------------------------------------------------------------------------------
四.安装Nodejs
sudo yum install nodejs -y
sudo npm config set registry https://registry.npm.taobao.org
sudo npm install n -g
sudo n stable
--------------------------------------------------------------------------------
五.安装python3:
(1)sudo yum -y groupinstall "Development tools"
(2)sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
(3)sudo wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
(4)sudo mkdir /usr/local/python3 
(5)tar -xvJf  Python-3.6.2.tar.xz
(6)cd Python-3.6.2
(7)./configure --prefix=/usr/local/python3
(8)sudo make && sudo make install
(9)ln -s /usr/local/python3/bin/python3 /usr/bin/python3
(10)ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
(11)添加环境变量:
sudo vi /etc/profile
    # 将下面内容添加到文件的最下面
    PATH=$PATH:/usr/local/python3/bin
    #是添加的进行生效命令
    source /etc/profile
    # 最后查看是否添加成功
    echo $PATH
--------------------------------------------------------------------------------
六.安装Redash源码
1、下载代码:
   git clone https://github.com/dazdata/redash.git
   cd redash
更换国内源:npm config set registry https://registry.npm.taobao.org
查看当前源:npm config get registry
2、前端安装依赖包:npm install
3、前端打包:npm run build
4、配置pip国内源:sudo cp pip.conf /etc/pip.conf
5、安装Python虚拟环境:sudo pip3 install virtualenv
sudo pip3 install --upgrade pip
6、创建Python虚拟环境:virtualenv venv
7、激活Python虚拟环境:source venv/bin/activate
8、安装Pip包:
  pip install -r requirements.txt -r requirements_dev.txt -r requirements_bundles.txt
9、初始化数据库表结构:./manage.py database create_tables
10、退出虚拟环境,安装完成:deactivate
--------------------------------------------------------------------------------
七.安装图形界面:
(1)yum upgrade
(2)yum -y groupinstall "X Window System" 
(3)yum -y groupinstall "GNOME Desktop"
(4)启动图形界面:startx
(5)如果 epel库没有安装,则安装:yum install epel-release
(6)安装tigervnc-server:yum install tigervnc-server
(7)安装xrdp:yum install xrdp
(8)为root用户设置VNC密码:vncpasswd root
(9)关闭或配置防火墙:sudo systemctl stop firewalld         第一步
sudo systemctl disable firewalld
查看防火墙开启端口:sudo netstat -anp   
(10)不过,我们要永久关闭SElinux,修改为:SELINUX=disabled:
vi /etc/selinux/config
(11)启动XRDP:
sudo systemctl start xrdp   第二步
  # 开机启动
  systemctl enable xrdp
(12)远程连接测试
运行中输入mstsc,启动远程桌面,然后输入用户名密码进行远程连接。
(13)卸载工作
yum remove xrdp
yum remove tigervnc-server
yum groupremove "GNOME Desktop"
yum groupremove "X Window System"
dos界面与图形化界面切换快捷键
图形到dos:ctrl+alt+f2
dos到图形:输入startx
或者
在命令上输入 init 3 命令 切换到dos界面
输入 init 5命令 切换到图形界面
posted @ 2020-09-20 17:12  哈喽哈喽111111  阅读(1206)  评论(0编辑  收藏  举报