Giter VIP home page Giter VIP logo

dof's Introduction

Dockerfile

From hub.c.163.com/library/centos:5

MAINTAINER actanble [email protected]

COPY CentOS-Base.repo /etc/yum.repos.d/
# RUN sed -in "s/5.11/5.10/g" CentOS-Base.repo
RUN echo 'http://vault.centos.org/5.11/os/x86_64/' > /var/cache/yum/libselinux/mirrorlist.txt;
RUN yum makecache;
RUN yum -y update;
RUN yum -y install gcc gcc-c++ make zlib-devel libc.so.6 libstdc++ glibc.i686;
## 安装基础工具_可选
# yum -y unzip git net-tools curl wget 
COPY dof.tar.gz /
WORKDIR /
RUN tar zxvf dof.tar.gz ;
RUN rm -f dof.tar.gz ;
RUN cd /home/GeoIP-1.4.8/ ;
RUN ./configure
RUN make && make check && make install ;
RUN find /home/neople/ -type f -name "*.tbl" | xargs sed -i "s/101.200.211.94/192.168.0.110/g" ;
RUN find /home/neople/ -type f -name "*.cfg" | xargs sed -i "s/101.200.211.94/192.168.0.110/g" ;
# RUN find /home/neople/game/cfg/ -type f -name "*.cfg" | xargs sed -i "s/127.0.0.1/192.168.0.110/g" ;
RUN chmod 755 /opt/lampp/etc/my.cnf ;
RUN /bin/bash /root/run ;
EXPOSE 80 3306 8000 10013 30303 30403 10315 \
30603 7245 20303 40401 30803 20403 31100
CMD ["/bin/bash", "/root/run"]

注意替换 192.168.0.110(39.108.85.252) 为自己的局域网 Ip

镜像中用的是 39.108.85.252 注意自己替换; 接着运行

find /home/neople/ -type f -name "*.cfg" | xargs sed -i "s/39.108.85.252/<your-ip>/g" ;
# docker run -itd --name=dxf ---net=host --cpu-period=100000 --cpu-quota=200000  hub.c.163.com/actanble/dxf:0.2-beta

如果出现错误安装上面的Dockerfile排查。

切记注意 game/cfg 下的配置文件

宿主机部署

#!/bin/bash
## @copyright by actanble [email protected]  

wget http://roothan.com:30080/CentOS-Base.repo ;
wget -t 0 http://roothan.com:30080/dof.tar.gz ;
chmod 777 CentOS-Base.repo  ;
chmod 777 dof.tar.gz ;
yum clean all ;
yum makecache  ;
rm -rf /etc/yum.repos.d/* ;
mv CentOS-Base.repo /etc/yum.repos.d/ ;
mv dof.tar.gz / ;
yum -y update  ;
yum -y install gcc gcc-c++ make zlib-devel libc.so.6 libstdc++ glibc.i686;
## 安装基础工具_可选
# yum -y unzip git net-tools curl wget 
cd /  ;
tar zxvf dof.tar.gz ;
rm -f dof.tar.gz ;
cd /home/GeoIP-1.4.8/ ;
./configure
make && make check && make install ;

IP=`curl -s http://v4.ipv6-test.com/api/myip.php` ; 
find /home/neople/ -type f -name "*.tbl" | xargs sed -i "s/101.200.211.94/${IP}/g" ;
find /home/neople/ -type f -name "*.cfg" | xargs sed -i "s/101.200.211.94/${IP}/g" ;
# RUN find /home/neople/game/cfg/ -type f -name "*.cfg" | xargs sed -i "s/127.0.0.1/192.168.0.110/g" ;
chmod 755 /opt/lampp/etc/my.cnf ;

## 添加虚拟内存
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=6000
mkswap /var/swap.1
swapon /var/swap.1
sed -i '$a /var/swap.1 swap swap default 0 0' /etc/fstab

## 数据库用户修改
function modify_user() {
    HOSTNAME="127.0.0.1"
    PORT="3306"
    USERNAME="game"
    PASSWORD="uu5!^%jg"
    DBNAME="mysql"
    sql = """update user set authentication_string = password('09121233.') where user = 'actanble';
             update user set authentication_string = password('uu5!^%jg') where user = 'game';
             GRANT ALL PRIVILEGES ON *.* TO 'actanble'@'%' IDENTIFIED BY '09121233.' WITH GRANT OPTION;
             GRANT ALL PRIVILEGES ON *.* TO 'game'@'127.0.0.1' IDENTIFIED BY 'uu5!^%jg' WITH GRANT OPTION;
             delete from user where user='game' and host = '%';"""
    mysql -h${HOSTNAME}  -P${PORT}  -u${USERNAME} -p${PASSWORD} ${DBNAME} -e "${sql}";
}

# modify_user()

## 运行
/bin/bash /root/run 




dof's People

Contributors

meigea avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

dcdw20008 lzb112

dof's Issues

常见错误和解决方法

频道初始化数据溢出

数据库多进程读取出错

free swap 问题

数据SQL初始化失败

DB name='d_channel'
Try Mysql Login~~~~
DB ip='127.0.0.1'
DB id='game'
DB pw='uu5!^%jg'
DB name='d_channel'
Try Mysql Login~~~~

上述出现问题 统一增加虚拟内存

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :


Vagrant.configure("2") do |config|
  
  config.vm.box = "centos/7"
  config.vm.hostname = "dox1"
  config.vm.network "public_network", ip: "192.168.3.55"
  config.vm.synced_folder "./data", "/vagrant_data"

  config.ssh.username = 'vagrant' 
  config.ssh.password = 'vagrant'

  config.vm.provider "virtualbox" do |vb|
	vb.memory = "2048"
	vb.cpus = 2
	vb.name = "77cen7"
  end
  
  
end

centos.repo


[base]  
name=CentOS-$releasever - Base  
baseurl=http://vault.centos.org/5.11/os/x86_64/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  
  
  
#released updates   
[updates]  
name=CentOS-$releasever - Updates   
baseurl=http://vault.centos.org/5.11/updates/x86_64/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  
  
  
#additional packages that may be useful  
[extras]  
name=CentOS-$releasever - Extras  
baseurl=http://vault.centos.org/5.11/extras/x86_64/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  
  
  
  
  
#additional packages that extend functionality of existing packages  
[centosplus]  
name=CentOS-$releasever - Plus   
baseurl=http://vault.centos.org/5.11/centosplus/x86_64/  
gpgcheck=1  
enabled=0  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  
  
  
  
  
#contrib - packages by Centos Users  
[contrib]  
name=CentOS-$releasever - Contrib  
baseurl=http://vault.centos.org/5.11/contrib/x86_64/  
gpgcheck=1  
enabled=0  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :


Vagrant.configure("2") do |config|
  
  config.vm.box = "actanble/centos5"
  config.vm.hostname = "dof"
  config.vm.network "public_network", ip: "192.168.3.27"
  config.vm.synced_folder "./data", "/vagrant_data"

  config.ssh.username = 'vagrant' 
  config.ssh.password = 'vagrant'

  config.vm.provider "virtualbox" do |vb|
	vb.memory = "4096"
	vb.cpus = 4
	vb.name = "dof"
  end
end

网盘工具分享


- dxf-20190309.box 网盘
链接: https://pan.baidu.com/s/1uNkKnjTqZ3k82WDybOcnug 提取码: 1111

- dof.tar.gz 
链接: https://pan.baidu.com/s/1tA3tcYcSSXsYaYx2D0JmgA 提取码: 2333

- 梦太晓PVF大全
链接: https://pan.baidu.com/s/10k0U_AToDD5DP7GqA0leLA 提取码: 1111

问题解决 cfg问题public.pem网关登录

采用4.5统一网关登陆器。
config.ini 和 pem 要放到根目录。

# !/bin/bash
YOUR_IP=$(ifconfig | grep inet\ addr:192 | awk -F : '{print $2}' | awk '{print $1}')
find /home/neople/ -type f -name ".tbl" | xargs sed -i "s/192.168.3.27/$YOUR_IP/g" ;
find /home/neople/ -type f -name ".cfg" | grep -v __ | xargs sed -i "s/192.168.3.27/$YOUR_IP/g" ;

ssh client error

HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1

Vagrantbox搭建

find /home/neople/ -type f -name "*.tbl" | xargs sed -i "s/101.200.211.94/192.168.3.27/g" ;
find /home/neople/ -type f -name "*.cfg" | grep -v __ | xargs sed -i "s/101.200.211.94/192.168.3.27/g" ;
chmod 755 /opt/lampp/etc/my.cnf ;
cd /home/GeoIP-1.4.8/  &&  ./configure && make && make check && make install ;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.